[PL-sem-jr] Monad exercises

Artem Pelenitsyn a.pelenitsyn at gmail.com
Wed Nov 21 21:27:28 EST 2018


Hi, here is the three files loaded into online IDE. Click FORK in the upper
left corner to start editing your version.

1) m01_direct.hs https://ideone.com/lyQPo8
2) m02_monadic.hs https://ideone.com/iw3CWI
3) m03_donotation.hs https://ideone.com/NDUwy6

(I only had to rename modules to Main and add main function to make online
thing happy)

-- Best, Artem

On Wed, 21 Nov 2018 at 18:31 Hugo Musso Gualandi <hgualandi at inf.puc-rio.br>
wrote:

> Hi everyone,
>
> I prepared two exercises for playing with Monads, highlighting the
> State and the Maybe monads. I lifted them from the Wadler paper that
> we floated around earlier.
>
> The files can be downloaded from my website (my previous attempt to
> attach them to this email hit a paranoid the antivirus filter):
> http://www.inf.puc-rio.br/~hgualandi/stuff/pljr-monad-problems.tar.gz
>
> The task for the exercizes is to fill in the "undefined" blanks in the
> example files I provided and to get the code to work. There are three
> files:
>
> m01_direct: Try to implement the functions with straightforward Haskell
> code.
>
> m02_monadic: This time, implement the monadic "bind" and "return"
> functions and reimplement the evaluators using them.
>
> m03_donotation: This one adds the necessary boilerplate to the code
> from the previous exercise, so it can be hooked up with the actual
> Monad typeclass and so you can use do-notation with it. I found that it
> got a bit clunky, so I consider it "extra credit".
>
> I tried to keep these short but please let me know if you need anything
> else.
>
> -- Hugo
>
>
> _______________________________________________
> Pl-sem-jr mailing list
> Pl-sem-jr at lists.ccs.neu.edu
> https://lists.ccs.neu.edu/bin/listinfo/pl-sem-jr
>
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the Pl-sem-jr mailing list