diff options
author | Richard Eisenberg <eir@cis.upenn.edu> | 2015-12-24 14:33:19 -0500 |
---|---|---|
committer | Richard Eisenberg <eir@cis.upenn.edu> | 2015-12-24 14:37:39 -0500 |
commit | 2db18b8135335da2da9918b722699df684097be9 (patch) | |
tree | 660dd90916aa6568694bbe39cdab83c7af98c5d7 /compiler/coreSyn/MkCore.hs | |
parent | 48db13d279d592ed3044cbaf3513854bcb0d3dce (diff) | |
download | haskell-2db18b8135335da2da9918b722699df684097be9.tar.gz |
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.
Diffstat (limited to 'compiler/coreSyn/MkCore.hs')
-rw-r--r-- | compiler/coreSyn/MkCore.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/coreSyn/MkCore.hs b/compiler/coreSyn/MkCore.hs index 07db78a931..2f1b67fe79 100644 --- a/compiler/coreSyn/MkCore.hs +++ b/compiler/coreSyn/MkCore.hs @@ -62,7 +62,7 @@ import TysWiredIn import PrelNames import HsUtils ( mkChunkified, chunkify ) -import TcType ( mkInvSigmaTy ) +import TcType ( mkSpecSigmaTy ) import Type import Coercion ( isCoVar ) import TysPrim @@ -684,8 +684,8 @@ mkRuntimeErrorId name = pc_bottoming_Id1 name runtimeErrorTy runtimeErrorTy :: Type -- The runtime error Ids take a UTF8-encoded string as argument -runtimeErrorTy = mkInvSigmaTy [levity1TyVar, openAlphaTyVar] [] - (mkFunTy addrPrimTy openAlphaTy) +runtimeErrorTy = mkSpecSigmaTy [levity1TyVar, openAlphaTyVar] [] + (mkFunTy addrPrimTy openAlphaTy) errorName :: Name errorName = mkWiredInIdName gHC_ERR (fsLit "error") errorIdKey eRROR_ID @@ -694,7 +694,7 @@ eRROR_ID :: Id eRROR_ID = pc_bottoming_Id2 errorName errorTy errorTy :: Type -- See Note [Error and friends have an "open-tyvar" forall] -errorTy = mkInvSigmaTy [levity1TyVar, openAlphaTyVar] [] +errorTy = mkSpecSigmaTy [levity1TyVar, openAlphaTyVar] [] (mkFunTys [ mkClassPred ipClass [ mkStrLitTy (fsLit "callStack") @@ -709,7 +709,7 @@ uNDEFINED_ID :: Id uNDEFINED_ID = pc_bottoming_Id1 undefinedName undefinedTy undefinedTy :: Type -- See Note [Error and friends have an "open-tyvar" forall] -undefinedTy = mkInvSigmaTy [levity1TyVar, openAlphaTyVar] [] +undefinedTy = mkSpecSigmaTy [levity1TyVar, openAlphaTyVar] [] (mkFunTy (mkClassPred ipClass [ mkStrLitTy (fsLit "callStack") @@ -727,7 +727,7 @@ Notice the levity polymophism. This ensures that * unboxed as well as boxed types * polymorphic types This is OK because it never returns, so the return type is irrelevant. -See Note [Sort-polymorphic tyvars accept foralls] in TcUnify. +See Note [Sort-polymorphic tyvars accept foralls] in TcMType. ************************************************************************ |