summaryrefslogtreecommitdiff
path: root/compiler/Language/Haskell/Syntax/Extension.hs
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2021-04-01 21:51:17 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-23 18:53:50 -0400
commitf8c6fce4a09762adea6009540e523c2b984b2978 (patch)
treefb0898eadf884f4320e5a05f783f6308663350e9 /compiler/Language/Haskell/Syntax/Extension.hs
parentd82d38239f232c3970a8641bb6d47d436e3cbc11 (diff)
downloadhaskell-f8c6fce4a09762adea6009540e523c2b984b2978.tar.gz
HsToken for HsPar, ParPat, HsCmdPar (#19523)
This patch is a first step towards a simpler design for exact printing.
Diffstat (limited to 'compiler/Language/Haskell/Syntax/Extension.hs')
-rw-r--r--compiler/Language/Haskell/Syntax/Extension.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler/Language/Haskell/Syntax/Extension.hs b/compiler/Language/Haskell/Syntax/Extension.hs
index f414968a6e..2f9b9d7583 100644
--- a/compiler/Language/Haskell/Syntax/Extension.hs
+++ b/compiler/Language/Haskell/Syntax/Extension.hs
@@ -4,6 +4,7 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE EmptyCase #-}
{-# LANGUAGE EmptyDataDeriving #-}
+{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
@@ -22,6 +23,7 @@ module Language.Haskell.Syntax.Extension where
import GHC.Prelude
+import GHC.TypeLits (Symbol, KnownSymbol)
import Data.Data hiding ( Fixity )
import Data.Kind (Type)
import GHC.Utils.Outputable
@@ -693,3 +695,14 @@ type family NoGhcTc (p :: Type)
-- =====================================================================
-- End of Type family definitions
-- =====================================================================
+
+
+
+-- =====================================================================
+-- Token information
+
+type LHsToken tok p = XRec p (HsToken tok)
+
+data HsToken (tok :: Symbol) = HsTok
+
+deriving instance KnownSymbol tok => Data (HsToken tok)