Monad classes

Posted on 2016-05-10 by Oleg Grenrus

A short example, on how to use monad classes to program against the interface.

class Monad m => MonadLog m where
   log :: Text -> m ()

class Monad m => MonadProgress m where
    reportProgress :: Done -> All -> m ()

is very same as passing an object implementing LoggerInterface or ProgressInterface.

Gist source


Site proudly generated by Hakyll