3 ms·
I have exactly the same complaint. Also, the use of "let" seems completely superfluous here. No motivation for writing let villain = (28,"chirs") in fst vill
by xenomachina 16y ago
I have exactly the same complaint. Also, the use of "let" seems completely superfluous here. No motivation for writing
let villain = (28,"chirs") in fst villain
rather than the much shorter
fst (28,"chirs")
is given.
I think the lack of any sort of typographical indication of when one expression ends is really a Haskell issue, not an issue with the tutorial, though perhaps newlines could be inserted for readability. (Or does Haskell care where newlines appear?)
I've read a number of Haskell tutorials in the past, and despite having no problem with a variety of syntax types, including C-family, Lisp-family, and even having done some coding in ML way back when, I find the Haskell syntax really hard to read.
I don't think this is something a tutorial can "fix", per se, but it'd be nice if there was a tutorial that took this into account and explained how to actually decompose Haskell code without just throwing code snippets at you and hoping that you'll intuit their meaning. "Haskell Parsing for Humans" is what I want. The part at the beginning of this tutorial where it explains numbers, strings, lists and tuples is actually a good start, but "let", "=", and "in" are never explained, nor is "fst".
- chrisdone 16y agoHey, thanks for the feedback! Definitely let's syntax is a bit ambiguous to the newbie. I'll take a couple steps in the tutorial for explanation and experimentation. I think I'll take your advice and just go with fst (28,"chirs") and then do a "small detour" (2 steps) to explain the "let" syntax, because it gets used in later chapters. Unlike the math stuff which is intuitive, I agree it needs explicit description. Cheers!
- xenomachina 16y agoIt's definitely better. You might want something longer to type than 4 in the example, though. Explaining the let syntax only after the user has had to use it once felt a bit funny to me, though I guess that's the pattern of the rest of the tutorial. I'm one of those people who tends to learn more from references than tutorials, so that might be saying more about my learning style than your tutorial.
- chrisdone 16y agoHey, I've updated the tutorial from your feedback. Hopefully my explanation is more fuller now! Give it a go?