[Haskell-beginners] [Haskell-Beginners] Just
kc1956 at gmail.com
Tue Jun 14 17:29:57 CEST 2011
"Just" is a context adder to a pure value; so now the value can exist
or be "Nothing".
data Maybe a = Just a | Nothing
The Maybe data type is an instance of monad to implement its behaviour.
Without the Maybe type one would have to use the output value of a
function to signal an error; e.g. -1; so the Maybe type makes code a
On Tue, Jun 14, 2011 at 8:00 AM, John Sampson <jrs.idx at ntlworld.com> wrote:
> What does the word "Just" mean in Haskell code? What is its purpose?
> _John Sampson_
> Beginners mailing list
> Beginners at haskell.org
More information about the Beginners