sordina/crashkell

The first tuples example has too many concepts

Closed this issue · 4 comments

The first tuples example has:

wtf = (z, wtf)

Which introduces recursive data (infinite data) at the same time as it shows infinite typew (which are ilegal). Before we see this example we need to understand what:

ones = 1 : ones

So that we understand infinite data first.

Also contrast this with:

let q = 3 in q + q 

Where q appears twice (on the LHS of = and in the 'in' expression)

And

let q = 3 in let q = "troz" in q ++ q

Now there are two qs, one shadows the other. Which q is used in the innermost expression and in a slightly outer expression may need to be show. The distrinction between all these situations should be made at some point in the tutorial.

Thanks.

True, but it's difficult to introduce lists before tuples. Have a look at the dependency graph in the TOC to see what I mean.

Hrm, you may be right. And the problem might be that earlier I introduced Sarah to let, and how let q = 3 in let q = "troz" in q ++ q behaves. Which may have confused her when she saw wtf = (z, wtf]. The similarity being that q/wtf appear on both sides of something.

I don't actually use tuples much in practice. But other Haskell users probably do, I would usually introduce data types first, and tuples only incidentally when you want to return multiple things. But I'm not certain if that's "best".

I didn't click the table of contents and notice the graph before. Thanks for doing that. Dependencies between concepts is very important and something that's often forgotten.

I wish there was a simple way to attack things like this, but it's quite time consuming to get right. I decided to put tuples early since they work so nicely as a precursor to several upcoming topics, but could probably be left out somehow if I spent a bit more time factoring the concepts.