[Git][ghc/ghc][master] Add standalone kind signatures for Code and TExp
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Wed Jun 14 11:05:37 UTC 2023
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
a0c27cee by Vladislav Zavialov at 2023-06-14T07:05:08-04:00
Add standalone kind signatures for Code and TExp
CodeQ and TExpQ already had standalone kind signatures
even before this change:
type TExpQ :: TYPE r -> Kind.Type
type CodeQ :: TYPE r -> Kind.Type
Now Code and TExp have signatures too:
type TExp :: TYPE r -> Kind.Type
type Code :: (Kind.Type -> Kind.Type) -> TYPE r -> Kind.Type
This is a stylistic change.
- - - - -
1 changed file:
- libraries/template-haskell/Language/Haskell/TH/Syntax.hs
Changes:
=====================================
libraries/template-haskell/Language/Haskell/TH/Syntax.hs
=====================================
@@ -8,6 +8,7 @@
{-# OPTIONS_GHC -fno-warn-inline-rule-shadowing #-}
{-# LANGUAGE TemplateHaskellQuotes #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
-----------------------------------------------------------------------------
-- |
@@ -57,6 +58,7 @@ import GHC.CString ( unpackCString# )
import GHC.Generics ( Generic )
import GHC.Types ( Int(..), Word(..), Char(..), Double(..), Float(..),
TYPE, RuntimeRep(..), Multiplicity (..) )
+import qualified Data.Kind as Kind (Type)
import GHC.Prim ( Int#, Word#, Char#, Double#, Float#, Addr# )
import GHC.Ptr ( Ptr, plusPtr )
import GHC.Lexeme ( startsVarSym, startsVarId )
@@ -332,8 +334,9 @@ instance Quote Q where
--
-----------------------------------------------------
+type TExp :: TYPE r -> Kind.Type
type role TExp nominal -- See Note [Role of TExp]
-newtype TExp (a :: TYPE (r :: RuntimeRep)) = TExp
+newtype TExp a = TExp
{ unType :: Exp -- ^ Underlying untyped Template Haskell expression
}
-- ^ Typed wrapper around an 'Exp'.
@@ -376,8 +379,9 @@ The splice will evaluate to (MkAge 3) and you can't add that to
-- Code constructor
+type Code :: (Kind.Type -> Kind.Type) -> TYPE r -> Kind.Type
type role Code representational nominal -- See Note [Role of TExp]
-newtype Code m (a :: TYPE (r :: RuntimeRep)) = Code
+newtype Code m a = Code
{ examineCode :: m (TExp a) -- ^ Underlying monadic value
}
-- ^ Represents an expression which has type @a@, built in monadic context @m at . Built on top of 'TExp', typed
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a0c27cee239462bb9346c8fdbe7f6fd1e6f265a5
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a0c27cee239462bb9346c8fdbe7f6fd1e6f265a5
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230614/688f9bd4/attachment-0001.html>
More information about the ghc-commits
mailing list