LAST CALL to comment on the Appicative/Monad Proposal

Henrik Nilsson Henrik.Nilsson at nottingham.ac.uk
Tue Dec 18 18:02:25 UTC 2018


Hi,

On 12/18/2018 02:52 PM, Cale Gibbard wrote:
> Secondarily, it's a bit hard to describe why this is, but I personally
> find it a bit obnoxious whenever someone uses 'pure' rather than
> 'return' if the functor is known to be an instance of Monad and the
> generality isn't needed. It's a kind of signal that the code we're
> writing is (and perhaps needs to be) Applicative-polymorphic, or that we
> lack a Monad instance. So when I see it, I'm forced to consider for a
> moment why that might be, and whether I've understood the context
> incorrectly (and if it's not the case, that's sort of irritating).
>
> So when I see a suggestion to remove 'return' altogether it's sort of
> like "let's make everything mildly annoying to read forever" (by forcing
> this thought about exactly how general the code is, and making it
> slightly harder to guess the types at a glance).

I personally fully agree with this sentiment: I do find the use of
"pure" vs. "return" to be a very useful signal to the reader.

Moreover, while there is little risk of confusion when arrow
syntax is used, looking just at names, the fact is that the use of the
distinct "returnA" also sends a similar signal to the reader, and
consequently there is a certain consistency in distinct names being
used for the three different computational notions for which (variations 
of) do-notation is provided.

Best,

/Henrik




This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please contact the sender and delete the email and
attachment. 

Any views or opinions expressed by the author of this email do not
necessarily reflect the views of the University of Nottingham. Email
communications with the University of Nottingham may be monitored 
where permitted by law.






More information about the Haskell-prime mailing list