为什么我在这段代码中出现解析错误?
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
尝试:
fun2 a (x:xs) = fun2 (fun1 a x) xs