0
iguais:: [Int]->[Int]->Bool
iguais [] [] = True
iguais [] _ = False
iguais _ [] = False
iguais (x:xs) (z:zs)
this is the code, I only did so far. Someone can help me?
0
iguais:: [Int]->[Int]->Bool
iguais [] [] = True
iguais [] _ = False
iguais _ [] = False
iguais (x:xs) (z:zs)
this is the code, I only did so far. Someone can help me?
0
I tried that:
iguais :: [Int] -> [Int] -> Bool
iguais [] [] = True
iguais [] (_:_) = False
iguais (_:_) [] = False
iguais (x:xs) (x:ys) = iguais xs ys
iguais _ _ = False -- Se chegar aqui eh porque nao deu match na idefinicao de cima
But I got the following mistake Conflicting definitions for ‘x’
.
I found out that is not possible: https://stackoverflow.com/a/1179394/858412
Browser other questions tagged function haskell
You are not signed in. Login or sign up in order to post.
iguais a b = not (a /= b)
Okay, okay, I guess this isn’t what you wanted...– JJoao
no, actually I want a recursive call.
– larissa
x == z && iguais xs zs
on your last line? (ornot( x /= z) && iguais xs zs
)– JJoao
It’s neither worth it
==
to make the comparison ofx == z
?– Shinforinpola