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

Adam Bergmark adam at bergmark.nl
Sat May 2 08:40:47 UTC 2015


My message was written too hastily, sorry about that.

The example Alexey asked is exactly what the ApplicativeDo proposal[1] uses
as motivation. The point of it is that you shouldn't need to care about
writing applicative or do-style, when the behavior differs the most
efficient one can be used.
Though as it stands the proposal seems to run into the problem of being
unintuitive like others mentioned since you need to enable an extension. A
type implementing this functionality would need to be documented as
 "Enable ApplicativeDo when using this, or be very confused"


[1] https://ghc.haskell.org/trac/ghc/wiki/ApplicativeDo

- Adam


On Fri, May 1, 2015 at 2:00 PM, Ross Paterson <R.Paterson at city.ac.uk> wrote:

> On Thu, Apr 30, 2015 at 10:11:49PM -0700, Andrew Gibiansky wrote:
> > I agree that, now that we have AMP, applicative and monadic interfaces
> > absolutely *should* match, and that it should be considered an error for
> them
> > not to; semantically different interfaces can be provided with newtypes.
>
> This requirement is in the documentation for both Applicative and Monad
> classes.  (It's been in Applicative since 2010, and was added to Monad
> in the AMP release.)
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150502/9711c4cf/attachment.html>


More information about the Haskell-Cafe mailing list