2018-12-02 22:19
Page 1

Instances in the Monad class

Monads we have encountered before

instance Monad IO     -- predefined
instance Monad Gen    -- from QuickCheck
instance Monad Parser -- from the Parsing module
Page 2

The Maybe type is a monad

Page 3

The list type is a monad

Page 4

List comprehensions vs do blocks

  • The list monad is the same as list comprehensions Page 5

    Instances in the Functor class

    Page 6

    The Maybe type is a Functor

    Page 7

    The list type is a Functor

    Page 8

    Instances in the Applicative class

    Page 9

    The list type is in Applicative

    Page 10

    The Maybe type is in Applicative

    Page 11

    A note about changes in GHC 7.10