
On 5/4/2014 10:42 AM, Dan Serban wrote:
Hi Alan,
Check out these two functions, they point you towards how to write more idiomatic code. They are called smart destructors, google that term for more information:
λ> :i maybe maybe :: b -> (a -> b) -> Maybe a -> b -- Defined in `Data.Maybe' λ> :i either either :: (a -> c) -> (b -> c) -> Either a b -> c -- Defined in `Data.Either' _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
I'm following this thread, and the only "smart destructors" I turned up with Google is this post: http://stackoverflow.com/questions/10161009/input-checks-in-haskell-data-con... The Haskellwiki has a mention but it's a blank page.