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_class_constraints
http://www.haskell.org/haskellwiki/Haskell_programming_tips#Don.27t_ask_for_the_length_of_a_list_when_you_don.27t_need_it

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to