[Haskell-cafe] Haskell symbol ~

Maurí­cio briqueabraque at yahoo.com
Wed Aug 27 14:23:40 EDT 2008


What does '~' mean in Haskell? I
read in haskell.org/haskellwiki/Keywords
that “(...) Matching the pattern ~pat
against a value always suceeds, and
matching will only diverge when one of
the variables bound in the pattern is
used.” Isn't that true for any
variable, due to lazyness?

At the same place, I found that example,
but wasn't wise enough to figure out
what it does:

(f *** g) ~(x,y) = (f x, g y)

Can you help me understand it?


More information about the Haskell-Cafe mailing list