Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. iguales :: [a] -> [a] -> [a]
  2. iguales a b = compareHeads a b
  3. iguales (a:as) (b:bs) = compareHeads a b ++ iguales as bs
  4.  
  5. compareHeads :: (Num a) => a -> a -> a
  6. compareHeads x y = if (x == y) then x else 0
  7.  
  8. Ejercicios Relacion 2.hs:89:38:
  9.     Couldn't match type `a' with `[a]'
  10.      `a' is a rigid type variable bound by
  11.           the type signature for iguales :: [a] -> [a] -> [a]
  12.           at Ejercicios Relacion 2.hs:88:1
  13.     In the first argument of `compareHeads', namely `a'
  14.     In the first argument of `(++)', namely `compareHeads a b'
  15.     In the expression: compareHeads a b ++ iguales as bs
  16.  
  17. Ejercicios Relacion 2.hs:89:40:
  18.     Couldn't match type `a' with `[a]'
  19.      `a' is a rigid type variable bound by
  20.           the type signature for iguales :: [a] -> [a] -> [a]
  21.           at Ejercicios Relacion 2.hs:88:1
  22.     In the second argument of `compareHeads', namely `b'
  23.     In the first argument of `(++)', namely `compareHeads a b'
  24.     In the expression: compareHeads a b ++ iguales as bs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement