I've been looking for an error quite a while now. Haskell complains about "parse error (possibly incorrect indentation or mismatched brackets)". I could'nt find anything. Is there anyone who can help me? The code should add and subtract binary numbers.
binadd :: [Int] -> [Int] -> [Int]
binadd xs ys = revers (binadd'(reverse xs) (reverse ys) 0)
where binadd' [] [] _ = []
binadd' (x:xs) (y:ys) u = (mod (x+y+u) : binadd' xs ys) (div(x+y+z)2)
binadd' _ _ _ = error "Listen verschieden lang"
binsub :: [Int] -> [Int] -> [Int]
binsub a b = binadd a (help b)
where help list = binadd [000000001] ([kipp i | i <- list ])
kipp 1 = 0
kipp 0 = 1
[000000001]
is the same as[1]
, right? Apart from that,mod
needs two arguments but you've only given it(x+y+u)
and expect the result to be a number. — Anyway... please add the actual error message to such a question! – leftaroundabout