Add Applicative instances for MTL types
Bas van Dijk
v.dijk.bas at gmail.com
Thu Jan 15 04:49:20 EST 2009
On Wed, Jan 14, 2009 at 7:56 PM, David Menendez <dave at zednenem.com> wrote:
> No, in your definition, the effects of the transformed applicative
> functor are evaluated regardless of the error condition.
>
> Try this code:
>
> runState (runErrorT (throwError "!" <*> put False)) True
>
> The first definition of <*> returns (Left "!", True). The second
> returns (Left "!", False).
I see it now. Thanks for correcting me.
Then we should consider the first patch by Spencer Janssen again which
satisfies these laws:
pure = return
(<*>) = ap
Thanks,
Bas
More information about the Libraries
mailing list