{-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# 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 {
forall p. HsGroup p -> XCHsGroup p
hs_ext :: XCHsGroup p,
forall p. HsGroup p -> HsValBinds p
hs_valds :: HsValBinds p,
forall p. HsGroup p -> [LSpliceDecl p]
hs_splcds :: [LSpliceDecl p],
forall p. HsGroup p -> [TyClGroup p]
hs_tyclds :: [TyClGroup p],
forall p. HsGroup p -> [LDerivDecl p]
hs_derivds :: [LDerivDecl p],
forall p. HsGroup p -> [LFixitySig p]
hs_fixds :: [LFixitySig p],
forall p. HsGroup p -> [LDefaultDecl p]
hs_defds :: [LDefaultDecl p],
forall p. HsGroup p -> [LForeignDecl p]
hs_fords :: [LForeignDecl p],
forall p. HsGroup p -> [LWarnDecls p]
hs_warnds :: [LWarnDecls p],
forall p. HsGroup p -> [LAnnDecl p]
hs_annds :: [LAnnDecl p],
forall p. HsGroup p -> [LRuleDecls p]
hs_ruleds :: [LRuleDecls p],
forall p. HsGroup p -> [LDocDecl p]
hs_docs :: [LDocDecl p]
}
| XHsGroup !(XXHsGroup p)
hsGroupInstDecls :: HsGroup id -> [LInstDecl id]
hsGroupInstDecls :: forall id. HsGroup id -> [LInstDecl id]
hsGroupInstDecls = (TyClGroup id -> [XRec id (InstDecl id)])
-> [TyClGroup id] -> [XRec id (InstDecl id)]
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
(=<<) TyClGroup id -> [XRec id (InstDecl id)]
forall pass. TyClGroup pass -> [LInstDecl pass]
group_instds ([TyClGroup id] -> [XRec id (InstDecl id)])
-> (HsGroup id -> [TyClGroup id])
-> HsGroup id
-> [XRec id (InstDecl 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 { forall pass. TyClDecl pass -> XFamDecl pass
tcdFExt :: XFamDecl pass, forall pass. TyClDecl pass -> FamilyDecl pass
tcdFam :: FamilyDecl pass }
|
SynDecl { forall pass. TyClDecl pass -> XSynDecl pass
tcdSExt :: XSynDecl pass
, forall pass. TyClDecl pass -> LIdP pass
tcdLName :: LIdP pass
, forall pass. TyClDecl pass -> LHsQTyVars pass
tcdTyVars :: LHsQTyVars pass
, forall pass. TyClDecl pass -> LexicalFixity
tcdFixity :: LexicalFixity
, forall pass. TyClDecl pass -> LHsType pass
tcdRhs :: LHsType pass }
|
DataDecl { forall pass. TyClDecl pass -> XDataDecl pass
tcdDExt :: XDataDecl pass
, tcdLName :: LIdP pass
, tcdTyVars :: LHsQTyVars pass
, tcdFixity :: LexicalFixity
, forall pass. TyClDecl pass -> HsDataDefn pass
tcdDataDefn :: HsDataDefn pass }
| ClassDecl { forall pass. TyClDecl pass -> XClassDecl pass
tcdCExt :: XClassDecl pass,
forall pass. TyClDecl pass -> Maybe (LHsContext pass)
tcdCtxt :: Maybe (LHsContext pass),
tcdLName :: LIdP pass,
tcdTyVars :: LHsQTyVars pass,
tcdFixity :: LexicalFixity,
forall pass. TyClDecl pass -> [LHsFunDep pass]
tcdFDs :: [LHsFunDep pass],
forall pass. TyClDecl pass -> [LSig pass]
tcdSigs :: [LSig pass],
forall pass. TyClDecl pass -> LHsBinds pass
tcdMeths :: LHsBinds pass,
forall pass. TyClDecl pass -> [LFamilyDecl pass]
tcdATs :: [LFamilyDecl pass],
forall pass. TyClDecl pass -> [LTyFamDefltDecl pass]
tcdATDefs :: [LTyFamDefltDecl pass],
forall 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
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 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)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(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 (m :: * -> *).
MonadPlus m =>
(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 (m :: * -> *).
Monad m =>
(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 :: forall u. Int -> (forall d. Data d => d -> u) -> DataDeclRn -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> DataDeclRn -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> DataDeclRn -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> DataDeclRn -> [u]
gmapQr :: forall r r'.
(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 :: forall r r'.
(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 (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(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 (t :: * -> *) (c :: * -> *).
Typeable t =>
(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 (c :: * -> *).
(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 (c :: * -> *).
(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
Data
isDataDecl :: TyClDecl pass -> Bool
isDataDecl :: forall pass. TyClDecl pass -> Bool
isDataDecl (DataDecl {}) = Bool
True
isDataDecl TyClDecl pass
_other = Bool
False
isSynDecl :: TyClDecl pass -> Bool
isSynDecl :: forall pass. TyClDecl pass -> Bool
isSynDecl (SynDecl {}) = Bool
True
isSynDecl TyClDecl pass
_other = Bool
False
isClassDecl :: TyClDecl pass -> Bool
isClassDecl :: forall pass. TyClDecl pass -> Bool
isClassDecl (ClassDecl {}) = Bool
True
isClassDecl TyClDecl pass
_ = Bool
False
isFamilyDecl :: TyClDecl pass -> Bool
isFamilyDecl :: forall pass. TyClDecl pass -> Bool
isFamilyDecl (FamDecl {}) = Bool
True
isFamilyDecl TyClDecl pass
_other = Bool
False
isTypeFamilyDecl :: TyClDecl pass -> Bool
isTypeFamilyDecl :: forall pass. 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 :: forall pass. FamilyInfo pass -> Bool
isOpenTypeFamilyInfo FamilyInfo pass
OpenTypeFamily = Bool
True
isOpenTypeFamilyInfo FamilyInfo pass
_ = Bool
False
isClosedTypeFamilyInfo :: FamilyInfo pass -> Bool
isClosedTypeFamilyInfo :: forall pass. FamilyInfo pass -> Bool
isClosedTypeFamilyInfo (ClosedTypeFamily {}) = Bool
True
isClosedTypeFamilyInfo FamilyInfo pass
_ = Bool
False
isDataFamilyDecl :: TyClDecl pass -> Bool
isDataFamilyDecl :: forall pass. 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 :: forall pass. 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 :: forall pass. [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 { forall pass. TyClGroup pass -> XCTyClGroup pass
group_ext :: XCTyClGroup pass
, forall pass. TyClGroup pass -> [LTyClDecl pass]
group_tyclds :: [LTyClDecl pass]
, forall pass. TyClGroup pass -> [LRoleAnnotDecl pass]
group_roles :: [LRoleAnnotDecl pass]
, forall pass. TyClGroup pass -> [LStandaloneKindSig pass]
group_kisigs :: [LStandaloneKindSig pass]
, forall pass. TyClGroup pass -> [LInstDecl pass]
group_instds :: [LInstDecl pass] }
| XTyClGroup !(XXTyClGroup pass)
tyClGroupTyClDecls :: [TyClGroup pass] -> [LTyClDecl pass]
tyClGroupTyClDecls :: forall pass. [TyClGroup pass] -> [LTyClDecl pass]
tyClGroupTyClDecls = (TyClGroup pass -> [XRec pass (TyClDecl pass)])
-> [TyClGroup pass] -> [XRec pass (TyClDecl pass)]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap TyClGroup pass -> [XRec pass (TyClDecl pass)]
forall pass. TyClGroup pass -> [LTyClDecl pass]
group_tyclds
tyClGroupInstDecls :: [TyClGroup pass] -> [LInstDecl pass]
tyClGroupInstDecls :: forall pass. [TyClGroup pass] -> [LInstDecl pass]
tyClGroupInstDecls = (TyClGroup pass -> [XRec pass (InstDecl pass)])
-> [TyClGroup pass] -> [XRec pass (InstDecl pass)]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap TyClGroup pass -> [XRec pass (InstDecl pass)]
forall pass. TyClGroup pass -> [LInstDecl pass]
group_instds
tyClGroupRoleDecls :: [TyClGroup pass] -> [LRoleAnnotDecl pass]
tyClGroupRoleDecls :: forall pass. [TyClGroup pass] -> [LRoleAnnotDecl pass]
tyClGroupRoleDecls = (TyClGroup pass -> [XRec pass (RoleAnnotDecl pass)])
-> [TyClGroup pass] -> [XRec pass (RoleAnnotDecl pass)]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap TyClGroup pass -> [XRec pass (RoleAnnotDecl pass)]
forall pass. TyClGroup pass -> [LRoleAnnotDecl pass]
group_roles
tyClGroupKindSigs :: [TyClGroup pass] -> [LStandaloneKindSig pass]
tyClGroupKindSigs :: forall pass. [TyClGroup pass] -> [LStandaloneKindSig pass]
tyClGroupKindSigs = (TyClGroup pass -> [XRec pass (StandaloneKindSig pass)])
-> [TyClGroup pass] -> [XRec pass (StandaloneKindSig pass)]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap TyClGroup pass -> [XRec pass (StandaloneKindSig 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
{ forall pass. FamilyDecl pass -> XCFamilyDecl pass
fdExt :: XCFamilyDecl pass
, forall pass. FamilyDecl pass -> FamilyInfo pass
fdInfo :: FamilyInfo pass
, forall pass. FamilyDecl pass -> TopLevelFlag
fdTopLevel :: TopLevelFlag
, forall pass. FamilyDecl pass -> LIdP pass
fdLName :: LIdP pass
, forall pass. FamilyDecl pass -> LHsQTyVars pass
fdTyVars :: LHsQTyVars pass
, forall pass. FamilyDecl pass -> LexicalFixity
fdFixity :: LexicalFixity
, forall pass. FamilyDecl pass -> LFamilyResultSig pass
fdResultSig :: LFamilyResultSig pass
, forall 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 :: forall pass. 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 { forall pass. HsDataDefn pass -> XCHsDataDefn pass
dd_ext :: XCHsDataDefn pass,
forall pass. HsDataDefn pass -> NewOrData
dd_ND :: NewOrData,
forall pass. HsDataDefn pass -> Maybe (LHsContext pass)
dd_ctxt :: Maybe (LHsContext pass),
forall pass. HsDataDefn pass -> Maybe (XRec pass CType)
dd_cType :: Maybe (XRec pass CType),
forall pass. HsDataDefn pass -> Maybe (LHsKind pass)
dd_kindSig:: Maybe (LHsKind pass),
forall pass. HsDataDefn pass -> [LConDecl pass]
dd_cons :: [LConDecl pass],
forall 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
{ forall pass. HsDerivingClause pass -> XCHsDerivingClause pass
deriv_clause_ext :: XCHsDerivingClause pass
, forall pass. HsDerivingClause pass -> Maybe (LDerivStrategy pass)
deriv_clause_strategy :: Maybe (LDerivStrategy pass)
, forall 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
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 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)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(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 (m :: * -> *).
MonadPlus m =>
(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 (m :: * -> *).
Monad m =>
(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 :: forall u. Int -> (forall d. Data d => d -> u) -> NewOrData -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> NewOrData -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> NewOrData -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> NewOrData -> [u]
gmapQr :: forall r r'.
(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 :: forall r r'.
(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 (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(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 (t :: * -> *) (c :: * -> *).
Typeable t =>
(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 (c :: * -> *).
(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 (c :: * -> *).
(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
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
{ forall pass. ConDecl pass -> XConDeclGADT pass
con_g_ext :: XConDeclGADT pass
, forall pass. ConDecl pass -> [LIdP pass]
con_names :: [LIdP pass]
, forall pass. ConDecl pass -> XRec pass (HsOuterSigTyVarBndrs pass)
con_bndrs :: XRec pass (HsOuterSigTyVarBndrs pass)
, forall pass. ConDecl pass -> Maybe (LHsContext pass)
con_mb_cxt :: Maybe (LHsContext pass)
, forall pass. ConDecl pass -> HsConDeclGADTDetails pass
con_g_args :: HsConDeclGADTDetails pass
, forall pass. ConDecl pass -> LHsType pass
con_res_ty :: LHsType pass
, forall pass. ConDecl pass -> Maybe LHsDocString
con_doc :: Maybe LHsDocString
}
| ConDeclH98
{ forall pass. ConDecl pass -> XConDeclH98 pass
con_ext :: XConDeclH98 pass
, forall pass. ConDecl pass -> LIdP pass
con_name :: LIdP pass
, forall pass. ConDecl pass -> Bool
con_forall :: Bool
, forall pass. ConDecl pass -> [LHsTyVarBndr Specificity pass]
con_ex_tvs :: [LHsTyVarBndr Specificity pass]
, con_mb_cxt :: Maybe (LHsContext pass)
, forall 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])
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 { forall pass. TyFamInstDecl pass -> XCTyFamInstDecl pass
tfid_xtn :: XCTyFamInstDecl pass
, forall pass. TyFamInstDecl pass -> TyFamInstEqn pass
tfid_eqn :: TyFamInstEqn pass }
| XTyFamInstDecl !(XXTyFamInstDecl pass)
type LDataFamInstDecl pass = XRec pass (DataFamInstDecl pass)
newtype DataFamInstDecl pass
= DataFamInstDecl { forall pass. DataFamInstDecl pass -> FamEqn pass (HsDataDefn pass)
dfid_eqn :: FamEqn pass (HsDataDefn pass) }
data FamEqn pass rhs
= FamEqn
{ forall pass rhs. FamEqn pass rhs -> XCFamEqn pass rhs
feqn_ext :: XCFamEqn pass rhs
, forall pass rhs. FamEqn pass rhs -> LIdP pass
feqn_tycon :: LIdP pass
, forall pass rhs. FamEqn pass rhs -> HsOuterFamEqnTyVarBndrs pass
feqn_bndrs :: HsOuterFamEqnTyVarBndrs pass
, forall pass rhs. FamEqn pass rhs -> HsTyPats pass
feqn_pats :: HsTyPats pass
, forall pass rhs. FamEqn pass rhs -> LexicalFixity
feqn_fixity :: LexicalFixity
, forall pass rhs. FamEqn pass rhs -> rhs
feqn_rhs :: rhs
}
| XFamEqn !(XXFamEqn pass rhs)
type LClsInstDecl pass = XRec pass (ClsInstDecl pass)
data ClsInstDecl pass
= ClsInstDecl
{ forall pass. ClsInstDecl pass -> XCClsInstDecl pass
cid_ext :: XCClsInstDecl pass
, forall pass. ClsInstDecl pass -> LHsSigType pass
cid_poly_ty :: LHsSigType pass
, forall pass. ClsInstDecl pass -> LHsBinds pass
cid_binds :: LHsBinds pass
, forall pass. ClsInstDecl pass -> [LSig pass]
cid_sigs :: [LSig pass]
, forall pass. ClsInstDecl pass -> [LTyFamInstDecl pass]
cid_tyfam_insts :: [LTyFamInstDecl pass]
, forall pass. ClsInstDecl pass -> [LDataFamInstDecl pass]
cid_datafam_insts :: [LDataFamInstDecl pass]
, forall 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
{ forall pass. InstDecl pass -> XClsInstD pass
cid_d_ext :: XClsInstD pass
, forall pass. InstDecl pass -> ClsInstDecl pass
cid_inst :: ClsInstDecl pass }
| DataFamInstD
{ forall pass. InstDecl pass -> XDataFamInstD pass
dfid_ext :: XDataFamInstD pass
, forall pass. InstDecl pass -> DataFamInstDecl pass
dfid_inst :: DataFamInstDecl pass }
| TyFamInstD
{ forall pass. InstDecl pass -> XTyFamInstD pass
tfid_ext :: XTyFamInstD pass
, forall pass. InstDecl pass -> TyFamInstDecl pass
tfid_inst :: TyFamInstDecl pass }
| XInstDecl !(XXInstDecl pass)
type LDerivDecl pass = XRec pass (DerivDecl pass)
data DerivDecl pass = DerivDecl
{ forall pass. DerivDecl pass -> XCDerivDecl pass
deriv_ext :: XCDerivDecl pass
, forall pass. DerivDecl pass -> LHsSigWcType pass
deriv_type :: LHsSigWcType pass
, forall pass. DerivDecl pass -> Maybe (LDerivStrategy pass)
deriv_strategy :: Maybe (LDerivStrategy pass)
, forall 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 :: forall a. 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
{ forall pass. ForeignDecl pass -> XForeignImport pass
fd_i_ext :: XForeignImport pass
, forall pass. ForeignDecl pass -> LIdP pass
fd_name :: LIdP pass
, forall pass. ForeignDecl pass -> LHsSigType pass
fd_sig_ty :: LHsSigType pass
, forall pass. ForeignDecl pass -> ForeignImport
fd_fi :: ForeignImport }
| ForeignExport
{ forall pass. ForeignDecl pass -> XForeignExport pass
fd_e_ext :: XForeignExport pass
, fd_name :: LIdP pass
, fd_sig_ty :: LHsSigType pass
, forall 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
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 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)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(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 (m :: * -> *).
MonadPlus m =>
(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 (m :: * -> *).
Monad m =>
(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 :: forall u. Int -> (forall d. Data d => d -> u) -> ForeignImport -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ForeignImport -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> ForeignImport -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ForeignImport -> [u]
gmapQr :: forall r r'.
(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 :: forall r r'.
(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 (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(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 (t :: * -> *) (c :: * -> *).
Typeable t =>
(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 (c :: * -> *).
(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 (c :: * -> *).
(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
Data
data CImportSpec = CLabel CLabelString
| CFunction CCallTarget
| CWrapper
deriving Typeable CImportSpec
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 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)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(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 (m :: * -> *).
MonadPlus m =>
(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 (m :: * -> *).
Monad m =>
(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 :: forall u. Int -> (forall d. Data d => d -> u) -> CImportSpec -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CImportSpec -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> CImportSpec -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> CImportSpec -> [u]
gmapQr :: forall r r'.
(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 :: forall r r'.
(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 (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(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 (t :: * -> *) (c :: * -> *).
Typeable t =>
(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 (c :: * -> *).
(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 (c :: * -> *).
(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
Data
data ForeignExport = CExport (Located CExportSpec)
(Located SourceText)
deriving Typeable ForeignExport
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 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)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(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 (m :: * -> *).
MonadPlus m =>
(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 (m :: * -> *).
Monad m =>
(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 :: forall u. Int -> (forall d. Data d => d -> u) -> ForeignExport -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ForeignExport -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> ForeignExport -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ForeignExport -> [u]
gmapQr :: forall r r'.
(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 :: forall r r'.
(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 (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(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 (t :: * -> *) (c :: * -> *).
Typeable t =>
(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 (c :: * -> *).
(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 (c :: * -> *).
(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
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
_ CLabelString
header) -> CLabelString -> SDoc
ftext CLabelString
header
pprCEntity :: CImportSpec -> String -> SDoc
pprCEntity (CLabel CLabelString
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
<> CLabelString -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabelString
lbl
pprCEntity (CFunction (StaticTarget SourceText
st CLabelString
_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
_ CLabelString
lbl CCallConv
cconv)) Located SourceText
_) =
CCallConv -> SDoc
forall a. Outputable a => a -> SDoc
ppr CCallConv
cconv SDoc -> SDoc -> SDoc
<+> Char -> SDoc
char Char
'"' SDoc -> SDoc -> SDoc
<> CLabelString -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabelString
lbl SDoc -> SDoc -> SDoc
<> Char -> SDoc
char Char
'"'
type LRuleDecls pass = XRec pass (RuleDecls pass)
data RuleDecls pass = HsRules { forall pass. RuleDecls pass -> XCRuleDecls pass
rds_ext :: XCRuleDecls pass
, forall pass. RuleDecls pass -> SourceText
rds_src :: SourceText
, forall pass. RuleDecls pass -> [LRuleDecl pass]
rds_rules :: [LRuleDecl pass] }
| XRuleDecls !(XXRuleDecls pass)
type LRuleDecl pass = XRec pass (RuleDecl pass)
data RuleDecl pass
= HsRule
{ forall pass. RuleDecl pass -> XHsRule pass
rd_ext :: XHsRule pass
, forall pass. RuleDecl pass -> XRec pass (SourceText, CLabelString)
rd_name :: XRec pass (SourceText,RuleName)
, forall pass. RuleDecl pass -> Activation
rd_act :: Activation
, forall pass.
RuleDecl pass -> Maybe [LHsTyVarBndr () (NoGhcTc pass)]
rd_tyvs :: Maybe [LHsTyVarBndr () (NoGhcTc pass)]
, forall pass. RuleDecl pass -> [LRuleBndr pass]
rd_tmvs :: [LRuleBndr pass]
, forall pass. RuleDecl pass -> XRec pass (HsExpr pass)
rd_lhs :: XRec pass (HsExpr pass)
, forall pass. RuleDecl pass -> XRec pass (HsExpr pass)
rd_rhs :: XRec pass (HsExpr pass)
}
| XRuleDecl !(XXRuleDecl pass)
data HsRuleRn = HsRuleRn NameSet NameSet
deriving Typeable HsRuleRn
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 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)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(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 (m :: * -> *).
MonadPlus m =>
(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 (m :: * -> *).
Monad m =>
(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 :: forall u. Int -> (forall d. Data d => d -> u) -> HsRuleRn -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> HsRuleRn -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> HsRuleRn -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> HsRuleRn -> [u]
gmapQr :: forall r r'.
(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 :: forall r r'.
(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 (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(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 (t :: * -> *) (c :: * -> *).
Typeable t =>
(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 (c :: * -> *).
(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 (c :: * -> *).
(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
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 :: forall pass. [RuleBndr pass] -> [HsPatSigType pass]
collectRuleBndrSigTys [RuleBndr pass]
bndrs = [HsPatSigType pass
ty | RuleBndrSig XRuleBndrSig pass
_ LIdP pass
_ HsPatSigType pass
ty <- [RuleBndr pass]
bndrs]
pprFullRuleName :: Located (SourceText, RuleName) -> SDoc
pprFullRuleName :: Located (SourceText, CLabelString) -> SDoc
pprFullRuleName (L SrcSpan
_ (SourceText
st, CLabelString
n)) = SourceText -> SDoc -> SDoc
pprWithSourceText SourceText
st (SDoc -> SDoc
doubleQuotes (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ CLabelString -> SDoc
ftext CLabelString
n)
type LDocDecl pass = XRec pass (DocDecl)
data DocDecl
= HsDocString
| HsDocString
| String HsDocString
| DocGroup Int HsDocString
deriving Typeable DocDecl
Typeable DocDecl
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DocDecl -> c DocDecl)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DocDecl)
-> (DocDecl -> Constr)
-> (DocDecl -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DocDecl))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DocDecl))
-> ((forall b. Data b => b -> b) -> DocDecl -> DocDecl)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DocDecl -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DocDecl -> r)
-> (forall u. (forall d. Data d => d -> u) -> DocDecl -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> DocDecl -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DocDecl -> m DocDecl)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DocDecl -> m DocDecl)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DocDecl -> m DocDecl)
-> Data DocDecl
DocDecl -> DataType
DocDecl -> Constr
(forall b. Data b => b -> b) -> DocDecl -> DocDecl
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) -> DocDecl -> u
forall u. (forall d. Data d => d -> u) -> DocDecl -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DocDecl -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DocDecl -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DocDecl -> m DocDecl
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DocDecl -> m DocDecl
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DocDecl
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DocDecl -> c DocDecl
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DocDecl)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DocDecl)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DocDecl -> m DocDecl
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DocDecl -> m DocDecl
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DocDecl -> m DocDecl
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DocDecl -> m DocDecl
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DocDecl -> m DocDecl
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DocDecl -> m DocDecl
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> DocDecl -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> DocDecl -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> DocDecl -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> DocDecl -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DocDecl -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DocDecl -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DocDecl -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DocDecl -> r
gmapT :: (forall b. Data b => b -> b) -> DocDecl -> DocDecl
$cgmapT :: (forall b. Data b => b -> b) -> DocDecl -> DocDecl
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DocDecl)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DocDecl)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DocDecl)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DocDecl)
dataTypeOf :: DocDecl -> DataType
$cdataTypeOf :: DocDecl -> DataType
toConstr :: DocDecl -> Constr
$ctoConstr :: DocDecl -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DocDecl
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DocDecl
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DocDecl -> c DocDecl
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DocDecl -> c DocDecl
Data
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 { forall pass. WarnDecls pass -> XWarnings pass
wd_ext :: XWarnings pass
, forall pass. WarnDecls pass -> SourceText
wd_src :: SourceText
, forall pass. 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 :: forall p. UnXRec p => AnnProvenance p -> Maybe (IdP p)
annProvenanceName_maybe (ValueAnnProvenance (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 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)