Adding an ignore function to Control.Monad

Gwern Branwen gwern0 at gmail.com
Wed Jul 1 16:45:45 EDT 2009


Alright, I see that there haven't been any real complaints about
adding Control.Monad.ignore since I first posted on 10 June. (Although
there was a lot of related-but-off-topic discussion.)

Since then, Don Stewart has pointed out
http://hackage.haskell.org/trac/ghc/ticket/3292 that there is a very
similar function specified in the FFI standard
http://www.cse.unsw.edu.au/~chak/haskell/ffi/ffi/ffise5.html#x8-350005.10
- 'void     :: IO a -> IO ()'.

I don't favor 'ignore' over 'void' to an extent significant enough to
make that an issue.

But it's no longer clear what to do. Do we move void with its current
type to Control.Monad and have Foreign.Marshal.Error re-export it? Do
we define void with the generalized Functor sig, and have F.M.E
re-export with a restricted type sig? Do we simply use my ignore patch
and define F.M.E.void = ignore (with the restricted type sig)?

The specifics of what to do are unclear enough that I don't think
there's consensus for what to do with void, even if we clearly want
some sort of void/ignore in Control.Monad.

--
gwern


More information about the Libraries mailing list