Drastic Prelude changes imminent

Erik Hesselink hesselink at gmail.com
Tue Feb 3 19:20:35 UTC 2015


On Tue, Feb 3, 2015 at 5:49 PM, Michael Snoyman <michael at snoyman.com> wrote:
>
> On Tue Feb 03 2015 at 6:26:58 PM Erik Hesselink <hesselink at gmail.com> wrote:
>>
>> On Tue, Feb 3, 2015 at 4:45 PM, Michael Snoyman <michael at snoyman.com>
>> wrote:
>> > Now that I actually write this all out, I'm beginning to think I *am*
>> > opposed to the proposal overall, though not by a wide margin. It seems
>> > to
>> > fall into the "too little, too late" category: the benefits it brings
>> > are
>> > not massive due to my three points above, and the disruption introduced
>> > to
>> > the ecosystem is potential massive.
>>
>> What is the potential massive disruption?
>>
> 1. Breakage of existing code due to lack of type inference
> 2. Breakage of existing tutorials/documentation
> 3. Confusing error messages
>
> I didn't really want to drill into it because that seems to be the point of
> discussion of this entire thread.

I was just wondering which of these you were alluding to. Turns out
it's all of them :) I'm surprised you mention breakage of code, since
in my experience most of the breakage in GHC 7.10 I've seen in my own
packages and the Stackage builds is due to other factors: the
Applicative/Monad changes, time 1.5, etc. It would be interesting (but
time consuming) to gather some statistics on this. The breakage of
tutorials is unfortunate, yes.

Regarding error messages: we've been using two alternate preludes. One
is monomorphic, just the normal Prelude extended with things like
Data.List, Control.Monad, etc, and with partial functions replaced by
total ones. The other is a polymorphic one, similar to the current FTP
with the addition of a generalized (.) and 'id' as well. I've not
found the type errors to be confusing. Now I'm not a beginner of
course, but the fact is that even beginners quickly have to learn how
to treat error messages with type classes in them (which is commonly
said to be the confusing part). Many common functions already involve
type classes and cause type errors. Things like Show and Monad
regularly show up in error messages, so I don't see what makes
Foldable/Traversable any different.

I'm on the fence about this whole issue like you, but unlike you I'm
learning more and more towards the positive side. If something is to
be done about the Prelude (which I think is good) this seems like a
very well considered step with minimal breakage. Some problems like
the weirdness of Data.List can be fixed with deprecations later.

Erik


More information about the Libraries mailing list