
6 Aug
2013
6 Aug
'13
11:18 p.m.
On 8/5/13 3:06 PM, Edward Kmett wrote:
Right now the definition of Control.Monad.void is:
void :: Functor f => f a -> f ()
void = fmap (const ())
I propose we replace it with
void :: Functor f => f a -> f ()
void = (() <$)
This expands out to the former definition by the default definition of (<$) and Data.Functor.Functor exports (<$) explicitly to make it possible to optimize this sort of thing. It seems a shame not to use it.
+1. That was the entire point of (<$) being added to the class afterall. -- Live well, ~wren