0

为什么我在此代码中收到解析错误?

data One = H| I deriving (Read,Show,Eq)
data E = A | B deriving (Read,Show,Eq)
type L = [E]

fun1 :: One -> E -> One
-- function for fun1 is here

fun2 :: One -> L -> One
fun2 a [] = a
fun2 a x:xs = fun2 (fun1 a x) xs    --<<< I am getting error here
4

1 回答 1

3

尝试:

fun2 a (x:xs) = fun2 (fun1 a x) xs
于 2013-02-13T23:44:32.990 回答