I again, with the inscriptions, putting things side by side to help in visual understanding:
g = ((=<<) . return) {- ((=<<) . return) xy === (=<<) (return x) y return :: a' -> m' a' (=<<) :: (a -> mb) -> ma -> mb return x :: m' a' , x :: a' m' a' m' ~ ((->) a) , a' ~ mb return x === const x -- instance Monad ((->) a) where return = const gxy === y >>= (\_ -> x) === y >> x (!!) -} g :: mb -> ma -> mb
So, as it turned out (and, perhaps, it was seen from the type signature), g === flip (>>) :
Prelude> ((=<<).return) [1] "xyz" -- === (=<<) (const [1]) "xyz" -- === "xyz" >>= const [1] -- === "xyz" >> [1] -- === (>> [1]) "xyz" [1,1,1]
Will ness
source share