RFC: Add HasCallStack constraint to partial Data.List functions.

Henrik Nilsson Henrik.Nilsson at nottingham.ac.uk
Fri Jun 4 16:49:23 UTC 2021

Hi Ryan,

 > Regarding making systemic improvements less likely: I don't think we
 > should choose to bear costs, simply because the pain of those costs
 > may potentially motivate us to come up with something better.  If
 > Oleg's proposed solution actually makes it *harder* for -xc
 > improvements to be
 > made, then I would certainly agree that we shouldn't use it as a
 > stopgap.

Fair point about not choose to bear costs *just* in the hope something 
better comes along. My main point was that the suggested approach in my
opinion is too un-principled and too partial to have much appeal,
especially when it is clear that solutions that are both principled
and complete do exist, and that most of the required machinery is
already in place.

But others clearly disagree, although, in part for reasons that has
more to do with philosophy of language design and partiality vs.
totality, than the practical need to pinpoint the site of errors
in programs in a language that was designed to allow partial

 > Regarding teaching: although I don't want to usurp the role of the
 > educator - and it would be fantastic to get some input from actual
 >  educators on this thread -

Just for the record, I have one feet solidly in each of the
educational and industrial camps.

 > I don't think we should simply say that
 > because these things exist, their teachability is important.  Let's
 > let people tell us, specifically, that they consider `head` to be
 > important to teaching students, and why, and then we can make sure
 > it's suitable for them.

Well, head and tail *are* basic. There are no two ways about that.
But there were also other affected functions, like
list indexing, or indexing into other collection types,
that I at least consider entirely reasonable (as long as the
time complexity is taken into account properly when that is
a consideration).

The basic points I were making, to recap and rephrase, were that

a) Type classes in general are considered a bit of a hurdle
    when teaching beginners. Thus, more of them (for basic
    functions) is not helpful.

b) I don't find mixing what amounts to operational annotations
    to assist with particular approaches to debugging into the
    types of functions to be appealing at all.

    In fact, I feel rather strongly that it is a fundamentally flawed

    The types should tell me something important about what things are.
    Not about how to go about debugging them.



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

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 Libraries mailing list