I am following a haskell tutorial: http://www.seas.upenn.edu/~cis194/lectures/01-intro.html
I am testing functions in ghci, i got to this part:
hailstone :: Integer -> Integer
hailstone n
| n `mod` 2 == 0 = n `div` 2
| otherwise = 3*n + 1
I have that function in a .hs file, i fire up ghci in the same directory and go :l hailstone.hs
the output is
Syntax error on 'mod'
Perhaps you intended to use TemplateHaskell
In the Template Haskell quotation 'mod'
Failed, modules loaded: none.
did some googling and tried to load this 'templatehaskell' and just ended up with a different set of errors (http://brandon.si/code/working-with-template-haskell-in-ghci/)
As user2407038 correctly suggested in the comments, the problem was that I was using apostrophes ('
) as opposed to backticks (`
), the backtick is not the same as the single quote which I should have been using.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With