From 2db18b8135335da2da9918b722699df684097be9 Mon Sep 17 00:00:00 2001 From: Richard Eisenberg Date: Thu, 24 Dec 2015 14:33:19 -0500 Subject: 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. --- compiler/coreSyn/MkCore.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'compiler/coreSyn/MkCore.hs') 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. ************************************************************************ -- cgit v1.2.1