dummy variables

Serge D. Mechveliani mechvel at botik.ru
Wed Dec 29 03:53:41 EST 2004


Dear Haskellers, dear GHC team,

Is a variable `_x' equivalent to `_' 
?
I discover that ghc-6.2.2 assigns a value to  _rem  in the program

  f :: Int
  f = let (q,  _rem ) = quotRem 5 2
          (q', _rem') = quotRem 7 4
      in  _rem + _rem'

I got used to write the programs like  let (x, _remainder ) = ...
                                           (y, _remainder') = ...
                                       in   x + y

using  _remainder  as a  self-commenting dummy variable. 
Because it is a better commentary than `_'.
And now, it occurs that these are the variables taking values!
And removing the quote suffix from  _remainder'  even leads to the
report of "conflicting definitions".

Does really  Haskell  mean this? It this reasonable?
How to set self-commenting dummy variables? 
Or, maybe, it is a GHC bug?

Thank you in advance for the explanation.

-----------------
Serge Mechveliani
mechvel at botik.ru

 





More information about the Glasgow-haskell-users mailing list