
14 Jun
2011
14 Jun
'11
11:29 a.m.
"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
lot cleaner.
On Tue, Jun 14, 2011 at 8:00 AM, John Sampson
What does the word "Just" mean in Haskell code? What is its purpose?
Regards
_John Sampson_
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
-- -- Regards, KC