[Haskell-cafe] New to Monads

Wolfgang Jeltsch wolfgang at jeltsch.net
Fri Oct 7 03:09:08 EDT 2005


Am Freitag, 7. Oktober 2005 06:32 schrieb Cale Gibbard:
> That | m -> s reads "where m determines s", and means that there can
> be at most one s (here, the state type) for a given m (the monad
> type). This is used in type inference and checking to ensure that the
> type of state being carried around by a monad in MonadState is well
> defined, and to prevent you from having to annotate the operations in
> MonadState with type signatures. (To tell which type s to use.)

What you can express via this syntax is called functional dependencies (in
analogy to functional dependencies in database theory).  One should note that
functional dependencies and even multi-parameter type classes are an
extension to Haskell 98 and not part of Haskell 98 which is why you haven't
read about them in the tutorial.

> [...]

Best wishes,
Wolfgang


More information about the Haskell-Cafe mailing list