<div dir="auto">head and tail are basic ... in Lisp. In Haskell, they're effectively used ... *checks notes* ... in the MonadFix instance for []. Almost every good use of (!!) is for something that really should use an infinite list<div dir="auto"><br></div><div dir="auto"> data Stream a = a :< Stream a</div><div dir="auto"><br></div><div dir="auto">but that uses a list for convenience.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 4, 2021, 12:50 PM Henrik Nilsson <<a href="mailto:Henrik.Nilsson@nottingham.ac.uk">Henrik.Nilsson@nottingham.ac.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Ryan,<br>
<br>
> Regarding making systemic improvements less likely: I don't think we<br>
> should choose to bear costs, simply because the pain of those costs<br>
> may potentially motivate us to come up with something better. If<br>
> Oleg's proposed solution actually makes it *harder* for -xc<br>
> improvements to be<br>
> made, then I would certainly agree that we shouldn't use it as a<br>
> stopgap.<br>
<br>
Fair point about not choose to bear costs *just* in the hope something <br>
better comes along. My main point was that the suggested approach in my<br>
opinion is too un-principled and too partial to have much appeal,<br>
especially when it is clear that solutions that are both principled<br>
and complete do exist, and that most of the required machinery is<br>
already in place.<br>
<br>
But others clearly disagree, although, in part for reasons that has<br>
more to do with philosophy of language design and partiality vs.<br>
totality, than the practical need to pinpoint the site of errors<br>
in programs in a language that was designed to allow partial<br>
functions.<br>
<br>
> Regarding teaching: although I don't want to usurp the role of the<br>
> educator - and it would be fantastic to get some input from actual<br>
> educators on this thread -<br>
<br>
Just for the record, I have one feet solidly in each of the<br>
educational and industrial camps.<br>
<br>
> I don't think we should simply say that<br>
> because these things exist, their teachability is important. Let's<br>
> let people tell us, specifically, that they consider `head` to be<br>
> important to teaching students, and why, and then we can make sure<br>
> it's suitable for them.<br>
<br>
Well, head and tail *are* basic. There are no two ways about that.<br>
But there were also other affected functions, like<br>
list indexing, or indexing into other collection types,<br>
that I at least consider entirely reasonable (as long as the<br>
time complexity is taken into account properly when that is<br>
a consideration).<br>
<br>
The basic points I were making, to recap and rephrase, were that<br>
<br>
a) Type classes in general are considered a bit of a hurdle<br>
when teaching beginners. Thus, more of them (for basic<br>
functions) is not helpful.<br>
<br>
b) I don't find mixing what amounts to operational annotations<br>
to assist with particular approaches to debugging into the<br>
types of functions to be appealing at all.<br>
<br>
In fact, I feel rather strongly that it is a fundamentally flawed<br>
approach.<br>
<br>
The types should tell me something important about what things are.<br>
Not about how to go about debugging them.<br>
<br>
Best,<br>
<br>
/Henrik<br>
<br>
<br>
<br>
This message and any attachment are intended solely for the addressee<br>
and may contain confidential information. If you have received this<br>
message in error, please contact the sender and delete the email and<br>
attachment. <br>
<br>
Any views or opinions expressed by the author of this email do not<br>
necessarily reflect the views of the University of Nottingham. Email<br>
communications with the University of Nottingham may be monitored <br>
where permitted by law.<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank" rel="noreferrer">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div>