模式Haskell中的分析错误



为什么我在这段代码中出现解析错误?

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

相关内容

  • 没有找到相关文章

最新更新