我是 Haskell 的新手,正在尝试编写一个简单的列表理解并将其分配给一个变量。这是我的haskell.hs
文件:
--find all multiples of 3 and 5 under 1000
multiples :: [Int]
let multiples = [x | x <- [1..1000], (x `mod` 5 == 0) || (x `mod` 3 == 0)]
然后当我尝试编译程序时,ghc haskell.hs
出现以下错误:
haskell.hs:12:1:
parse error (possibly incorrect indentation or mismatched brackets)
问候!