{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ViewPatterns #-}
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
module Language.Haskell.Syntax.Decls (
HsDecl(..), LHsDecl, HsDataDefn(..), HsDeriving, LHsFunDep, FunDep(..),
HsDerivingClause(..), LHsDerivingClause, DerivClauseTys(..), LDerivClauseTys,
NewOrData(..), newOrDataToFlavour,
StandaloneKindSig(..), LStandaloneKindSig,
TyClDecl(..), LTyClDecl, DataDeclRn(..),
TyClGroup(..),
tyClGroupTyClDecls, tyClGroupInstDecls, tyClGroupRoleDecls,
tyClGroupKindSigs,
isClassDecl, isDataDecl, isSynDecl,
isFamilyDecl, isTypeFamilyDecl, isDataFamilyDecl,
isOpenTypeFamilyInfo, isClosedTypeFamilyInfo,
countTyClDecls,
tyClDeclTyVars,
FamilyDecl(..), LFamilyDecl,
InstDecl(..), LInstDecl, FamilyInfo(..), pprFlavour,
TyFamInstDecl(..), LTyFamInstDecl,
TyFamDefltDecl, LTyFamDefltDecl,
DataFamInstDecl(..), LDataFamInstDecl,
FamEqn(..), TyFamInstEqn, LTyFamInstEqn, HsTyPats,
LClsInstDecl, ClsInstDecl(..),
DerivDecl(..), LDerivDecl,
DerivStrategy(..), LDerivStrategy,
derivStrategyName,
LRuleDecls,RuleDecls(..),RuleDecl(..),LRuleDecl,HsRuleRn(..),
RuleBndr(..),LRuleBndr,
collectRuleBndrSigTys,
pprFullRuleName,
DefaultDecl(..), LDefaultDecl,
SpliceExplicitFlag(..),
SpliceDecl(..), LSpliceDecl,
ForeignDecl(..), LForeignDecl, ForeignImport(..), ForeignExport(..),
CImportSpec(..),
ConDecl(..), LConDecl,
HsConDeclH98Details, HsConDeclGADTDetails(..),
DocDecl(..), LDocDecl, docDeclDoc,
WarnDecl(..), LWarnDecl,
WarnDecls(..), LWarnDecls,
AnnDecl(..), LAnnDecl,
AnnProvenance(..), annProvenanceName_maybe,
RoleAnnotDecl(..), LRoleAnnotDecl,
FamilyResultSig(..), LFamilyResultSig, InjectivityAnn(..), LInjectivityAnn,
HsGroup(..), hsGroupInstDecls,
) where
import GHC.Prelude
import {-# SOURCE #-} Language.Haskell.Syntax.Expr
( HsExpr, HsSplice )
import Language.Haskell.Syntax.Binds
import Language.Haskell.Syntax.Type
import GHC.Hs.Doc
import GHC.Core.TyCon
import GHC.Types.Basic
import GHC.Types.ForeignCall
import Language.Haskell.Syntax.Extension
import GHC.Types.Name.Set
import GHC.Types.Fixity
import GHC.Utils.Outputable
import GHC.Utils.Misc
import GHC.Types.SrcLoc
import GHC.Types.SourceText
import GHC.Core.Type
import GHC.Unit.Module.Warnings
import GHC.Data.Maybe
import Data.Data hiding (TyCon,Fixity, Infix)
import Data.Void
type LHsDecl p = XRec p (HsDecl p)
data HsDecl p
= TyClD (XTyClD p) (TyClDecl p)
| InstD (XInstD p) (InstDecl p)
| DerivD (XDerivD p) (DerivDecl p)
| ValD (XValD p) (HsBind p)
| SigD (XSigD p) (Sig p)
| KindSigD (XKindSigD p) (StandaloneKindSig p)
| DefD (XDefD p) (DefaultDecl p)
| ForD (XForD p) (ForeignDecl p)
| WarningD (XWarningD p) (WarnDecls p)
| AnnD (XAnnD p) (AnnDecl p)
| RuleD (XRuleD p) (RuleDecls p)
| SpliceD (XSpliceD p) (SpliceDecl p)
| DocD (XDocD p) (DocDecl)
| RoleAnnotD (XRoleAnnotD p) (RoleAnnotDecl p)
| XHsDecl !(XXHsDecl p)
data HsGroup p
= HsGroup {
HsGroup p -> XCHsGroup p
hs_ext :: XCHsGroup p,
HsGroup p -> HsValBinds p
hs_valds :: HsValBinds p,
HsGroup p -> [LSpliceDecl p]
hs_splcds :: [LSpliceDecl p],
HsGroup p -> [TyClGroup p]
hs_tyclds :: [TyClGroup p],
HsGroup p -> [LDerivDecl p]
hs_derivds :: [LDerivDecl p],
HsGroup p -> [LFixitySig p]
hs_fixds :: [LFixitySig p],
HsGroup p -> [LDefaultDecl p]
hs_defds :: [LDefaultDecl p],
HsGroup p -> [LForeignDecl p]
hs_fords :: [LForeignDecl p],
HsGroup p -> [LWarnDecls p]
hs_warnds :: [LWarnDecls p],
HsGroup p -> [LAnnDecl p]
hs_annds :: [LAnnDecl p],
HsGroup p -> [LRuleDecls p]
hs_ruleds :: [LRuleDecls p],
HsGroup p -> [LDocDecl p]
hs_docs :: [LDocDecl p]
}
| XHsGroup !(XXHsGroup p)
hsGroupInstDecls :: HsGroup id -> [LInstDecl id]
hsGroupInstDecls :: HsGroup id -> [LInstDecl id]
hsGroupInstDecls = (TyClGroup id -> [LInstDecl id])
-> [TyClGroup id] -> [LInstDecl id]
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
(=<<) TyClGroup id -> [LInstDecl id]
forall pass. TyClGroup pass -> [LInstDecl pass]
group_instds ([TyClGroup id] -> [LInstDecl id])
-> (HsGroup id -> [TyClGroup id]) -> HsGroup id -> [LInstDecl id]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HsGroup id -> [TyClGroup id]
forall p. HsGroup p -> [TyClGroup p]
hs_tyclds
type LSpliceDecl pass = XRec pass (SpliceDecl pass)
data SpliceDecl p
= SpliceDecl
(XSpliceDecl p)
(XRec p (HsSplice p))
SpliceExplicitFlag
| XSpliceDecl !(XXSpliceDecl p)
type LTyClDecl pass = XRec pass (TyClDecl pass)
data TyClDecl pass
=
FamDecl { TyClDecl pass -> XFamDecl pass
tcdFExt :: XFamDecl pass, TyClDecl pass -> FamilyDecl pass
tcdFam :: FamilyDecl pass }
|
SynDecl { TyClDecl pass -> XSynDecl pass
tcdSExt :: XSynDecl pass
, TyClDecl pass -> LIdP pass
tcdLName :: LIdP pass
, TyClDecl pass -> LHsQTyVars pass
tcdTyVars :: LHsQTyVars pass
, TyClDecl pass -> LexicalFixity
tcdFixity :: LexicalFixity
, TyClDecl pass -> LHsType pass
tcdRhs :: LHsType pass }
|
DataDecl { TyClDecl pass -> XDataDecl pass
tcdDExt :: XDataDecl pass
, tcdLName :: LIdP pass
, tcdTyVars :: LHsQTyVars pass
, tcdFixity :: LexicalFixity
, TyClDecl pass -> HsDataDefn pass
tcdDataDefn :: HsDataDefn pass }
| ClassDecl { TyClDecl pass -> XClassDecl pass
tcdCExt :: XClassDecl pass,
TyClDecl pass -> Maybe (LHsContext pass)
tcdCtxt :: Maybe (LHsContext pass),
tcdLName :: LIdP pass,
tcdTyVars :: LHsQTyVars pass,
tcdFixity :: LexicalFixity,
TyClDecl pass -> [LHsFunDep pass]
tcdFDs :: [LHsFunDep pass],
TyClDecl pass -> [LSig pass]
tcdSigs :: [LSig pass],
TyClDecl pass -> LHsBinds pass
tcdMeths :: LHsBinds pass,
TyClDecl pass -> [LFamilyDecl pass]
tcdATs :: [LFamilyDecl pass],
TyClDecl pass -> [LTyFamDefltDecl pass]
tcdATDefs :: [LTyFamDefltDecl pass],
TyClDecl pass -> [LDocDecl pass]
tcdDocs :: [LDocDecl pass]
}
| XTyClDecl !(XXTyClDecl pass)
data FunDep pass
= FunDep (XCFunDep pass)
[LIdP pass]
[LIdP pass]
| XFunDep !(XXFunDep pass)
type LHsFunDep pass = XRec pass (FunDep pass)
data DataDeclRn = DataDeclRn
{ DataDeclRn -> Bool
tcdDataCusk :: Bool
, DataDeclRn -> NameSet
tcdFVs :: NameSet }
deriving Typeable DataDeclRn
DataType
Constr
Typeable DataDeclRn
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DataDeclRn -> c DataDeclRn)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DataDeclRn)
-> (DataDeclRn -> Constr)
-> (DataDeclRn -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DataDeclRn))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c DataDeclRn))
-> ((forall b. Data b => b -> b) -> DataDeclRn -> DataDeclRn)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DataDeclRn -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DataDeclRn -> r)
-> (forall u. (forall d. Data d => d -> u) -> DataDeclRn -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> DataDeclRn -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DataDeclRn -> m DataDeclRn)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DataDeclRn -> m DataDeclRn)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DataDeclRn -> m DataDeclRn)
-> Data DataDeclRn
DataDeclRn -> DataType
DataDeclRn -> Constr
(forall b. Data b => b -> b) -> DataDeclRn -> DataDeclRn
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DataDeclRn -> c DataDeclRn
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DataDeclRn
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> DataDeclRn -> u
forall u. (forall d. Data d => d -> u) -> DataDeclRn -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DataDeclRn -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DataDeclRn -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DataDeclRn -> m DataDeclRn
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DataDeclRn -> m DataDeclRn
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DataDeclRn
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DataDeclRn -> c DataDeclRn
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DataDeclRn)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DataDeclRn)
$cDataDeclRn :: Constr
$tDataDeclRn :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> DataDeclRn -> m DataDeclRn
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DataDeclRn -> m DataDeclRn
gmapMp :: (forall d. Data d => d -> m d) -> DataDeclRn -> m DataDeclRn
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DataDeclRn -> m DataDeclRn
gmapM :: (forall d. Data d => d -> m d) -> DataDeclRn -> m DataDeclRn
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DataDeclRn -> m DataDeclRn
gmapQi :: Int -> (forall d. Data d => d -> u) -> DataDeclRn -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> DataDeclRn -> u
gmapQ :: (forall d. Data d => d -> u) -> DataDeclRn -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> DataDeclRn -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DataDeclRn -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DataDeclRn -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DataDeclRn -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DataDeclRn -> r
gmapT :: (forall b. Data b => b -> b) -> DataDeclRn -> DataDeclRn
$cgmapT :: (forall b. Data b => b -> b) -> DataDeclRn -> DataDeclRn
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DataDeclRn)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DataDeclRn)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c DataDeclRn)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DataDeclRn)
dataTypeOf :: DataDeclRn -> DataType
$cdataTypeOf :: DataDeclRn -> DataType
toConstr :: DataDeclRn -> Constr
$ctoConstr :: DataDeclRn -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DataDeclRn
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DataDeclRn
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DataDeclRn -> c DataDeclRn
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DataDeclRn -> c DataDeclRn
$cp1Data :: Typeable DataDeclRn
Data
isDataDecl :: TyClDecl pass -> Bool
isDataDecl :: TyClDecl pass -> Bool
isDataDecl (DataDecl {}) = Bool
True
isDataDecl TyClDecl pass
_other = Bool
False
isSynDecl :: TyClDecl pass -> Bool
isSynDecl :: TyClDecl pass -> Bool
isSynDecl (SynDecl {}) = Bool
True
isSynDecl TyClDecl pass
_other = Bool
False
isClassDecl :: TyClDecl pass -> Bool
isClassDecl :: TyClDecl pass -> Bool
isClassDecl (ClassDecl {}) = Bool
True
isClassDecl TyClDecl pass
_ = Bool
False
isFamilyDecl :: TyClDecl pass -> Bool
isFamilyDecl :: TyClDecl pass -> Bool
isFamilyDecl (FamDecl {}) = Bool
True
isFamilyDecl TyClDecl pass
_other = Bool
False
isTypeFamilyDecl :: TyClDecl pass -> Bool
isTypeFamilyDecl :: TyClDecl pass -> Bool
isTypeFamilyDecl (FamDecl XFamDecl pass
_ (FamilyDecl { fdInfo :: forall pass. FamilyDecl pass -> FamilyInfo pass
fdInfo = FamilyInfo pass
info })) = case FamilyInfo pass
info of
FamilyInfo pass
OpenTypeFamily -> Bool
True
ClosedTypeFamily {} -> Bool
True
FamilyInfo pass
_ -> Bool
False
isTypeFamilyDecl TyClDecl pass
_ = Bool
False
isOpenTypeFamilyInfo :: FamilyInfo pass -> Bool
isOpenTypeFamilyInfo :: FamilyInfo pass -> Bool
isOpenTypeFamilyInfo FamilyInfo pass
OpenTypeFamily = Bool
True
isOpenTypeFamilyInfo FamilyInfo pass
_ = Bool
False
isClosedTypeFamilyInfo :: FamilyInfo pass -> Bool
isClosedTypeFamilyInfo :: FamilyInfo pass -> Bool
isClosedTypeFamilyInfo (ClosedTypeFamily {}) = Bool
True
isClosedTypeFamilyInfo FamilyInfo pass
_ = Bool
False
isDataFamilyDecl :: TyClDecl pass -> Bool
isDataFamilyDecl :: TyClDecl pass -> Bool
isDataFamilyDecl (FamDecl XFamDecl pass
_ (FamilyDecl { fdInfo :: forall pass. FamilyDecl pass -> FamilyInfo pass
fdInfo = FamilyInfo pass
DataFamily })) = Bool
True
isDataFamilyDecl TyClDecl pass
_other = Bool
False
tyClDeclTyVars :: TyClDecl pass -> LHsQTyVars pass
tyClDeclTyVars :: TyClDecl pass -> LHsQTyVars pass
tyClDeclTyVars (FamDecl { tcdFam :: forall pass. TyClDecl pass -> FamilyDecl pass
tcdFam = FamilyDecl { fdTyVars :: forall pass. FamilyDecl pass -> LHsQTyVars pass
fdTyVars = LHsQTyVars pass
tvs } }) = LHsQTyVars pass
tvs
tyClDeclTyVars TyClDecl pass
d = TyClDecl pass -> LHsQTyVars pass
forall pass. TyClDecl pass -> LHsQTyVars pass
tcdTyVars TyClDecl pass
d
countTyClDecls :: [TyClDecl pass] -> (Int, Int, Int, Int, Int)
countTyClDecls :: [TyClDecl pass] -> (Int, Int, Int, Int, Int)
countTyClDecls [TyClDecl pass]
decls
= ((TyClDecl pass -> Bool) -> [TyClDecl pass] -> Int
forall a. (a -> Bool) -> [a] -> Int
count TyClDecl pass -> Bool
forall pass. TyClDecl pass -> Bool
isClassDecl [TyClDecl pass]
decls,
(TyClDecl pass -> Bool) -> [TyClDecl pass] -> Int
forall a. (a -> Bool) -> [a] -> Int
count TyClDecl pass -> Bool
forall pass. TyClDecl pass -> Bool
isSynDecl [TyClDecl pass]
decls,
(TyClDecl pass -> Bool) -> [TyClDecl pass] -> Int
forall a. (a -> Bool) -> [a] -> Int
count TyClDecl pass -> Bool
forall pass. TyClDecl pass -> Bool
isDataTy [TyClDecl pass]
decls,
(TyClDecl pass -> Bool) -> [TyClDecl pass] -> Int
forall a. (a -> Bool) -> [a] -> Int
count TyClDecl pass -> Bool
forall pass. TyClDecl pass -> Bool
isNewTy [TyClDecl pass]
decls,
(TyClDecl pass -> Bool) -> [TyClDecl pass] -> Int
forall a. (a -> Bool) -> [a] -> Int
count TyClDecl pass -> Bool
forall pass. TyClDecl pass -> Bool
isFamilyDecl [TyClDecl pass]
decls)
where
isDataTy :: TyClDecl pass -> Bool
isDataTy DataDecl{ tcdDataDefn :: forall pass. TyClDecl pass -> HsDataDefn pass
tcdDataDefn = HsDataDefn { dd_ND :: forall pass. HsDataDefn pass -> NewOrData
dd_ND = NewOrData
DataType } } = Bool
True
isDataTy TyClDecl pass
_ = Bool
False
isNewTy :: TyClDecl pass -> Bool
isNewTy DataDecl{ tcdDataDefn :: forall pass. TyClDecl pass -> HsDataDefn pass
tcdDataDefn = HsDataDefn { dd_ND :: forall pass. HsDataDefn pass -> NewOrData
dd_ND = NewOrData
NewType } } = Bool
True
isNewTy TyClDecl pass
_ = Bool
False
data TyClGroup pass
= TyClGroup { TyClGroup pass -> XCTyClGroup pass
group_ext :: XCTyClGroup pass
, TyClGroup pass -> [LTyClDecl pass]
group_tyclds :: [LTyClDecl pass]
, TyClGroup pass -> [LRoleAnnotDecl pass]
group_roles :: [LRoleAnnotDecl pass]
, TyClGroup pass -> [LStandaloneKindSig pass]
group_kisigs :: [LStandaloneKindSig pass]
, TyClGroup pass -> [LInstDecl pass]
group_instds :: [LInstDecl pass] }
| XTyClGroup !(XXTyClGroup pass)
tyClGroupTyClDecls :: [TyClGroup pass] -> [LTyClDecl pass]
tyClGroupTyClDecls :: [TyClGroup pass] -> [LTyClDecl pass]
tyClGroupTyClDecls = (TyClGroup pass -> [LTyClDecl pass])
-> [TyClGroup pass] -> [LTyClDecl pass]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap TyClGroup pass -> [LTyClDecl pass]
forall pass. TyClGroup pass -> [LTyClDecl pass]
group_tyclds
tyClGroupInstDecls :: [TyClGroup pass] -> [LInstDecl pass]
tyClGroupInstDecls :: [TyClGroup pass] -> [LInstDecl pass]
tyClGroupInstDecls = (TyClGroup pass -> [LInstDecl pass])
-> [TyClGroup pass] -> [LInstDecl pass]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap TyClGroup pass -> [LInstDecl pass]
forall pass. TyClGroup pass -> [LInstDecl pass]
group_instds
tyClGroupRoleDecls :: [TyClGroup pass] -> [LRoleAnnotDecl pass]
tyClGroupRoleDecls :: [TyClGroup pass] -> [LRoleAnnotDecl pass]
tyClGroupRoleDecls = (TyClGroup pass -> [LRoleAnnotDecl pass])
-> [TyClGroup pass] -> [LRoleAnnotDecl pass]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap TyClGroup pass -> [LRoleAnnotDecl pass]
forall pass. TyClGroup pass -> [LRoleAnnotDecl pass]
group_roles
tyClGroupKindSigs :: [TyClGroup pass] -> [LStandaloneKindSig pass]
tyClGroupKindSigs :: [TyClGroup pass] -> [LStandaloneKindSig pass]
tyClGroupKindSigs = (TyClGroup pass -> [LStandaloneKindSig pass])
-> [TyClGroup pass] -> [LStandaloneKindSig pass]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap TyClGroup pass -> [LStandaloneKindSig pass]
forall pass. TyClGroup pass -> [LStandaloneKindSig pass]
group_kisigs
type LFamilyResultSig pass = XRec pass (FamilyResultSig pass)
data FamilyResultSig pass =
NoSig (XNoSig pass)
| KindSig (XCKindSig pass) (LHsKind pass)
| TyVarSig (XTyVarSig pass) (LHsTyVarBndr () pass)
| XFamilyResultSig !(XXFamilyResultSig pass)
type LFamilyDecl pass = XRec pass (FamilyDecl pass)
data FamilyDecl pass = FamilyDecl
{ FamilyDecl pass -> XCFamilyDecl pass
fdExt :: XCFamilyDecl pass
, FamilyDecl pass -> FamilyInfo pass
fdInfo :: FamilyInfo pass
, FamilyDecl pass -> TopLevelFlag
fdTopLevel :: TopLevelFlag
, FamilyDecl pass -> LIdP pass
fdLName :: LIdP pass
, FamilyDecl pass -> LHsQTyVars pass
fdTyVars :: LHsQTyVars pass
, FamilyDecl pass -> LexicalFixity
fdFixity :: LexicalFixity
, FamilyDecl pass -> LFamilyResultSig pass
fdResultSig :: LFamilyResultSig pass
, FamilyDecl pass -> Maybe (LInjectivityAnn pass)
fdInjectivityAnn :: Maybe (LInjectivityAnn pass)
}
| XFamilyDecl !(XXFamilyDecl pass)
type LInjectivityAnn pass = XRec pass (InjectivityAnn pass)
data InjectivityAnn pass
= InjectivityAnn (XCInjectivityAnn pass)
(LIdP pass) [LIdP pass]
| XInjectivityAnn !(XXInjectivityAnn pass)
data FamilyInfo pass
= DataFamily
| OpenTypeFamily
| ClosedTypeFamily (Maybe [LTyFamInstEqn pass])
pprFlavour :: FamilyInfo pass -> SDoc
pprFlavour :: FamilyInfo pass -> SDoc
pprFlavour FamilyInfo pass
DataFamily = String -> SDoc
text String
"data"
pprFlavour FamilyInfo pass
OpenTypeFamily = String -> SDoc
text String
"type"
pprFlavour (ClosedTypeFamily {}) = String -> SDoc
text String
"type"
instance Outputable (FamilyInfo pass) where
ppr :: FamilyInfo pass -> SDoc
ppr FamilyInfo pass
info = FamilyInfo pass -> SDoc
forall pass. FamilyInfo pass -> SDoc
pprFlavour FamilyInfo pass
info SDoc -> SDoc -> SDoc
<+> String -> SDoc
text String
"family"
data HsDataDefn pass
=
HsDataDefn { HsDataDefn pass -> XCHsDataDefn pass
dd_ext :: XCHsDataDefn pass,
HsDataDefn pass -> NewOrData
dd_ND :: NewOrData,
HsDataDefn pass -> Maybe (LHsContext pass)
dd_ctxt :: Maybe (LHsContext pass),
HsDataDefn pass -> Maybe (XRec pass CType)
dd_cType :: Maybe (XRec pass CType),
HsDataDefn pass -> Maybe (LHsKind pass)
dd_kindSig:: Maybe (LHsKind pass),
HsDataDefn pass -> [LConDecl pass]
dd_cons :: [LConDecl pass],
HsDataDefn pass -> HsDeriving pass
dd_derivs :: HsDeriving pass
}
| XHsDataDefn !(XXHsDataDefn pass)
type HsDeriving pass = [LHsDerivingClause pass]
type LHsDerivingClause pass = XRec pass (HsDerivingClause pass)
data HsDerivingClause pass
= HsDerivingClause
{ HsDerivingClause pass -> XCHsDerivingClause pass
deriv_clause_ext :: XCHsDerivingClause pass
, HsDerivingClause pass -> Maybe (LDerivStrategy pass)
deriv_clause_strategy :: Maybe (LDerivStrategy pass)
, HsDerivingClause pass -> LDerivClauseTys pass
deriv_clause_tys :: LDerivClauseTys pass
}
| XHsDerivingClause !(XXHsDerivingClause pass)
type LDerivClauseTys pass = XRec pass (DerivClauseTys pass)
data DerivClauseTys pass
=
DctSingle (XDctSingle pass) (LHsSigType pass)
| DctMulti (XDctMulti pass) [LHsSigType pass]
| XDerivClauseTys !(XXDerivClauseTys pass)
type LStandaloneKindSig pass = XRec pass (StandaloneKindSig pass)
data StandaloneKindSig pass
= StandaloneKindSig (XStandaloneKindSig pass)
(LIdP pass)
(LHsSigType pass)
| XStandaloneKindSig !(XXStandaloneKindSig pass)
data NewOrData
= NewType
| DataType
deriving( NewOrData -> NewOrData -> Bool
(NewOrData -> NewOrData -> Bool)
-> (NewOrData -> NewOrData -> Bool) -> Eq NewOrData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NewOrData -> NewOrData -> Bool
$c/= :: NewOrData -> NewOrData -> Bool
== :: NewOrData -> NewOrData -> Bool
$c== :: NewOrData -> NewOrData -> Bool
Eq, Typeable NewOrData
DataType
Constr
Typeable NewOrData
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NewOrData -> c NewOrData)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NewOrData)
-> (NewOrData -> Constr)
-> (NewOrData -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c NewOrData))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NewOrData))
-> ((forall b. Data b => b -> b) -> NewOrData -> NewOrData)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NewOrData -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NewOrData -> r)
-> (forall u. (forall d. Data d => d -> u) -> NewOrData -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> NewOrData -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NewOrData -> m NewOrData)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NewOrData -> m NewOrData)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NewOrData -> m NewOrData)
-> Data NewOrData
NewOrData -> DataType
NewOrData -> Constr
(forall b. Data b => b -> b) -> NewOrData -> NewOrData
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NewOrData -> c NewOrData
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NewOrData
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> NewOrData -> u
forall u. (forall d. Data d => d -> u) -> NewOrData -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NewOrData -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NewOrData -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NewOrData -> m NewOrData
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NewOrData -> m NewOrData
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NewOrData
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NewOrData -> c NewOrData
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c NewOrData)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NewOrData)
$cDataType :: Constr
$cNewType :: Constr
$tNewOrData :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> NewOrData -> m NewOrData
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NewOrData -> m NewOrData
gmapMp :: (forall d. Data d => d -> m d) -> NewOrData -> m NewOrData
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NewOrData -> m NewOrData
gmapM :: (forall d. Data d => d -> m d) -> NewOrData -> m NewOrData
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NewOrData -> m NewOrData
gmapQi :: Int -> (forall d. Data d => d -> u) -> NewOrData -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> NewOrData -> u
gmapQ :: (forall d. Data d => d -> u) -> NewOrData -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> NewOrData -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NewOrData -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NewOrData -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NewOrData -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NewOrData -> r
gmapT :: (forall b. Data b => b -> b) -> NewOrData -> NewOrData
$cgmapT :: (forall b. Data b => b -> b) -> NewOrData -> NewOrData
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NewOrData)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NewOrData)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c NewOrData)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c NewOrData)
dataTypeOf :: NewOrData -> DataType
$cdataTypeOf :: NewOrData -> DataType
toConstr :: NewOrData -> Constr
$ctoConstr :: NewOrData -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NewOrData
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NewOrData
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NewOrData -> c NewOrData
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NewOrData -> c NewOrData
$cp1Data :: Typeable NewOrData
Data )
newOrDataToFlavour :: NewOrData -> TyConFlavour
newOrDataToFlavour :: NewOrData -> TyConFlavour
newOrDataToFlavour NewOrData
NewType = TyConFlavour
NewtypeFlavour
newOrDataToFlavour NewOrData
DataType = TyConFlavour
DataTypeFlavour
type LConDecl pass = XRec pass (ConDecl pass)
data ConDecl pass
= ConDeclGADT
{ ConDecl pass -> XConDeclGADT pass
con_g_ext :: XConDeclGADT pass
, ConDecl pass -> [LIdP pass]
con_names :: [LIdP pass]
, ConDecl pass -> XRec pass (HsOuterSigTyVarBndrs pass)
con_bndrs :: XRec pass (HsOuterSigTyVarBndrs pass)
, ConDecl pass -> Maybe (LHsContext pass)
con_mb_cxt :: Maybe (LHsContext pass)
, ConDecl pass -> HsConDeclGADTDetails pass
con_g_args :: HsConDeclGADTDetails pass
, ConDecl pass -> LHsType pass
con_res_ty :: LHsType pass
, ConDecl pass -> Maybe LHsDocString
con_doc :: Maybe LHsDocString
}
| ConDeclH98
{ ConDecl pass -> XConDeclH98 pass
con_ext :: XConDeclH98 pass
, ConDecl pass -> LIdP pass
con_name :: LIdP pass
, ConDecl pass -> Bool
con_forall :: Bool
, ConDecl pass -> [LHsTyVarBndr Specificity pass]
con_ex_tvs :: [LHsTyVarBndr Specificity pass]
, con_mb_cxt :: Maybe (LHsContext pass)
, ConDecl pass -> HsConDeclH98Details pass
con_args :: HsConDeclH98Details pass
, con_doc :: Maybe LHsDocString
}
| XConDecl !(XXConDecl pass)
type HsConDeclH98Details pass
= HsConDetails Void (HsScaled pass (LBangType pass)) (XRec pass [LConDeclField pass])
data HsConDeclGADTDetails pass
= PrefixConGADT [HsScaled pass (LBangType pass)]
| RecConGADT (XRec pass [LConDeclField pass]) (LHsUniToken "->" "→" pass)
instance Outputable NewOrData where
ppr :: NewOrData -> SDoc
ppr NewOrData
NewType = String -> SDoc
text String
"newtype"
ppr NewOrData
DataType = String -> SDoc
text String
"data"
type LTyFamInstEqn pass = XRec pass (TyFamInstEqn pass)
type HsTyPats pass = [LHsTypeArg pass]
type TyFamInstEqn pass = FamEqn pass (LHsType pass)
type TyFamDefltDecl = TyFamInstDecl
type LTyFamDefltDecl pass = XRec pass (TyFamDefltDecl pass)
type LTyFamInstDecl pass = XRec pass (TyFamInstDecl pass)
data TyFamInstDecl pass
= TyFamInstDecl { TyFamInstDecl pass -> XCTyFamInstDecl pass
tfid_xtn :: XCTyFamInstDecl pass
, TyFamInstDecl pass -> TyFamInstEqn pass
tfid_eqn :: TyFamInstEqn pass }
| XTyFamInstDecl !(XXTyFamInstDecl pass)
type LDataFamInstDecl pass = XRec pass (DataFamInstDecl pass)
newtype DataFamInstDecl pass
= DataFamInstDecl { DataFamInstDecl pass -> FamEqn pass (HsDataDefn pass)
dfid_eqn :: FamEqn pass (HsDataDefn pass) }
data FamEqn pass rhs
= FamEqn
{ FamEqn pass rhs -> XCFamEqn pass rhs
feqn_ext :: XCFamEqn pass rhs
, FamEqn pass rhs -> LIdP pass
feqn_tycon :: LIdP pass
, FamEqn pass rhs -> HsOuterFamEqnTyVarBndrs pass
feqn_bndrs :: HsOuterFamEqnTyVarBndrs pass
, FamEqn pass rhs -> HsTyPats pass
feqn_pats :: HsTyPats pass
, FamEqn pass rhs -> LexicalFixity
feqn_fixity :: LexicalFixity
, FamEqn pass rhs -> rhs
feqn_rhs :: rhs
}
| XFamEqn !(XXFamEqn pass rhs)
type LClsInstDecl pass = XRec pass (ClsInstDecl pass)
data ClsInstDecl pass
= ClsInstDecl
{ ClsInstDecl pass -> XCClsInstDecl pass
cid_ext :: XCClsInstDecl pass
, ClsInstDecl pass -> LHsSigType pass
cid_poly_ty :: LHsSigType pass
, ClsInstDecl pass -> LHsBinds pass
cid_binds :: LHsBinds pass
, ClsInstDecl pass -> [LSig pass]
cid_sigs :: [LSig pass]
, ClsInstDecl pass -> [LTyFamInstDecl pass]
cid_tyfam_insts :: [LTyFamInstDecl pass]
, ClsInstDecl pass -> [LDataFamInstDecl pass]
cid_datafam_insts :: [LDataFamInstDecl pass]
, ClsInstDecl pass -> Maybe (XRec pass OverlapMode)
cid_overlap_mode :: Maybe (XRec pass OverlapMode)
}
| XClsInstDecl !(XXClsInstDecl pass)
type LInstDecl pass = XRec pass (InstDecl pass)
data InstDecl pass
= ClsInstD
{ InstDecl pass -> XClsInstD pass
cid_d_ext :: XClsInstD pass
, InstDecl pass -> ClsInstDecl pass
cid_inst :: ClsInstDecl pass }
| DataFamInstD
{ InstDecl pass -> XDataFamInstD pass
dfid_ext :: XDataFamInstD pass
, InstDecl pass -> DataFamInstDecl pass
dfid_inst :: DataFamInstDecl pass }
| TyFamInstD
{ InstDecl pass -> XTyFamInstD pass
tfid_ext :: XTyFamInstD pass
, InstDecl pass -> TyFamInstDecl pass
tfid_inst :: TyFamInstDecl pass }
| XInstDecl !(XXInstDecl pass)
type LDerivDecl pass = XRec pass (DerivDecl pass)
data DerivDecl pass = DerivDecl
{ DerivDecl pass -> XCDerivDecl pass
deriv_ext :: XCDerivDecl pass
, DerivDecl pass -> LHsSigWcType pass
deriv_type :: LHsSigWcType pass
, DerivDecl pass -> Maybe (LDerivStrategy pass)
deriv_strategy :: Maybe (LDerivStrategy pass)
, DerivDecl pass -> Maybe (XRec pass OverlapMode)
deriv_overlap_mode :: Maybe (XRec pass OverlapMode)
}
| XDerivDecl !(XXDerivDecl pass)
type LDerivStrategy pass = XRec pass (DerivStrategy pass)
data DerivStrategy pass
= StockStrategy (XStockStrategy pass)
| AnyclassStrategy (XAnyClassStrategy pass)
| NewtypeStrategy (XNewtypeStrategy pass)
| ViaStrategy (XViaStrategy pass)
derivStrategyName :: DerivStrategy a -> SDoc
derivStrategyName :: DerivStrategy a -> SDoc
derivStrategyName = String -> SDoc
text (String -> SDoc)
-> (DerivStrategy a -> String) -> DerivStrategy a -> SDoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DerivStrategy a -> String
forall pass. DerivStrategy pass -> String
go
where
go :: DerivStrategy pass -> String
go StockStrategy {} = String
"stock"
go AnyclassStrategy {} = String
"anyclass"
go NewtypeStrategy {} = String
"newtype"
go ViaStrategy {} = String
"via"
type LDefaultDecl pass = XRec pass (DefaultDecl pass)
data DefaultDecl pass
= DefaultDecl (XCDefaultDecl pass) [LHsType pass]
| XDefaultDecl !(XXDefaultDecl pass)
type LForeignDecl pass = XRec pass (ForeignDecl pass)
data ForeignDecl pass
= ForeignImport
{ ForeignDecl pass -> XForeignImport pass
fd_i_ext :: XForeignImport pass
, ForeignDecl pass -> LIdP pass
fd_name :: LIdP pass
, ForeignDecl pass -> LHsSigType pass
fd_sig_ty :: LHsSigType pass
, ForeignDecl pass -> ForeignImport
fd_fi :: ForeignImport }
| ForeignExport
{ ForeignDecl pass -> XForeignExport pass
fd_e_ext :: XForeignExport pass
, fd_name :: LIdP pass
, fd_sig_ty :: LHsSigType pass
, ForeignDecl pass -> ForeignExport
fd_fe :: ForeignExport }
| XForeignDecl !(XXForeignDecl pass)
data ForeignImport =
CImport (Located CCallConv)
(Located Safety)
(Maybe Header)
CImportSpec
(Located SourceText)
deriving Typeable ForeignImport
DataType
Constr
Typeable ForeignImport
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ForeignImport -> c ForeignImport)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ForeignImport)
-> (ForeignImport -> Constr)
-> (ForeignImport -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ForeignImport))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ForeignImport))
-> ((forall b. Data b => b -> b) -> ForeignImport -> ForeignImport)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignImport -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignImport -> r)
-> (forall u. (forall d. Data d => d -> u) -> ForeignImport -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> ForeignImport -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ForeignImport -> m ForeignImport)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ForeignImport -> m ForeignImport)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ForeignImport -> m ForeignImport)
-> Data ForeignImport
ForeignImport -> DataType
ForeignImport -> Constr
(forall b. Data b => b -> b) -> ForeignImport -> ForeignImport
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ForeignImport -> c ForeignImport
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ForeignImport
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> ForeignImport -> u
forall u. (forall d. Data d => d -> u) -> ForeignImport -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignImport -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignImport -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ForeignImport -> m ForeignImport
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ForeignImport -> m ForeignImport
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ForeignImport
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ForeignImport -> c ForeignImport
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ForeignImport)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ForeignImport)
$cCImport :: Constr
$tForeignImport :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> ForeignImport -> m ForeignImport
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ForeignImport -> m ForeignImport
gmapMp :: (forall d. Data d => d -> m d) -> ForeignImport -> m ForeignImport
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ForeignImport -> m ForeignImport
gmapM :: (forall d. Data d => d -> m d) -> ForeignImport -> m ForeignImport
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ForeignImport -> m ForeignImport
gmapQi :: Int -> (forall d. Data d => d -> u) -> ForeignImport -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ForeignImport -> u
gmapQ :: (forall d. Data d => d -> u) -> ForeignImport -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ForeignImport -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignImport -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignImport -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignImport -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignImport -> r
gmapT :: (forall b. Data b => b -> b) -> ForeignImport -> ForeignImport
$cgmapT :: (forall b. Data b => b -> b) -> ForeignImport -> ForeignImport
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ForeignImport)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ForeignImport)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ForeignImport)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ForeignImport)
dataTypeOf :: ForeignImport -> DataType
$cdataTypeOf :: ForeignImport -> DataType
toConstr :: ForeignImport -> Constr
$ctoConstr :: ForeignImport -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ForeignImport
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ForeignImport
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ForeignImport -> c ForeignImport
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ForeignImport -> c ForeignImport
$cp1Data :: Typeable ForeignImport
Data
data CImportSpec = CLabel CLabelString
| CFunction CCallTarget
| CWrapper
deriving Typeable CImportSpec
DataType
Constr
Typeable CImportSpec
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CImportSpec -> c CImportSpec)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CImportSpec)
-> (CImportSpec -> Constr)
-> (CImportSpec -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CImportSpec))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CImportSpec))
-> ((forall b. Data b => b -> b) -> CImportSpec -> CImportSpec)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CImportSpec -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CImportSpec -> r)
-> (forall u. (forall d. Data d => d -> u) -> CImportSpec -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> CImportSpec -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> CImportSpec -> m CImportSpec)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CImportSpec -> m CImportSpec)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CImportSpec -> m CImportSpec)
-> Data CImportSpec
CImportSpec -> DataType
CImportSpec -> Constr
(forall b. Data b => b -> b) -> CImportSpec -> CImportSpec
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CImportSpec -> c CImportSpec
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CImportSpec
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> CImportSpec -> u
forall u. (forall d. Data d => d -> u) -> CImportSpec -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CImportSpec -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CImportSpec -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> CImportSpec -> m CImportSpec
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CImportSpec -> m CImportSpec
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CImportSpec
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CImportSpec -> c CImportSpec
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CImportSpec)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CImportSpec)
$cCWrapper :: Constr
$cCFunction :: Constr
$cCLabel :: Constr
$tCImportSpec :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> CImportSpec -> m CImportSpec
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CImportSpec -> m CImportSpec
gmapMp :: (forall d. Data d => d -> m d) -> CImportSpec -> m CImportSpec
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CImportSpec -> m CImportSpec
gmapM :: (forall d. Data d => d -> m d) -> CImportSpec -> m CImportSpec
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> CImportSpec -> m CImportSpec
gmapQi :: Int -> (forall d. Data d => d -> u) -> CImportSpec -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CImportSpec -> u
gmapQ :: (forall d. Data d => d -> u) -> CImportSpec -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> CImportSpec -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CImportSpec -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CImportSpec -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CImportSpec -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CImportSpec -> r
gmapT :: (forall b. Data b => b -> b) -> CImportSpec -> CImportSpec
$cgmapT :: (forall b. Data b => b -> b) -> CImportSpec -> CImportSpec
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CImportSpec)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CImportSpec)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c CImportSpec)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CImportSpec)
dataTypeOf :: CImportSpec -> DataType
$cdataTypeOf :: CImportSpec -> DataType
toConstr :: CImportSpec -> Constr
$ctoConstr :: CImportSpec -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CImportSpec
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CImportSpec
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CImportSpec -> c CImportSpec
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CImportSpec -> c CImportSpec
$cp1Data :: Typeable CImportSpec
Data
data ForeignExport = CExport (Located CExportSpec)
(Located SourceText)
deriving Typeable ForeignExport
DataType
Constr
Typeable ForeignExport
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ForeignExport -> c ForeignExport)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ForeignExport)
-> (ForeignExport -> Constr)
-> (ForeignExport -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ForeignExport))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ForeignExport))
-> ((forall b. Data b => b -> b) -> ForeignExport -> ForeignExport)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignExport -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignExport -> r)
-> (forall u. (forall d. Data d => d -> u) -> ForeignExport -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> ForeignExport -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ForeignExport -> m ForeignExport)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ForeignExport -> m ForeignExport)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ForeignExport -> m ForeignExport)
-> Data ForeignExport
ForeignExport -> DataType
ForeignExport -> Constr
(forall b. Data b => b -> b) -> ForeignExport -> ForeignExport
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ForeignExport -> c ForeignExport
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ForeignExport
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> ForeignExport -> u
forall u. (forall d. Data d => d -> u) -> ForeignExport -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignExport -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignExport -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ForeignExport -> m ForeignExport
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ForeignExport -> m ForeignExport
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ForeignExport
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ForeignExport -> c ForeignExport
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ForeignExport)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ForeignExport)
$cCExport :: Constr
$tForeignExport :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> ForeignExport -> m ForeignExport
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ForeignExport -> m ForeignExport
gmapMp :: (forall d. Data d => d -> m d) -> ForeignExport -> m ForeignExport
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ForeignExport -> m ForeignExport
gmapM :: (forall d. Data d => d -> m d) -> ForeignExport -> m ForeignExport
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ForeignExport -> m ForeignExport
gmapQi :: Int -> (forall d. Data d => d -> u) -> ForeignExport -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ForeignExport -> u
gmapQ :: (forall d. Data d => d -> u) -> ForeignExport -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ForeignExport -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignExport -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignExport -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignExport -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignExport -> r
gmapT :: (forall b. Data b => b -> b) -> ForeignExport -> ForeignExport
$cgmapT :: (forall b. Data b => b -> b) -> ForeignExport -> ForeignExport
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ForeignExport)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ForeignExport)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ForeignExport)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ForeignExport)
dataTypeOf :: ForeignExport -> DataType
$cdataTypeOf :: ForeignExport -> DataType
toConstr :: ForeignExport -> Constr
$ctoConstr :: ForeignExport -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ForeignExport
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ForeignExport
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ForeignExport -> c ForeignExport
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ForeignExport -> c ForeignExport
$cp1Data :: Typeable ForeignExport
Data
instance Outputable ForeignImport where
ppr :: ForeignImport -> SDoc
ppr (CImport Located CCallConv
cconv Located Safety
safety Maybe Header
mHeader CImportSpec
spec (L SrcSpan
_ SourceText
srcText)) =
Located CCallConv -> SDoc
forall a. Outputable a => a -> SDoc
ppr Located CCallConv
cconv SDoc -> SDoc -> SDoc
<+> Located Safety -> SDoc
forall a. Outputable a => a -> SDoc
ppr Located Safety
safety
SDoc -> SDoc -> SDoc
<+> SourceText -> SDoc -> SDoc
pprWithSourceText SourceText
srcText (CImportSpec -> String -> SDoc
pprCEntity CImportSpec
spec String
"")
where
pp_hdr :: SDoc
pp_hdr = case Maybe Header
mHeader of
Maybe Header
Nothing -> SDoc
empty
Just (Header SourceText
_ FastString
header) -> FastString -> SDoc
ftext FastString
header
pprCEntity :: CImportSpec -> String -> SDoc
pprCEntity (CLabel FastString
lbl) String
_ =
SDoc -> SDoc
doubleQuotes (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ String -> SDoc
text String
"static" SDoc -> SDoc -> SDoc
<+> SDoc
pp_hdr SDoc -> SDoc -> SDoc
<+> Char -> SDoc
char Char
'&' SDoc -> SDoc -> SDoc
<> FastString -> SDoc
forall a. Outputable a => a -> SDoc
ppr FastString
lbl
pprCEntity (CFunction (StaticTarget SourceText
st FastString
_lbl Maybe Unit
_ Bool
isFun)) String
src =
if Bool
dqNeeded then SDoc -> SDoc
doubleQuotes SDoc
ce else SDoc
empty
where
dqNeeded :: Bool
dqNeeded = (Int -> String -> String
forall a. Int -> [a] -> [a]
take Int
6 String
src String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== String
"static")
Bool -> Bool -> Bool
|| Maybe Header -> Bool
forall a. Maybe a -> Bool
isJust Maybe Header
mHeader
Bool -> Bool -> Bool
|| Bool -> Bool
not Bool
isFun
Bool -> Bool -> Bool
|| SourceText
st SourceText -> SourceText -> Bool
forall a. Eq a => a -> a -> Bool
/= SourceText
NoSourceText
ce :: SDoc
ce =
(if Int -> String -> String
forall a. Int -> [a] -> [a]
take Int
6 String
src String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== String
"static" then String -> SDoc
text String
"static" else SDoc
empty)
SDoc -> SDoc -> SDoc
<+> SDoc
pp_hdr
SDoc -> SDoc -> SDoc
<+> (if Bool
isFun then SDoc
empty else String -> SDoc
text String
"value")
SDoc -> SDoc -> SDoc
<+> (SourceText -> SDoc -> SDoc
pprWithSourceText SourceText
st SDoc
empty)
pprCEntity (CFunction CCallTarget
DynamicTarget) String
_ =
SDoc -> SDoc
doubleQuotes (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ String -> SDoc
text String
"dynamic"
pprCEntity CImportSpec
CWrapper String
_ = SDoc -> SDoc
doubleQuotes (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ String -> SDoc
text String
"wrapper"
instance Outputable ForeignExport where
ppr :: ForeignExport -> SDoc
ppr (CExport (L SrcSpan
_ (CExportStatic SourceText
_ FastString
lbl CCallConv
cconv)) GenLocated SrcSpan SourceText
_) =
CCallConv -> SDoc
forall a. Outputable a => a -> SDoc
ppr CCallConv
cconv SDoc -> SDoc -> SDoc
<+> Char -> SDoc
char Char
'"' SDoc -> SDoc -> SDoc
<> FastString -> SDoc
forall a. Outputable a => a -> SDoc
ppr FastString
lbl SDoc -> SDoc -> SDoc
<> Char -> SDoc
char Char
'"'
type LRuleDecls pass = XRec pass (RuleDecls pass)
data RuleDecls pass = HsRules { RuleDecls pass -> XCRuleDecls pass
rds_ext :: XCRuleDecls pass
, RuleDecls pass -> SourceText
rds_src :: SourceText
, RuleDecls pass -> [LRuleDecl pass]
rds_rules :: [LRuleDecl pass] }
| XRuleDecls !(XXRuleDecls pass)
type LRuleDecl pass = XRec pass (RuleDecl pass)
data RuleDecl pass
= HsRule
{ RuleDecl pass -> XHsRule pass
rd_ext :: XHsRule pass
, RuleDecl pass -> XRec pass (SourceText, FastString)
rd_name :: XRec pass (SourceText,RuleName)
, RuleDecl pass -> Activation
rd_act :: Activation
, RuleDecl pass -> Maybe [LHsTyVarBndr () (NoGhcTc pass)]
rd_tyvs :: Maybe [LHsTyVarBndr () (NoGhcTc pass)]
, RuleDecl pass -> [LRuleBndr pass]
rd_tmvs :: [LRuleBndr pass]
, RuleDecl pass -> XRec pass (HsExpr pass)
rd_lhs :: XRec pass (HsExpr pass)
, RuleDecl pass -> XRec pass (HsExpr pass)
rd_rhs :: XRec pass (HsExpr pass)
}
| XRuleDecl !(XXRuleDecl pass)
data HsRuleRn = HsRuleRn NameSet NameSet
deriving Typeable HsRuleRn
DataType
Constr
Typeable HsRuleRn
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsRuleRn -> c HsRuleRn)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsRuleRn)
-> (HsRuleRn -> Constr)
-> (HsRuleRn -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HsRuleRn))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsRuleRn))
-> ((forall b. Data b => b -> b) -> HsRuleRn -> HsRuleRn)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsRuleRn -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsRuleRn -> r)
-> (forall u. (forall d. Data d => d -> u) -> HsRuleRn -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> HsRuleRn -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HsRuleRn -> m HsRuleRn)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsRuleRn -> m HsRuleRn)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsRuleRn -> m HsRuleRn)
-> Data HsRuleRn
HsRuleRn -> DataType
HsRuleRn -> Constr
(forall b. Data b => b -> b) -> HsRuleRn -> HsRuleRn
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsRuleRn -> c HsRuleRn
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsRuleRn
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> HsRuleRn -> u
forall u. (forall d. Data d => d -> u) -> HsRuleRn -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsRuleRn -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsRuleRn -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HsRuleRn -> m HsRuleRn
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsRuleRn -> m HsRuleRn
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsRuleRn
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsRuleRn -> c HsRuleRn
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HsRuleRn)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsRuleRn)
$cHsRuleRn :: Constr
$tHsRuleRn :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> HsRuleRn -> m HsRuleRn
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsRuleRn -> m HsRuleRn
gmapMp :: (forall d. Data d => d -> m d) -> HsRuleRn -> m HsRuleRn
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsRuleRn -> m HsRuleRn
gmapM :: (forall d. Data d => d -> m d) -> HsRuleRn -> m HsRuleRn
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HsRuleRn -> m HsRuleRn
gmapQi :: Int -> (forall d. Data d => d -> u) -> HsRuleRn -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> HsRuleRn -> u
gmapQ :: (forall d. Data d => d -> u) -> HsRuleRn -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> HsRuleRn -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsRuleRn -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsRuleRn -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsRuleRn -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsRuleRn -> r
gmapT :: (forall b. Data b => b -> b) -> HsRuleRn -> HsRuleRn
$cgmapT :: (forall b. Data b => b -> b) -> HsRuleRn -> HsRuleRn
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsRuleRn)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsRuleRn)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c HsRuleRn)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HsRuleRn)
dataTypeOf :: HsRuleRn -> DataType
$cdataTypeOf :: HsRuleRn -> DataType
toConstr :: HsRuleRn -> Constr
$ctoConstr :: HsRuleRn -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsRuleRn
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsRuleRn
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsRuleRn -> c HsRuleRn
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsRuleRn -> c HsRuleRn
$cp1Data :: Typeable HsRuleRn
Data
type LRuleBndr pass = XRec pass (RuleBndr pass)
data RuleBndr pass
= RuleBndr (XCRuleBndr pass) (LIdP pass)
| RuleBndrSig (XRuleBndrSig pass) (LIdP pass) (HsPatSigType pass)
| XRuleBndr !(XXRuleBndr pass)
collectRuleBndrSigTys :: [RuleBndr pass] -> [HsPatSigType pass]
collectRuleBndrSigTys :: [RuleBndr pass] -> [HsPatSigType pass]
collectRuleBndrSigTys [RuleBndr pass]
bndrs = [HsPatSigType pass
ty | RuleBndrSig XRuleBndrSig pass
_ LIdP pass
_ HsPatSigType pass
ty <- [RuleBndr pass]
bndrs]
pprFullRuleName :: GenLocated a (SourceText, RuleName) -> SDoc
pprFullRuleName :: GenLocated a (SourceText, FastString) -> SDoc
pprFullRuleName (L a
_ (SourceText
st, FastString
n)) = SourceText -> SDoc -> SDoc
pprWithSourceText SourceText
st (SDoc -> SDoc
doubleQuotes (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ FastString -> SDoc
ftext FastString
n)
type LDocDecl pass = XRec pass (DocDecl)
data DocDecl
= HsDocString
| HsDocString
| String HsDocString
| DocGroup Int HsDocString
deriving
instance Outputable DocDecl where
ppr :: DocDecl -> SDoc
ppr DocDecl
_ = String -> SDoc
text String
"<document comment>"
docDeclDoc :: DocDecl -> HsDocString
docDeclDoc :: DocDecl -> HsDocString
docDeclDoc (DocCommentNext HsDocString
d) = HsDocString
d
docDeclDoc (DocCommentPrev HsDocString
d) = HsDocString
d
docDeclDoc (DocCommentNamed String
_ HsDocString
d) = HsDocString
d
docDeclDoc (DocGroup Int
_ HsDocString
d) = HsDocString
d
type LWarnDecls pass = XRec pass (WarnDecls pass)
data WarnDecls pass = Warnings { WarnDecls pass -> XWarnings pass
wd_ext :: XWarnings pass
, WarnDecls pass -> SourceText
wd_src :: SourceText
, WarnDecls pass -> [LWarnDecl pass]
wd_warnings :: [LWarnDecl pass]
}
| XWarnDecls !(XXWarnDecls pass)
type LWarnDecl pass = XRec pass (WarnDecl pass)
data WarnDecl pass = Warning (XWarning pass) [LIdP pass] WarningTxt
| XWarnDecl !(XXWarnDecl pass)
type LAnnDecl pass = XRec pass (AnnDecl pass)
data AnnDecl pass = HsAnnotation
(XHsAnnotation pass)
SourceText
(AnnProvenance pass) (XRec pass (HsExpr pass))
| XAnnDecl !(XXAnnDecl pass)
data AnnProvenance pass = ValueAnnProvenance (LIdP pass)
| TypeAnnProvenance (LIdP pass)
| ModuleAnnProvenance
annProvenanceName_maybe :: forall p. UnXRec p => AnnProvenance p -> Maybe (IdP p)
annProvenanceName_maybe :: AnnProvenance p -> Maybe (IdP p)
annProvenanceName_maybe (ValueAnnProvenance (forall a. UnXRec p => XRec p a -> a
forall p a. UnXRec p => XRec p a -> a
unXRec @p -> IdP p
name)) = IdP p -> Maybe (IdP p)
forall a. a -> Maybe a
Just IdP p
name
annProvenanceName_maybe (TypeAnnProvenance (forall a. UnXRec p => XRec p a -> a
forall p a. UnXRec p => XRec p a -> a
unXRec @p -> IdP p
name)) = IdP p -> Maybe (IdP p)
forall a. a -> Maybe a
Just IdP p
name
annProvenanceName_maybe AnnProvenance p
ModuleAnnProvenance = Maybe (IdP p)
forall a. Maybe a
Nothing
type LRoleAnnotDecl pass = XRec pass (RoleAnnotDecl pass)
data RoleAnnotDecl pass
= RoleAnnotDecl (XCRoleAnnotDecl pass)
(LIdP pass)
[XRec pass (Maybe Role)]
| XRoleAnnotDecl !(XXRoleAnnotDecl pass)