Visible type application
authorRichard Eisenberg <eir@cis.upenn.edu>
Thu, 24 Dec 2015 19:33:19 +0000 (14:33 -0500)
committerRichard Eisenberg <eir@cis.upenn.edu>
Thu, 24 Dec 2015 19:37:39 +0000 (14:37 -0500)
commit2db18b8135335da2da9918b722699df684097be9
tree660dd90916aa6568694bbe39cdab83c7af98c5d7
parent48db13d279d592ed3044cbaf3513854bcb0d3dce
Visible type application

This re-working of the typechecker algorithm is based on
the paper "Visible type application", by Richard Eisenberg,
Stephanie Weirich, and Hamidhasan Ahmed, to be published at
ESOP'16.

This patch introduces -XTypeApplications, which allows users
to say, for example `id @Int`, which has type `Int -> Int`. See
the changes to the user manual for details.

This patch addresses tickets #10619, #5296, #10589.
257 files changed:
compiler/basicTypes/DataCon.hs
compiler/basicTypes/MkId.hs
compiler/basicTypes/PatSyn.hs
compiler/coreSyn/MkCore.hs
compiler/deSugar/Coverage.hs
compiler/deSugar/DsArrows.hs
compiler/deSugar/DsBinds.hs
compiler/deSugar/DsExpr.hs
compiler/deSugar/Match.hs
compiler/hsSyn/HsBinds.hs
compiler/hsSyn/HsExpr.hs
compiler/hsSyn/HsUtils.hs
compiler/hsSyn/PlaceHolder.hs
compiler/iface/IfaceSyn.hs
compiler/iface/IfaceType.hs
compiler/main/DynFlags.hs
compiler/main/PprTyThing.hs
compiler/parser/Lexer.x
compiler/parser/Parser.y
compiler/prelude/PrimOp.hs
compiler/prelude/TysPrim.hs
compiler/prelude/TysWiredIn.hs
compiler/rename/RnExpr.hs
compiler/rename/RnSplice.hs
compiler/rename/RnTypes.hs
compiler/typecheck/Inst.hs
compiler/typecheck/TcArrows.hs
compiler/typecheck/TcBinds.hs
compiler/typecheck/TcClassDcl.hs
compiler/typecheck/TcErrors.hs
compiler/typecheck/TcEvidence.hs
compiler/typecheck/TcExpr.hs
compiler/typecheck/TcExpr.hs-boot
compiler/typecheck/TcGenDeriv.hs
compiler/typecheck/TcHsSyn.hs
compiler/typecheck/TcHsType.hs
compiler/typecheck/TcInstDcls.hs
compiler/typecheck/TcMType.hs
compiler/typecheck/TcMatches.hs
compiler/typecheck/TcPat.hs
compiler/typecheck/TcPatSyn.hs
compiler/typecheck/TcRnDriver.hs
compiler/typecheck/TcRnMonad.hs
compiler/typecheck/TcRnTypes.hs
compiler/typecheck/TcSplice.hs
compiler/typecheck/TcTyDecls.hs
compiler/typecheck/TcType.hs
compiler/typecheck/TcUnify.hs
compiler/typecheck/TcValidity.hs
compiler/types/TyCoRep.hs
compiler/types/Type.hs
docs/users_guide/7.12.1-notes.rst
docs/users_guide/glasgow_exts.rst
libraries/base/tests/T9681.stderr
libraries/ghc-boot/GHC/LanguageExtensions.hs
testsuite/tests/ado/ado002.stderr
testsuite/tests/annotations/should_fail/annfail08.stderr
testsuite/tests/arrows/should_fail/T5380.stderr
testsuite/tests/boxy/all.T
testsuite/tests/deSugar/should_compile/T2431.stderr
testsuite/tests/driver/T2182.stderr
testsuite/tests/driver/T4437.hs
testsuite/tests/driver/werror.stderr
testsuite/tests/gadt/T3169.stderr
testsuite/tests/gadt/gadt-escape1.stderr
testsuite/tests/gadt/gadt13.stderr
testsuite/tests/gadt/gadt7.stderr
testsuite/tests/gadt/rw.stderr
testsuite/tests/ghc-api/annotations/T10280.stderr
testsuite/tests/ghc-api/annotations/T10357.stderr
testsuite/tests/ghci.debugger/scripts/break003.stderr
testsuite/tests/ghci.debugger/scripts/break003.stdout
testsuite/tests/ghci.debugger/scripts/break005.stdout
testsuite/tests/ghci.debugger/scripts/break006.stderr
testsuite/tests/ghci.debugger/scripts/break006.stdout
testsuite/tests/ghci.debugger/scripts/hist001.stdout
testsuite/tests/ghci/scripts/Defer02.stderr
testsuite/tests/ghci/scripts/T10122.stdout
testsuite/tests/ghci/scripts/T10508.stderr
testsuite/tests/ghci/scripts/T7627.stdout
testsuite/tests/ghci/scripts/T8649.stderr
testsuite/tests/ghci/scripts/T8959b.stderr
testsuite/tests/ghci/scripts/ghci013.stdout
testsuite/tests/ghci/scripts/ghci025.stdout
testsuite/tests/ghci/scripts/ghci047.stderr
testsuite/tests/ghci/scripts/ghci050.stderr
testsuite/tests/ghci/scripts/ghci052.stderr
testsuite/tests/ghci/scripts/ghci053.stderr
testsuite/tests/ghci/scripts/ghci055.stdout
testsuite/tests/indexed-types/should_compile/PushedInAsGivens.stderr
testsuite/tests/indexed-types/should_fail/GADTwrong1.stderr
testsuite/tests/indexed-types/should_fail/T2544.stderr
testsuite/tests/indexed-types/should_fail/T2693.stderr
testsuite/tests/indexed-types/should_fail/T3330a.stderr
testsuite/tests/indexed-types/should_fail/T3330c.stderr
testsuite/tests/indexed-types/should_fail/T3440.stderr
testsuite/tests/indexed-types/should_fail/T4099.stderr
testsuite/tests/indexed-types/should_fail/T4179.stderr
testsuite/tests/indexed-types/should_fail/T4485.stderr
testsuite/tests/indexed-types/should_fail/T5439.stderr
testsuite/tests/indexed-types/should_fail/T7010.stderr
testsuite/tests/indexed-types/should_fail/T7194.stderr
testsuite/tests/indexed-types/should_fail/T7354.stderr
testsuite/tests/indexed-types/should_fail/T7354a.stderr
testsuite/tests/indexed-types/should_fail/T7729.stderr
testsuite/tests/indexed-types/should_fail/T7729a.stderr
testsuite/tests/indexed-types/should_fail/T7788.stderr
testsuite/tests/indexed-types/should_fail/T8227.stderr
testsuite/tests/indexed-types/should_fail/T8518.stderr
testsuite/tests/indexed-types/should_fail/T9554.stderr
testsuite/tests/indexed-types/should_fail/T9662.stderr
testsuite/tests/module/mod121.stderr
testsuite/tests/module/mod147.stderr
testsuite/tests/module/mod160.stderr
testsuite/tests/module/mod69.stderr
testsuite/tests/module/mod70.stderr
testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail07.stderr
testsuite/tests/parser/should_compile/T2245.stderr
testsuite/tests/parser/should_compile/VtaParse.hs [new file with mode: 0644]
testsuite/tests/parser/should_compile/all.T
testsuite/tests/parser/should_compile/read014.stderr
testsuite/tests/parser/should_fail/readFail003.stderr
testsuite/tests/partial-sigs/should_compile/T10403.stderr
testsuite/tests/partial-sigs/should_compile/T10438.stderr
testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInExpressionSignature.stderr
testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInPatternSignature.stderr
testsuite/tests/partial-sigs/should_fail/Forall1Bad.stderr
testsuite/tests/partial-sigs/should_fail/NamedWildcardExplicitForall.stderr
testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotEnabled.stderr
testsuite/tests/partial-sigs/should_fail/ScopedNamedWildcardsBad.stderr
testsuite/tests/patsyn/should_fail/records-poly-update.stderr
testsuite/tests/perf/compiler/all.T
testsuite/tests/polykinds/T10503.stderr
testsuite/tests/polykinds/T6068.stdout
testsuite/tests/polykinds/T7438.stderr
testsuite/tests/polykinds/T7594.stderr
testsuite/tests/polykinds/T9144.stderr
testsuite/tests/polykinds/TidyClassKinds.hs [new file with mode: 0644]
testsuite/tests/polykinds/TidyClassKinds.stderr [new file with mode: 0644]
testsuite/tests/polykinds/all.T
testsuite/tests/rename/should_compile/T3823.stderr
testsuite/tests/rename/should_fail/T10618.stderr
testsuite/tests/rename/should_fail/T2993.stderr
testsuite/tests/rename/should_fail/T7937.stderr
testsuite/tests/rename/should_fail/mc13.stderr
testsuite/tests/rename/should_fail/rnfail016.stderr
testsuite/tests/rename/should_fail/rnfail051.stderr
testsuite/tests/roles/should_compile/Roles1.stderr
testsuite/tests/roles/should_compile/T8958.stderr
testsuite/tests/rts/T9045.hs
testsuite/tests/safeHaskell/ghci/p16.stderr
testsuite/tests/safeHaskell/ghci/p6.stderr
testsuite/tests/simplCore/should_compile/T7360.stderr
testsuite/tests/simplCore/should_compile/simpl017.stderr
testsuite/tests/th/T10945.stderr
testsuite/tests/th/T8577.stderr
testsuite/tests/typecheck/bug1465/bug1465.stderr
testsuite/tests/typecheck/should_compile/FD1.stderr
testsuite/tests/typecheck/should_compile/FD2.stderr
testsuite/tests/typecheck/should_compile/PushHRIf.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/T10072.stderr
testsuite/tests/typecheck/should_compile/T10971a.stderr
testsuite/tests/typecheck/should_compile/T2494.stderr
testsuite/tests/typecheck/should_compile/Vta1.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/Vta2.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/all.T
testsuite/tests/typecheck/should_compile/holes.stderr
testsuite/tests/typecheck/should_compile/holes3.stderr
testsuite/tests/typecheck/should_compile/tc141.stderr
testsuite/tests/typecheck/should_compile/tc168.stderr
testsuite/tests/typecheck/should_compile/tc211.stderr
testsuite/tests/typecheck/should_compile/tc243.stderr
testsuite/tests/typecheck/should_fail/CustomTypeErrors01.stderr
testsuite/tests/typecheck/should_fail/ExpandSynsFail2.stderr
testsuite/tests/typecheck/should_fail/T10495.stderr
testsuite/tests/typecheck/should_fail/T10971d.stderr
testsuite/tests/typecheck/should_fail/T11274.stderr
testsuite/tests/typecheck/should_fail/T1899.stderr
testsuite/tests/typecheck/should_fail/T2414.stderr
testsuite/tests/typecheck/should_fail/T2534.stderr
testsuite/tests/typecheck/should_fail/T2688.stderr
testsuite/tests/typecheck/should_fail/T2846b.stderr
testsuite/tests/typecheck/should_fail/T3102.stderr
testsuite/tests/typecheck/should_fail/T3613.stderr
testsuite/tests/typecheck/should_fail/T3950.stderr
testsuite/tests/typecheck/should_fail/T5095.stderr
testsuite/tests/typecheck/should_fail/T5689.stderr
testsuite/tests/typecheck/should_fail/T5853.stderr
testsuite/tests/typecheck/should_fail/T6069.stderr
testsuite/tests/typecheck/should_fail/T7264.stderr
testsuite/tests/typecheck/should_fail/T7368.stderr
testsuite/tests/typecheck/should_fail/T7453.stderr
testsuite/tests/typecheck/should_fail/T7734.stderr
testsuite/tests/typecheck/should_fail/T7851.stderr
testsuite/tests/typecheck/should_fail/T8142.stderr
testsuite/tests/typecheck/should_fail/T8428.stderr
testsuite/tests/typecheck/should_fail/T8603.stderr
testsuite/tests/typecheck/should_fail/T9109.stderr
testsuite/tests/typecheck/should_fail/T9774.stderr
testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
testsuite/tests/typecheck/should_fail/TcStaticPointersFail01.stderr
testsuite/tests/typecheck/should_fail/VtaFail.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/VtaFail.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T
testsuite/tests/typecheck/should_fail/mc19.stderr
testsuite/tests/typecheck/should_fail/mc21.stderr
testsuite/tests/typecheck/should_fail/mc22.stderr
testsuite/tests/typecheck/should_fail/mc23.stderr
testsuite/tests/typecheck/should_fail/mc24.stderr
testsuite/tests/typecheck/should_fail/mc25.stderr
testsuite/tests/typecheck/should_fail/tcfail001.stderr
testsuite/tests/typecheck/should_fail/tcfail002.stderr
testsuite/tests/typecheck/should_fail/tcfail004.stderr
testsuite/tests/typecheck/should_fail/tcfail005.stderr
testsuite/tests/typecheck/should_fail/tcfail007.stderr
testsuite/tests/typecheck/should_fail/tcfail010.stderr
testsuite/tests/typecheck/should_fail/tcfail013.stderr
testsuite/tests/typecheck/should_fail/tcfail014.stderr
testsuite/tests/typecheck/should_fail/tcfail016.stderr
testsuite/tests/typecheck/should_fail/tcfail018.stderr
testsuite/tests/typecheck/should_fail/tcfail029.stderr
testsuite/tests/typecheck/should_fail/tcfail032.stderr
testsuite/tests/typecheck/should_fail/tcfail033.stderr
testsuite/tests/typecheck/should_fail/tcfail034.stderr
testsuite/tests/typecheck/should_fail/tcfail065.stderr
testsuite/tests/typecheck/should_fail/tcfail068.stderr
testsuite/tests/typecheck/should_fail/tcfail076.stderr
testsuite/tests/typecheck/should_fail/tcfail099.stderr
testsuite/tests/typecheck/should_fail/tcfail103.stderr
testsuite/tests/typecheck/should_fail/tcfail104.stderr
testsuite/tests/typecheck/should_fail/tcfail131.stderr
testsuite/tests/typecheck/should_fail/tcfail133.stderr
testsuite/tests/typecheck/should_fail/tcfail140.stderr
testsuite/tests/typecheck/should_fail/tcfail143.stderr
testsuite/tests/typecheck/should_fail/tcfail153.stderr
testsuite/tests/typecheck/should_fail/tcfail165.hs
testsuite/tests/typecheck/should_fail/tcfail165.stderr [deleted file]
testsuite/tests/typecheck/should_fail/tcfail168.stderr
testsuite/tests/typecheck/should_fail/tcfail174.hs
testsuite/tests/typecheck/should_fail/tcfail174.stderr
testsuite/tests/typecheck/should_fail/tcfail175.stderr
testsuite/tests/typecheck/should_fail/tcfail178.stderr
testsuite/tests/typecheck/should_fail/tcfail179.stderr
testsuite/tests/typecheck/should_fail/tcfail181.stderr
testsuite/tests/typecheck/should_fail/tcfail185.stderr
testsuite/tests/typecheck/should_fail/tcfail189.stderr
testsuite/tests/typecheck/should_fail/tcfail191.stderr
testsuite/tests/typecheck/should_fail/tcfail193.stderr
testsuite/tests/typecheck/should_fail/tcfail198.stderr
testsuite/tests/typecheck/should_fail/tcfail201.stderr
testsuite/tests/typecheck/should_fail/tcfail204.stderr
testsuite/tests/typecheck/should_fail/tcfail206.stderr
testsuite/tests/typecheck/should_fail/tcfail208.stderr
testsuite/tests/typecheck/should_run/all.T
testsuite/tests/typecheck/should_run/tcrun035.stderr [deleted file]
testsuite/tests/warnings/should_compile/PluralS.stderr
testsuite/tests/warnings/should_compile/T11077.stderr