
23 May
2011
23 May
'11
4:20 p.m.
Brent Yorgey schrieb:
On Mon, May 23, 2011 at 10:49:55AM -0700, Alexander Solla wrote:
There's a library function for it, but also:
filter ((/=) Nothing) is readable enough.
Just a minor quibble: note that
filter (not . isNothing)
is slightly preferable since it does not introduce a frivolous equality constraint on the type wrapped by the Maybe.
Similar: http://www.haskell.org/haskellwiki/Haskell_programming_tips#Reduce_type_clas... http://www.haskell.org/haskellwiki/Haskell_programming_tips#Don.27t_ask_for_...