Code examples for today's lecture

Beiträge: 295
Registriert: 16. Jan 2009 14:53

Code examples for today's lecture

Beitrag von sewe »

The code examples of today's lecture (the various assembly lines) are now available in the SVN repository: ... 012-05-18/.

Some suggestion you could do with them, to get a better feel for monads:
  • Try using the Identity monad (from Control.Monad.Identity) instead of Maybe or Tray in maybe-line.hs and tray-line.hs. What happens on fail?
  • Change generic-line.hs to use the do-Notation.
  • Change state-line.hs such that StateT s becomes an instance of Monad; then use either >>= or the do-Notation.
If you run into any trouble with the above, just ask here in the forum.

Zurück zu „Archiv“