[Haskell-cafe] Is it acceptable if Applicative behave not like a Monad
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 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"
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
> > 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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe