Possible Duplicate:
What is the history of the variable names x and xs?
Where does the canonical name "xs" in pattern matching come from?
e.g. in
reverse' [] = []
reverse' [x] = [x]
reverse' (x:xs) = reverse' xs ++ [x]
Is it supposed to be the plural of "x" ?
That's the way I've always read it, you have the singular and the plural, So x:xs
or y:ys
etc.
It doesn't actually have any meaning by itself, it's just a convention.
IIRC it's also mentioned in Learn You a Haskell.
Edited
My mistake - it's actually in Real World Haskell in the chapter on types and functions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With