
($>) is analogous to (*>) not by dropping the f in the first position, but
the f in the second, as proposed.
(*>) :: Applicative f => f a -> f b -> f b
($>) :: Functor f => f a -> b -> f b
It is unfortunate that (*>) is not equivalent to (flip (<*)), but it is a
special case where breaking the "flipped characters" convention is useful
for the sake of Applicative's convention to gather effects from left to
right. It is nice that ($>) adheres to the flipped characters convention as
well as being analogous to (*>).
-- Dan Burton
On Sun, Dec 8, 2013 at 9:22 AM, Stijn van Drongelen
Data.Functor has <$> and <$, but not $>, which should be a flipped version of <$, analogous to <*>, <*, and *> in Control.Applicative.
Whoa there, it's not at all analogous. Your wording is almost suggesting that <* is a flipped *>, but beyond that, they are uncomparable to begin with.
Applicative functors:
(<*>) :: Applicative f => f (a -> b) -> f a -> f b (<*) :: Applicative f => f a -> f b -> f a (*>) :: Applicative f => f a -> f b -> f b
Removing the `f` in the first position, you'd get an honest analogue for any functor:
(<$>) :: Functor f => (a -> b) -> f a -> f b (<$) :: Functor f => a -> f b -> f a ($>) :: Functor f => a -> f b -> f b
Here, I don't see how ($>) could be anything else than `const id`.
Or am I missing something here?
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries