Haskell新手在这里.我需要一些帮助来为全加器编写函数.我有以下内容:
xor :: Bool -> Bool -> Bool
xor True False = True
xor False True = True
xor _ _ = False
fulladder :: Bool -> Bool -> Bool ->(Bool, Bool)
fulladder a b c = c xor (a xor b) ++ (a&&b) || ((a xor b) && c)
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
* Couldn't match expected type `(Bool -> Bool -> Bool)
-> Bool -> Bool'
with actual type `Bool'
* The function `a' is applied to two arguments,
but its …
Run Code Online (Sandbox Code Playgroud)