Do-notation
Ross Paterson
ross@soi.city.ac.uk
Thu, 28 Mar 2002 18:44:39 +0000
On Thu, Mar 28, 2002 at 11:48:25AM -0500, nilsson@cs.yale.edu wrote:
> Incidentally, similar concerns occur in the context of the arrows framework.
> Ross Paterson, in response to a request from us at Yale, recently changed
> some derived arrow combinators into default methods of the arrow classes in
> his implementation of the framework to allow more efficient, instance
> specific, implementations of these combinators. Our request was prompted
> by our work of (A)FRP, an embedded language.
Yes, but in that case the specific implementations are required to be
denotationally equal to the default versions. And surely that was
the original intention here. Section 6.3.6 of the Report needs an
additional equation:
m >> k = m >>= \_ -> k
Then Hugs and GHC would be correct but suboptimal.
There's a similar glitch in the claim in section 3.5 of the Report that
(+ (- exp)) is a substitute for (\x -> x - exp), which is true only if
x - y = x + negate y
In that case the claim could be simply dropped.