
21 Nov
2010
21 Nov
'10
1:48 p.m.
On 11/19/10 10:21, Brent Yorgey wrote:
On Fri, Nov 19, 2010 at 07:56:02AM +0100, Tim Baumgartner wrote:
using ignore :: Monad m => m a -> b -> m b ignore m a = m>> return a
I'm satisfied with this solution but searching hoogle I didn't find a standard function for my ignore. Am I missing something?
Nope, there isn't such a function, but I like it. It reminds me of (*>) and (<*) from Control.Applicative.
In fact, it is equal to: flip (<$) with <$ from Control.Applicative and it only needs a Functor constraint, not Monad or Applicative. http://haskell.org/ghc/docs/6.12.1/html/libraries/base/Control-Applicative.h... As y'all found out though, in this case an actual Applicative function looked like a cleaner way to write the parser. -Isaac