cvs commit: fptools/ghc/compiler/basicTypes MkId.lhs
fptools/ghc/compiler/prelude PrelNames.lhs fptools/libraries/base/GHC
Base.lhs IOBase.lhs
Simon Marlow
simonmar@glass.cse.ogi.edu
Fri, 24 Jan 2003 06:04:41 -0800
simonmar 2003/01/24 06:04:41 PST
Modified files:
ghc/compiler/basicTypes MkId.lhs
ghc/compiler/prelude PrelNames.lhs
libraries/base/GHC Base.lhs IOBase.lhs
Log:
- Generalise seq to allow an unlifted type in its second argument. This
works because seq is *always* inlined and replaced by a case.
- Remove getTag, a wired-in Id with an unfolding, with a definition
in GHC.Base:
getTag x = x `seq` dataToTag# x
this is why we required the above generalisation to seq (dataToTag#
returns an Int#). See the comments in GHC.Base for more details.
- As a side-effect, this fixes a bug in the interpreter, where the
compiler optimised away the evaluation of the argument to dataToTag#,
but the interpreter ended up passing it an unevaluated thunk (nullary
constructors aren't always evaluated in GHCi, but the simplifier
assumes they are). Now, in the interpreter, getTag won't be inlined
so the compiler can't optimise away the evaluation, and we're saved.
The real bug here is either (a) dataToTag# requires an evaluated
argument or (b) the interpreter doesn't supply it with one, take your
pick.
Revision Changes Path
1.107 +4 -23 fptools/ghc/compiler/basicTypes/MkId.lhs
1.68 +1 -4 fptools/ghc/compiler/prelude/PrelNames.lhs
1.22 +22 -0 fptools/libraries/base/GHC/Base.lhs
1.25 +1 -1 fptools/libraries/base/GHC/IOBase.lhs