Where does the name "xs" for pattern matching come from?

functional-programming, haskell, pattern-matching

Solution

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.

Problem

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" ?

Original source

Related problems