-2
我試圖做到這一點得到一個Expression
和list of tuples (a pair of strings)
功能不同的號碼,根據下面的代碼:錯誤:方程「testListTuple」有爭論
module Test where
import Data.List
type Symbol = String
data Expression = Var Symbol -- variable
| Lambda Symbol Expression -- abstraction
| App Expression Expression -- application
deriving (Eq, Read)
expTest = Lambda "x" $ Lambda "y" $ (Var "x" `App` Var "y")
testListTuple :: Expression -> [(Symbol,Symbol)] -> [Symbol]
testListTuple (exp) ((a,b):xs) = functionTest (exp) (a) (b) : testListTuple (exp) (xs)
testListTuple _ = []
functionTest :: Expression -> Symbol -> Symbol -> Symbol
functionTest _ a b = a ++ b
runTest = testListTuple expTest [("a", "b"), ("c", "d")]
但是,下面的錯誤是顯示:
解決此錯誤後,我仍然會完成實施functionTest
。
呃。給他們相同數量的參數? – melpomene