dummy variables

Duncan Coutts duncan.coutts at worcester.oxford.ac.uk
Wed Dec 29 08:32:26 EST 2004


In message <20041229115341.A431 at botik.ru> "Serge D. Mechveliani"
<mechvel at botik.ru> writes:
> Dear Haskellers, dear GHC team,
> 
> Is a variable `_x' equivalent to `_' 

No, '_x' is a perfectly ordinary variable. The only special "dummy variable" (a
pattern that matches anything but does not bind a varialbe) is '_'.

> Does really  Haskell  mean this? It this reasonable?
> How to set self-commenting dummy variables? 

You can use them as dummy variables by never using them in an expression
context, only in pattern/binding context. As you noted they should be unique
withing each scope.

Duncan


More information about the Glasgow-haskell-users mailing list