Add support for all top-level declarations to GHCi
authorSimon Marlow <marlowsd@gmail.com>
Fri, 16 Sep 2011 12:40:53 +0000 (13:40 +0100)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 21 Sep 2011 08:52:59 +0000 (09:52 +0100)
commit3db757241ce7fb99c096c30481aefa86bb9855a1
tree003ea696a39cf558b975cc4d4b0e7bd88c0867ad
parent9de6f19e5de702967a9411b01c06734d3b67eea8
Add support for all top-level declarations to GHCi

  This is work mostly done by Daniel Winograd-Cort during his
  internship at MSR Cambridge, with some further refactoring by me.

This commit adds support to GHCi for most top-level declarations that
can be used in Haskell source files.  Class, data, newtype, type,
instance are all supported, as are Type Family-related declarations.

The current set of declarations are shown by :show bindings.  As with
variable bindings, entities bound by newer declarations shadow earlier
ones.

Tests are in testsuite/tests/ghci/scripts/ghci039--ghci054.
Documentation to follow.
35 files changed:
compiler/basicTypes/DataCon.lhs-boot
compiler/basicTypes/Name.lhs
compiler/basicTypes/Name.lhs-boot
compiler/basicTypes/RdrName.lhs
compiler/deSugar/Desugar.lhs
compiler/ghci/ByteCodeLink.lhs
compiler/ghci/Debugger.hs
compiler/ghci/Linker.lhs
compiler/iface/IfaceEnv.lhs
compiler/main/GHC.hs
compiler/main/HscMain.lhs
compiler/main/HscTypes.lhs
compiler/main/InteractiveEval.hs
compiler/main/TidyPgm.lhs
compiler/prelude/PrelNames.lhs
compiler/rename/RnNames.lhs
compiler/rename/RnSource.lhs
compiler/typecheck/FamInst.lhs
compiler/typecheck/Inst.lhs
compiler/typecheck/TcEnv.lhs
compiler/typecheck/TcInstDcls.lhs
compiler/typecheck/TcRnDriver.lhs
compiler/typecheck/TcRnMonad.lhs
compiler/typecheck/TcRnTypes.lhs
compiler/typecheck/TcTyClsDecls.lhs
compiler/types/FamInstEnv.lhs
compiler/types/InstEnv.lhs
compiler/types/TypeRep.lhs
compiler/utils/Outputable.lhs
compiler/vectorise/Vectorise.hs
compiler/vectorise/Vectorise/Env.hs
compiler/vectorise/Vectorise/Monad.hs
compiler/vectorise/Vectorise/Type/Env.hs
ghc/GhciMonad.hs
ghc/InteractiveUI.hs