Introducing Monads

2001-12-07


Klicka här för att starta


Innehållsförteckning

Introducing Monads

Common ”Look and Feel”

The do Syntactic Sugar

Example

What are the Types?

What are the Types?

What are the Types?

What are the Types?

What are the Types?

The Monad Class

The Monad Class

Why Use Monads?

Why Use Monads?

Why Use Monads?

Why Use Monads?

Systematic Monad Implementation

Systematic Monad Implementation

The Identity Monad

Adding Features: Monad Transformers

Adding Features: Monad Transformers

Example: Adding State

The State Monad

The State Monad

The State Monad is a StateMonad

State is a Monad Transformer

Last Step: Run Functions

Summary: How to Add a Feature

Another Example: Failure

Actions with Failure

Sequencing Failure

Supporting Failure

Lifting Actions to Failure

Observing Result of a Failure

Observing Result of a Failure

Combining Features

Sample Runs

Sample Runs

What are the types?

Why the Different Behaviour?

Example: Parsing

Parsing a Token

Completing the Library

Summary

Författare: John Hughes

E-post: rjmh@cs.chalmers.se

Hemsida: www.cs.chalmers.se/~rjmh