diff options
author | romes <rodrigo.m.mesquita@gmail.com> | 2022-06-14 00:56:14 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-07-06 13:50:27 -0400 |
commit | fd379d1b8e709f4eaa20a969bf9fffd40b8a4433 (patch) | |
tree | a168d8d325b6d7cc2170676a8822e8b38152a85f /compiler/Language/Haskell/Syntax/Basic.hs | |
parent | 371c5ecf6898294f4e5bf91784dc794e7e16b7cc (diff) | |
download | haskell-fd379d1b8e709f4eaa20a969bf9fffd40b8a4433.tar.gz |
Remove many GHC dependencies from L.H.S
Continue to prune the `Language.Haskell.Syntax.*` modules out of GHC
imports according to the plan in the linked issue.
Moves more GHC-specific declarations to `GHC.*` and brings more required
GHC-independent declarations to `Language.Haskell.Syntax.*` (extending
e.g. `Language.Haskell.Syntax.Basic`).
Progress towards #21592
Bump haddock submodule for !8308
-------------------------
Metric Decrease:
hard_hole_fits
-------------------------
Diffstat (limited to 'compiler/Language/Haskell/Syntax/Basic.hs')
-rw-r--r-- | compiler/Language/Haskell/Syntax/Basic.hs | 57 |
1 files changed, 54 insertions, 3 deletions
diff --git a/compiler/Language/Haskell/Syntax/Basic.hs b/compiler/Language/Haskell/Syntax/Basic.hs index ad3e0e94ba..092231b7d1 100644 --- a/compiler/Language/Haskell/Syntax/Basic.hs +++ b/compiler/Language/Haskell/Syntax/Basic.hs @@ -1,12 +1,13 @@ {-# LANGUAGE DeriveDataTypeable #-} module Language.Haskell.Syntax.Basic where -import Data.Int (Int) - +import Data.Data import Data.Eq +import Data.Ord import Data.Bool -import Data.Data +import Data.Int (Int) +import GHC.Data.FastString (FastString) {- ************************************************************************ @@ -42,4 +43,54 @@ type SumWidth = Int -- selector type ConTag = Int +{- +************************************************************************ +* * +Field Labels +* * +************************************************************************ +-} + +-- | Field labels are just represented as strings; +-- they are not necessarily unique (even within a module) +type FieldLabelString = FastString + + +{- +************************************************************************ +* * +Field Labels +* * +************************************************************************ +-} + +-- | See Note [Roles] in GHC.Core.Coercion +-- +-- Order of constructors matters: the Ord instance coincides with the *super*typing +-- relation on roles. +data Role = Nominal | Representational | Phantom + deriving (Eq, Ord, Data) + +{- +************************************************************************ +* * +Source Strictness and Unpackedness +* * +************************************************************************ +-} + +-- | Source Strictness +-- +-- What strictness annotation the user wrote +data SrcStrictness = SrcLazy -- ^ Lazy, ie '~' + | SrcStrict -- ^ Strict, ie '!' + | NoSrcStrict -- ^ no strictness annotation + deriving (Eq, Data) +-- | Source Unpackedness +-- +-- What unpackedness the user requested +data SrcUnpackedness = SrcUnpack -- ^ {-# UNPACK #-} specified + | SrcNoUnpack -- ^ {-# NOUNPACK #-} specified + | NoSrcUnpack -- ^ no unpack pragma + deriving (Eq, Data) |