Bug in the documentation of (<**>)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug in the documentation of (<**>)

Wolfgang Jeltsch-3
Hi!

The documentation of (<**>) says: “A variant of <*> with the arguments
reversed.” In my opinion, this means that (<**>) = flip (<*>). However,
this is not true, since (<**>) does not change the order of effects. The
actual definition of (<**>) is a <**> f = liftA2 (\ x h -> h x) a f.
Could this please be fixed?

All the best,
Wolfgang
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Bug in the documentation of (<**>)

Eric Mertens
Elaborating the documentation of (<**>) is a good idea.

I’m not sure how to describe this definition’s behavior in English prose, but this seems like a case where inlining the definition in the documentation would be quite helpful to the haddock reader.

The documentation for (<*>) and friends is written in terms of sequencing actions, so we could write: A variant of (<*>) where the “argument" is sequenced before the “function”.

It’s obviously tricky to describe what’s going on because we aren’t actually dealing with function application, we’re just matching up the types of function application.

> On Sep 11, 2017, at 7:51 AM, Wolfgang Jeltsch <[hidden email]> wrote:
>
> Hi!
>
> The documentation of (<**>) says: “A variant of <*> with the arguments
> reversed.” In my opinion, this means that (<**>) = flip (<*>). However,
> this is not true, since (<**>) does not change the order of effects. The
> actual definition of (<**>) is a <**> f = liftA2 (\ x h -> h x) a f.
> Could this please be fixed?
>
> All the best,
> Wolfgang
> _______________________________________________
> Libraries mailing list
> [hidden email]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries