[Haskell-beginners] basic Functor, Applicative and Monad instances

Imants Cekusins imantc at gmail.com
Thu Jul 16 20:54:36 UTC 2015


v2: Val monad is now necessary:

main::Int -> Val Weather
main i = do                         -- do:   Val as monad
   v1 <- return $ Val' i       -- pure: applicative
   v2 <- return $ over20 <$> v1     -- <$> : functor
   v3 <- Val' weather <*> v2  -- <*> : applicative
   return v3


More information about the Beginners mailing list