darcs patch: Control.Monad: +void :: f a -> f ()

Edward Kmett ekmett at gmail.com
Fri Jan 8 22:21:07 EST 2010


Yes, though if you add the type signature in Foreign.Marshal.Error then if
someone had existing code that looks like:

import Foreign.Marshal.Error
import Control.Monad

blah blah void blah

then it'll conflict. Left with the more permissive type signature that would
just work.

-Edward Kmett

On Fri, Jan 8, 2010 at 10:08 PM, Gwern Branwen <gwern0 at gmail.com> wrote:

> On Fri, Jan 8, 2010 at 9:54 PM, Jeremy Shaw <jeremy at n-heptane.com> wrote:
> > Not sure if this came up already, but there is a less general version of
> > void in Foreign.Marshal.Error:
> >
> >
> http://www.haskell.org/ghc/docs/latest/html/libraries/base-4.2.0.0/Foreign-Marshal-Error.html#v%3Avoid
> >
> > void :: IO a -> IO ()
> >     Discard the return value of an IO action
> >
> > Are there plans to unify the two? Perhaps Foreign.Marshal.Error can just
> > re-export void from Control.Monad?
> >
> > - jeremy
>
> Don brought it up, and it's a consideration behind picking the name 'void'.
>
> Re-exporting with the type signature (ie. rewrite it to be void :: IO
> a -> IO (); void = Control.Monad.void) is easy and won't break
> anything; it's something that can be done after Control.Monad.void has
> been added. One thing at a time.
>
> --
> gwern
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/libraries/attachments/20100108/fe7d8b05/attachment.html


More information about the Libraries mailing list