Re:Conrad Barski's Haskell Tutorial
by frou_dh on Sunday July 14, 2013 @03:10PM
(#6041827)
ghc 7.6.3 (brew) installed on OS X doesn't like the first code presented (System.Random, Text.Regex and StdGen aren't found).
[ Parent
| on HN ]
`brew install haskell-platform` should help.
[deleted]
Did you respect indentation?
Tutorial is really failing here with this “just paste this to the bottom”.
I did respect indentation, and here's what I get as an error:
> tutorial.hs:21:23: Illegal type signature: `[Person] people' Perhaps you intended to use -XScopedTypeVariables In a pattern type-signature
You copy-pasted it without a newline.
This is how it should look http://lpaste.net/90921
I guess you have a little error in your code. Maybe if you copied and pasted there was an error.
For example, if you have
let people :: [Person] people
instead of let people :: [Person]
people = -- ...
that would give you that error.It doesn't seem to be outdated. I guess you probably didn't follow correctly the instructions (or maybe they aren't explained well). The extra code given in the second example goes just after the code in the first example, starting with the same indentation. Something like:
main = do
putStr "Hello World! Let's have a picnic! \n"
people_text <- readFile "people.txt"
-- ... the restYou're right, it was lack of indentation.