|
The second extension was first introduced about five years
ago, where it was christened "constructor classes" because
it allowed the definition of classes whose instances were
type constructors, and not just simple types. One of the
most popular applications of constructor classes has
been to provide support for programming in a monadic style.
The class declaration on this slide is based on the Haskell
definition of a monad. Note that the parameter "m" used
here ranges of type constructors, and instances of the class
include the familiar list monad, the trivial identity monad,
and the standard IO monad, which is used for top-level I/O
in Haskell programs.
Next...
|