Turn EvTerm (almost) into CoreExpr (#14691)
authorJoachim Breitner <mail@joachim-breitner.de>
Fri, 26 Jan 2018 16:50:48 +0000 (11:50 -0500)
committerJoachim Breitner <mail@joachim-breitner.de>
Fri, 26 Jan 2018 16:50:48 +0000 (11:50 -0500)
commit0e022e56b130ab9d277965b794e70d8d3fb29533
tree9ed3ae9e1e88095c37d3b9035ddc82756533a81e
parent40c753f14b314e74723465e6f79316657307f373
Turn EvTerm (almost) into CoreExpr (#14691)

Ideally, I'd like to do

    type EvTerm = CoreExpr

and the type checker builds the evidence terms as it goes. This failed,
becuase the evidence for `Typeable` refers to local identifiers that are
added *after* the typechecker solves constraints. Therefore, `EvTerm`
stays a data type with two constructors: `EvExpr` for `CoreExpr`
evidence, and `EvTypeable` for the others.

Delted `Note [Memoising typeOf]`, its reference (and presumably
relevance) was removed in 8fa4bf9.

Differential Revision: https://phabricator.haskell.org/D4341
20 files changed:
compiler/deSugar/DsBinds.hs
compiler/deSugar/Match.hs
compiler/ghc.cabal.in
compiler/typecheck/Inst.hs
compiler/typecheck/TcCanonical.hs
compiler/typecheck/TcErrors.hs
compiler/typecheck/TcEvTerm.hs [new file with mode: 0644]
compiler/typecheck/TcEvidence.hs
compiler/typecheck/TcFlatten.hs
compiler/typecheck/TcHsSyn.hs
compiler/typecheck/TcInstDcls.hs
compiler/typecheck/TcInteract.hs
compiler/typecheck/TcMType.hs
compiler/typecheck/TcPatSyn.hs
compiler/typecheck/TcPluginM.hs
compiler/typecheck/TcRnTypes.hs
compiler/typecheck/TcSMonad.hs
compiler/types/Type.hs
testsuite/tests/indexed-types/should_fail/T8129.stdout
testsuite/tests/perf/compiler/all.T