我是Haskell的新手,我遇到了这个错误的麻烦.我在Windows上使用ghci.这是代码:
data Direction = North | South | East | West
deriving (Eq, Show)
type Point = (Int, Int)
origin = (0,0)
type Road = [Direction]
movement :: Point -> Road -> Point
{- ... }
test :: Road -> Road -> Bool
test road1 road2 = movement origin road1 == movement origin road2
-- i check if two roads lead to the same destination starting from
-- the origin point in a grid
Run Code Online (Sandbox Code Playgroud)
当我尝试运行测试时会发生这种情况:
*Main> quickCheck test
<interactive>:8:1: error: …Run Code Online (Sandbox Code Playgroud)