sdiehl / write-you-a-haskell

Building a modern functional compiler from first principles. (http://dev.stephendiehl.com/fun/)
MIT License
3.35k stars 255 forks source link

Small code fixes and some textual edits #69

Open samvher opened 9 years ago

samvher commented 9 years ago

The code needs some minor changes to compile if copy-pasted from the text.

I assumed that I could use the following to both slice and insert code at the same time, if that doesn't work there is a problem with my commit:

<code here>

I was (/am) a bit confused by the output of parse being a list of tuples while everywhere we seem to deal with a list of a single tuple or the empty list. I hypothesized why this would be and added that to the text but I'm not sure it's correct.

In a couple of places the code seems clipped, often a line at the beginning is missing which seems like it should be there. However, the numbers given in the slice do seem to correspond to the numbers I see when I look up the source. I'm not sure what's going wrong here (no changes made on this).