5 Aug 21:06 2013

## Improving void

Edward Kmett <ekmett <at> gmail.com>

2013-08-05 19:06:07 GMT

2013-08-05 19:06:07 GMT

Right now the definition of Control.Monad.void is:
void :: Functor f => f a -> f ()
void = fmap (const ())
I propose we replace it withvoid :: 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.
Discussion Period: 2 weeks

_______________________________________________ Libraries mailing list Libraries <at> haskell.org http://www.haskell.org/mailman/listinfo/libraries