[Haskell-cafe] Is it acceptable if Applicative behave not like a Monad

Alexey Uimanov s9gf4ult at gmail.com
Thu Apr 30 15:45:18 UTC 2015


Hello, I have such a question: assume you have some type `T` which has
Applicative and Monad instances. Is it ok if code like this:

foo :: Int -> T String
bar :: Int -> T Int

(,) <$> foo 10 <*> bar "20"

behaves not like this code:

foobar = do
    x <- foo 10
    y <- bar "20"
    return (x, y)

The word "behaves" I mean not just returning value but the effect performed
also.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150430/12a1f732/attachment.html>


More information about the Haskell-Cafe mailing list