[Git][ghc/ghc][wip/kirchner/ast] ttg: move TypeOrData into Language.Haskell.Syntax.Basic

Fabian Kirchner (@kirchner) gitlab at gitlab.haskell.org
Sun Jun 9 12:48:11 UTC 2024



Fabian Kirchner pushed to branch wip/kirchner/ast at Glasgow Haskell Compiler / GHC


Commits:
4cfa6a53 by Fabian Kirchner at 2024-06-09T14:47:37+02:00
ttg: move TypeOrData into Language.Haskell.Syntax.Basic

Progress towards #21592

- - - - -


3 changed files:

- compiler/GHC/Types/Basic.hs
- compiler/Language/Haskell/Syntax/Basic.hs
- compiler/Language/Haskell/Syntax/Decls.hs


Changes:

=====================================
compiler/GHC/Types/Basic.hs
=====================================
@@ -132,7 +132,7 @@ import GHC.Utils.Binary
 import GHC.Types.SourceText
 import qualified GHC.LanguageExtensions as LangExt
 import {-# SOURCE #-} Language.Haskell.Syntax.Type (PromotionFlag(..), isPromoted)
-import Language.Haskell.Syntax.Basic (Boxity(..), isBoxed, ConTag, TopLevelFlag(..), isTopLevel, isNotTopLevel)
+import Language.Haskell.Syntax.Basic (Boxity(..), isBoxed, ConTag, TopLevelFlag(..), isTopLevel, isNotTopLevel, TypeOrData(..))
 import {-# SOURCE #-} Language.Haskell.Syntax.Expr (HsDoFlavour)
 
 import Control.DeepSeq ( NFData(..) )
@@ -2207,13 +2207,6 @@ tyConFlavourAssoc_maybe :: TyConFlavour tc -> Maybe tc
 tyConFlavourAssoc_maybe (OpenFamilyFlavour _ mb_parent) = mb_parent
 tyConFlavourAssoc_maybe _                               = Nothing
 
--- | Whether something is a type or a data declaration,
--- e.g. a type family or a data family.
-data TypeOrData
-  = IAmData
-  | IAmType
-  deriving (Eq, Data)
-
 instance Outputable TypeOrData where
   ppr IAmData = text "data"
   ppr IAmType = text "type"


=====================================
compiler/Language/Haskell/Syntax/Basic.hs
=====================================
@@ -118,3 +118,10 @@ isNotTopLevel TopLevel    = False
 
 isTopLevel TopLevel     = True
 isTopLevel NotTopLevel  = False
+
+-- | Whether something is a type or a data declaration,
+-- e.g. a type family or a data family.
+data TypeOrData
+  = IAmData
+  | IAmType
+  deriving (Eq, Data)


=====================================
compiler/Language/Haskell/Syntax/Decls.hs
=====================================
@@ -97,11 +97,11 @@ import {-# SOURCE #-} Language.Haskell.Syntax.Expr
 import Language.Haskell.Syntax.Binds
 import Language.Haskell.Syntax.Extension
 import Language.Haskell.Syntax.Type
-import Language.Haskell.Syntax.Basic (Role, TopLevelFlag)
+import Language.Haskell.Syntax.Basic (Role, TopLevelFlag, TypeOrData(..))
 import Language.Haskell.Syntax.Specificity (Specificity)
 
 import GHC.Types.Basic (OverlapMode, RuleName, Activation
-                       ,TyConFlavour(..), TypeOrData(..))
+                       ,TyConFlavour(..))
 import GHC.Types.ForeignCall (CType, CCallConv, Safety, Header, CLabelString, CCallTarget, CExportSpec)
 import GHC.Types.Fixity (LexicalFixity)
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4cfa6a539a2cd809919f7e8ab6e178e978ae893f

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4cfa6a539a2cd809919f7e8ab6e178e978ae893f
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/20240609/d918ce9f/attachment-0001.html>


More information about the ghc-commits mailing list