
14 Jun
2011
14 Jun
'11
3:16 p.m.
I'm someone will offer a much more eloquent answer after me but here's my shot as a fellow beginner: The type Maybe is defined: data Maybe a = Just a | Nothing It means that a value of type Maybe String can manifest in 1 of 2 values: either Nothing, which typically signifies an error has occurred or a "null" value that you'd see in other programming languages. Just "foo" is a value that represent a value that is *not* nothing, such as a successful result from a computation. You can pattern match to get the value out of it: case somethingThatProducesAMaybe of Just success -> doStuff success Nothing -> error "Oh the humanity!" I hope that helps. -- Michael Xavier http://www.michaelxavier.net