
7 May
2011
7 May
'11
9:53 p.m.
On 5/7/11 5:15 PM, dm-list-haskell-cafe@scs.stanford.edu wrote:
In general, I try to place as few requirements in the contexts of functions as possible.
One counterargument to this philosophy is that there are many cases where fmap can be defined more efficiently than the liftM derived from return and (>>=). Similarly, the applicative operators (<*) and (*>) often admit more efficient implementations than the default. So, when dealing with monads that have those more efficient definitions, you're restricting performance unnecessarily by forcing them to use the generic monadic definitions. There's nothing wrong with having multiple constraints in the context. -- Live well, ~wren