27.12.2013 Views

Wearing the hair shirt Wearing the hair shirt - Microsoft Research

Wearing the hair shirt Wearing the hair shirt - Microsoft Research

Wearing the hair shirt Wearing the hair shirt - Microsoft Research

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Type classes are useful<br />

Type classes have proved extraordinarily<br />

convenient in practice<br />

Equality, ordering, serialisation, numerical<br />

operations, and not just <strong>the</strong> built-in ones<br />

(e.g. pretty-printing, time-varying values)<br />

Monadic operations<br />

class Monad m where<br />

return :: a -> m a<br />

(>>=) :: m a -> (a -> m b) -> m b<br />

fail :: String -> m a<br />

Note <strong>the</strong> higher-kinded type variable, m

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!