I want to use the following code/ functionality in Haskell:
test :: String -> String -> Bool
test (x:xs) (x:ys) = True
test _ _ = False
This should check if both lists begin with exactly the same element.
But this does not work.
My compiler says: Conflicting definitions for x
I thought a pattern matching like this had to work in a functional language. I just worked with Prolog before and I'm pretty sure it worked there :/
Is this not implemented in Haskell or is my Syntax wrong?