[Haskell-cafe] Re: Adding an ignore function to Control.Monad
dan.doel at gmail.com
Sat Jul 11 04:17:35 EDT 2009
On Saturday 11 July 2009 3:35:27 am Jeff Wheeler wrote:
> On Fri, Jul 10, 2009 at 10:10 PM, Don Stewart<dons at galois.com> wrote:
> >> ## Control.Monad.void m a -> m ()
> >> Don Stewart
> >> Iavor Diatchki
> For whatever it's worth, I prefer void as well, for the exact reason
> Don said. Indeed, 'ignore' indicates to me that the argument won't
> even be evaluated: it'll be ignored, and skipped. But it is, and only
> part --- the result --- is ignored.
> What about 'void' with functors?
Perhaps it should be noted that 'void' is sometimes associated with the type:
the 'empty' type (which isn't empty in Haskell). In typical catamorphism
style, void would be its eliminator:
void :: forall a. Void -> a
void _ = undefined
-- if you're writing Agda
-- void ()
This, doesn't see much use in Haskell, though, so perhaps it's irrelevant.
More information about the Haskell-Cafe