想象一下,我有一个自定义类型和两个功能:
type MyType = Int -> Bool
f1 :: MyType -> Int
f3 :: MyType -> MyType -> MyType
Run Code Online (Sandbox Code Playgroud)
我尝试模式匹配如下:
f1 (f3 a b i) = 1
Run Code Online (Sandbox Code Playgroud)
但它失败了,错误:Parse error in pattern: f1.做上述事情的正确方法是什么?基本上,我想知道有多少f3(作为a和b可能是f3或其他一些功能).
haskell ×1