我正在关注一个haskell教程:http://www.seas.upenn.edu/~cis194/lectures/01-intro.html
我正在测试ghci中的函数,我得到了这个部分:
hailstone :: Integer -> Integer
hailstone n
| n `mod` 2 == 0 = n `div` 2
| otherwise = 3*n + 1
我在.hs文件中有该功能,我在同一目录中启动ghci并转到:l hailstone.hs
输出
Syntax error on 'mod'
Perhaps you intended to use TemplateHaskell
In the Template Haskell quotation 'mod'
Failed, modules loaded: none.
做了一些谷歌搜索并试图加载这个' templatehaskell'最后得到了一组不同的错误(http://brandon.si/code/working-with-template-haskell-in-ghci/)