[Haskell-cafe] ($) and ApplicativeDo

Tom Ellis tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk
Thu Jun 16 16:56:47 UTC 2016


On Thu, Jun 16, 2016 at 12:49:03PM -0400, amindfv at gmail.com wrote:
> Wow, that's pretty unexpected. Another repro case:
> 
> p = pure
> 
> bar :: Applicative f => f a
> bar = do
>    x <- pure "ok"
>    p x
> 
> ... gives the same error. So ApplicativeDo statements *must* end with exactly the statement "pure"?

That's pretty strange since it has a perfectly good Applicative
interpretation:

    fmap p (pure "ok")

Tom


More information about the Haskell-Cafe mailing list