[Haskell-fr] Re: inférence

Dan Popa popavdan at yahoo.com
Tue Sep 18 09:23:49 EDT 2007

Salut, c'est encore moi 

> Egalement je ne comprend pas pourquoi on appel ça la
> monade Maybe.
> Pour moi une monade c'est une encapsulation d'une
> suite d'opérations
> impératives...
> Or là je vois le Maybe comme un sorte d'algèbre sur
> les types:
> Maybe a c'est la "somme" de 2 types: "a" ou "rien".

About monads:

A monad is just an algebraic structure having two
neccesary operations: bind (>>=) and return . For an
other  example the set of real numbers R is a ring
having operations like + and  * . And 0 and 1 if you
need them are also here.

But we may want to use the support set of an algebraic
structure withaout taking care what this structure is.
Somebodi in finance for example don't know anything
about rings and other structures but he /she uses
numbers from R daily.

That's the case of Maybe: The set {Maybe a | a <- any
type} U {Nothing} can be seen as a monad BY DEFINING
PROPER monadic operations. But we can use only the
datatype to represent computable or uncomputable
(Nothing) values.

Need to use Maybe ? Use it ! It's defined.

Dan Popa

Shape Yahoo! in your own image.  Join our Network Research Panel today!   http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 

More information about the Haskell-fr mailing list