[Haskell-cafe] Re: Changing type of 'when'

Jake McArthur jake at pikewerks.com
Wed Jan 28 10:16:15 EST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Maurí­cio wrote:
|> ignore m = m >> return ()
|
|
| But isn't exactly that the behavior of (>>)?

~    ignore :: Monad m => m a -> m ()
~    (>>)   :: Monad m => m a -> m b -> m b

It may also be worth noting that ignore can be generalized to Functor:

~    ignore :: Functor f => f a -> f ()
~    ignore x = () <$ x

- - Jake
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmAdr8ACgkQye5hVyvIUKn64ACeJ9MHwEgbTUUtnqJVuAe+z7bq
1MgAmwQKzvMOj+l/ih+SwrM1myxplLGB
=oFVr
-----END PGP SIGNATURE-----


More information about the Haskell-Cafe mailing list