{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilyDependencies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
module Language.Haskell.Syntax.Expr where
import GHC.Prelude
import Language.Haskell.Syntax.Decls
import Language.Haskell.Syntax.Pat
import Language.Haskell.Syntax.Lit
import Language.Haskell.Syntax.Extension
import Language.Haskell.Syntax.Type
import Language.Haskell.Syntax.Binds
import GHC.Core.DataCon (FieldLabelString)
import GHC.Types.Name
import GHC.Types.Basic
import GHC.Types.Fixity
import GHC.Types.Name.Reader
import GHC.Types.SourceText
import GHC.Types.SrcLoc
import GHC.Unit.Module (ModuleName)
import GHC.Utils.Outputable
import GHC.Utils.Panic
import GHC.Data.FastString
import GHC.Core.Type
import Data.Data hiding (Fixity(..))
import qualified Data.Data as Data (Fixity(..))
import Data.List.NonEmpty ( NonEmpty )
import GHCi.RemoteTypes ( ForeignRef )
import qualified Language.Haskell.TH as TH (Q)
type LFieldLabelStrings p = XRec p (FieldLabelStrings p)
newtype FieldLabelStrings p =
FieldLabelStrings [XRec p (DotFieldOcc p)]
instance (UnXRec p, Outputable (XRec p FieldLabelString)) => Outputable (FieldLabelStrings p) where
ppr :: FieldLabelStrings p -> SDoc
ppr (FieldLabelStrings [XRec p (DotFieldOcc p)]
flds) =
[SDoc] -> SDoc
hcat (SDoc -> [SDoc] -> [SDoc]
punctuate SDoc
dot (forall a b. (a -> b) -> [a] -> [b]
map (forall a. Outputable a => a -> SDoc
ppr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall p a. UnXRec p => XRec p a -> a
unXRec @p) [XRec p (DotFieldOcc p)]
flds))
instance (UnXRec p, Outputable (XRec p FieldLabelString)) => OutputableBndr (FieldLabelStrings p) where
pprInfixOcc :: FieldLabelStrings p -> SDoc
pprInfixOcc = forall p.
(UnXRec p, Outputable (XRec p FieldLabelString)) =>
FieldLabelStrings p -> SDoc
pprFieldLabelStrings
pprPrefixOcc :: FieldLabelStrings p -> SDoc
pprPrefixOcc = forall p.
(UnXRec p, Outputable (XRec p FieldLabelString)) =>
FieldLabelStrings p -> SDoc
pprFieldLabelStrings
instance (UnXRec p, Outputable (XRec p FieldLabelString)) => OutputableBndr (Located (FieldLabelStrings p)) where
pprInfixOcc :: Located (FieldLabelStrings p) -> SDoc
pprInfixOcc = forall a. OutputableBndr a => a -> SDoc
pprInfixOcc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall l e. GenLocated l e -> e
unLoc
pprPrefixOcc :: Located (FieldLabelStrings p) -> SDoc
pprPrefixOcc = forall a. OutputableBndr a => a -> SDoc
pprInfixOcc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall l e. GenLocated l e -> e
unLoc
pprFieldLabelStrings :: forall p. (UnXRec p, Outputable (XRec p FieldLabelString)) => FieldLabelStrings p -> SDoc
pprFieldLabelStrings :: forall p.
(UnXRec p, Outputable (XRec p FieldLabelString)) =>
FieldLabelStrings p -> SDoc
pprFieldLabelStrings (FieldLabelStrings [XRec p (DotFieldOcc p)]
flds) =
[SDoc] -> SDoc
hcat (SDoc -> [SDoc] -> [SDoc]
punctuate SDoc
dot (forall a b. (a -> b) -> [a] -> [b]
map (forall a. Outputable a => a -> SDoc
ppr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall p a. UnXRec p => XRec p a -> a
unXRec @p) [XRec p (DotFieldOcc p)]
flds))
pprPrefixFieldLabelStrings :: forall p. (UnXRec p, Outputable (XRec p FieldLabelString))
=> FieldLabelStrings p -> SDoc
pprPrefixFieldLabelStrings :: forall p.
(UnXRec p, Outputable (XRec p FieldLabelString)) =>
FieldLabelStrings p -> SDoc
pprPrefixFieldLabelStrings (FieldLabelStrings [XRec p (DotFieldOcc p)]
flds) =
[SDoc] -> SDoc
hcat (SDoc -> [SDoc] -> [SDoc]
punctuate SDoc
dot (forall a b. (a -> b) -> [a] -> [b]
map (forall p. UnXRec p => DotFieldOcc p -> SDoc
pprPrefixFieldLabelString forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall p a. UnXRec p => XRec p a -> a
unXRec @p) [XRec p (DotFieldOcc p)]
flds))
pprPrefixFieldLabelString :: forall p. UnXRec p => DotFieldOcc p -> SDoc
pprPrefixFieldLabelString :: forall p. UnXRec p => DotFieldOcc p -> SDoc
pprPrefixFieldLabelString (DotFieldOcc XCDotFieldOcc p
_ XRec p FieldLabelString
s) = (FieldLabelString -> SDoc
pprPrefixFastString forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall p a. UnXRec p => XRec p a -> a
unXRec @p) XRec p FieldLabelString
s
pprPrefixFieldLabelString XDotFieldOcc{} = String -> SDoc
text String
"XDotFieldOcc"
pprPrefixFastString :: FastString -> SDoc
pprPrefixFastString :: FieldLabelString -> SDoc
pprPrefixFastString FieldLabelString
fs = forall a. OutputableBndr a => a -> SDoc
pprPrefixOcc (FieldLabelString -> RdrName
mkVarUnqual FieldLabelString
fs)
instance UnXRec p => Outputable (DotFieldOcc p) where
ppr :: DotFieldOcc p -> SDoc
ppr (DotFieldOcc XCDotFieldOcc p
_ XRec p FieldLabelString
s) = (FieldLabelString -> SDoc
pprPrefixFastString forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall p a. UnXRec p => XRec p a -> a
unXRec @p) XRec p FieldLabelString
s
ppr XDotFieldOcc{} = String -> SDoc
text String
"XDotFieldOcc"
type RecProj p arg = HsFieldBind (LFieldLabelStrings p) arg
type LHsRecProj p arg = XRec p (RecProj p arg)
type RecUpdProj p = RecProj p (LHsExpr p)
type LHsRecUpdProj p = XRec p (RecUpdProj p)
type LHsExpr p = XRec p (HsExpr p)
type family SyntaxExpr p
type CmdSyntaxTable p = [(Name, HsExpr p)]
data HsExpr p
= HsVar (XVar p)
(LIdP p)
| HsUnboundVar (XUnboundVar p)
OccName
| HsRecSel (XRecSel p)
(FieldOcc p)
| HsOverLabel (XOverLabel p) FastString
| HsIPVar (XIPVar p)
HsIPName
| HsOverLit (XOverLitE p)
(HsOverLit p)
| HsLit (XLitE p)
(HsLit p)
| HsLam (XLam p)
(MatchGroup p (LHsExpr p))
| HsLamCase (XLamCase p) LamCaseVariant (MatchGroup p (LHsExpr p))
| HsApp (XApp p) (LHsExpr p) (LHsExpr p)
| HsAppType (XAppTypeE p)
(LHsExpr p)
(LHsWcType (NoGhcTc p))
| OpApp (XOpApp p)
(LHsExpr p)
(LHsExpr p)
(LHsExpr p)
| NegApp (XNegApp p)
(LHsExpr p)
(SyntaxExpr p)
| HsPar (XPar p)
!(LHsToken "(" p)
(LHsExpr p)
!(LHsToken ")" p)
| SectionL (XSectionL p)
(LHsExpr p)
(LHsExpr p)
| SectionR (XSectionR p)
(LHsExpr p)
(LHsExpr p)
| ExplicitTuple
(XExplicitTuple p)
[HsTupArg p]
Boxity
| ExplicitSum
(XExplicitSum p)
ConTag
Arity
(LHsExpr p)
| HsCase (XCase p)
(LHsExpr p)
(MatchGroup p (LHsExpr p))
| HsIf (XIf p)
(LHsExpr p)
(LHsExpr p)
(LHsExpr p)
| HsMultiIf (XMultiIf p) [LGRHS p (LHsExpr p)]
| HsLet (XLet p)
!(LHsToken "let" p)
(HsLocalBinds p)
!(LHsToken "in" p)
(LHsExpr p)
| HsDo (XDo p)
HsDoFlavour
(XRec p [ExprLStmt p])
| ExplicitList
(XExplicitList p)
[LHsExpr p]
| RecordCon
{ forall p. HsExpr p -> XRecordCon p
rcon_ext :: XRecordCon p
, forall p. HsExpr p -> XRec p (ConLikeP p)
rcon_con :: XRec p (ConLikeP p)
, forall p. HsExpr p -> HsRecordBinds p
rcon_flds :: HsRecordBinds p }
| RecordUpd
{ forall p. HsExpr p -> XRecordUpd p
rupd_ext :: XRecordUpd p
, forall p. HsExpr p -> LHsExpr p
rupd_expr :: LHsExpr p
, forall p. HsExpr p -> Either [LHsRecUpdField p] [LHsRecUpdProj p]
rupd_flds :: Either [LHsRecUpdField p] [LHsRecUpdProj p]
}
| HsGetField {
forall p. HsExpr p -> XGetField p
gf_ext :: XGetField p
, forall p. HsExpr p -> LHsExpr p
gf_expr :: LHsExpr p
, forall p. HsExpr p -> XRec p (DotFieldOcc p)
gf_field :: XRec p (DotFieldOcc p)
}
| HsProjection {
forall p. HsExpr p -> XProjection p
proj_ext :: XProjection p
, forall p. HsExpr p -> NonEmpty (XRec p (DotFieldOcc p))
proj_flds :: NonEmpty (XRec p (DotFieldOcc p))
}
| ExprWithTySig
(XExprWithTySig p)
(LHsExpr p)
(LHsSigWcType (NoGhcTc p))
| ArithSeq
(XArithSeq p)
(Maybe (SyntaxExpr p))
(ArithSeqInfo p)
| HsTypedBracket (XTypedBracket p) (LHsExpr p)
| HsUntypedBracket (XUntypedBracket p) (HsQuote p)
| HsSpliceE (XSpliceE p) (HsSplice p)
| HsProc (XProc p)
(LPat p)
(LHsCmdTop p)
| HsStatic (XStatic p)
(LHsExpr p)
| HsPragE (XPragE p) (HsPragE p) (LHsExpr p)
| XExpr !(XXExpr p)
data DotFieldOcc p
= DotFieldOcc
{ forall p. DotFieldOcc p -> XCDotFieldOcc p
dfoExt :: XCDotFieldOcc p
, forall p. DotFieldOcc p -> XRec p FieldLabelString
dfoLabel :: XRec p FieldLabelString
}
| XDotFieldOcc !(XXDotFieldOcc p)
data HsPragE p
= HsPragSCC (XSCC p)
SourceText
StringLiteral
| XHsPragE !(XXPragE p)
type LHsTupArg id = XRec id (HsTupArg id)
data HsTupArg id
= Present (XPresent id) (LHsExpr id)
| Missing (XMissing id)
| XTupArg !(XXTupArg id)
data LamCaseVariant
= LamCase
| LamCases
deriving (Typeable LamCaseVariant
LamCaseVariant -> DataType
LamCaseVariant -> Constr
(forall b. Data b => b -> b) -> LamCaseVariant -> LamCaseVariant
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) -> LamCaseVariant -> u
forall u. (forall d. Data d => d -> u) -> LamCaseVariant -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LamCaseVariant -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LamCaseVariant -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> LamCaseVariant -> m LamCaseVariant
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> LamCaseVariant -> m LamCaseVariant
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LamCaseVariant
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LamCaseVariant -> c LamCaseVariant
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c LamCaseVariant)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c LamCaseVariant)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> LamCaseVariant -> m LamCaseVariant
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> LamCaseVariant -> m LamCaseVariant
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> LamCaseVariant -> m LamCaseVariant
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> LamCaseVariant -> m LamCaseVariant
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> LamCaseVariant -> m LamCaseVariant
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> LamCaseVariant -> m LamCaseVariant
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> LamCaseVariant -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> LamCaseVariant -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> LamCaseVariant -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> LamCaseVariant -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LamCaseVariant -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LamCaseVariant -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LamCaseVariant -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LamCaseVariant -> r
gmapT :: (forall b. Data b => b -> b) -> LamCaseVariant -> LamCaseVariant
$cgmapT :: (forall b. Data b => b -> b) -> LamCaseVariant -> LamCaseVariant
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c LamCaseVariant)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c LamCaseVariant)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c LamCaseVariant)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c LamCaseVariant)
dataTypeOf :: LamCaseVariant -> DataType
$cdataTypeOf :: LamCaseVariant -> DataType
toConstr :: LamCaseVariant -> Constr
$ctoConstr :: LamCaseVariant -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LamCaseVariant
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LamCaseVariant
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LamCaseVariant -> c LamCaseVariant
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LamCaseVariant -> c LamCaseVariant
Data, LamCaseVariant -> LamCaseVariant -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LamCaseVariant -> LamCaseVariant -> Bool
$c/= :: LamCaseVariant -> LamCaseVariant -> Bool
== :: LamCaseVariant -> LamCaseVariant -> Bool
$c== :: LamCaseVariant -> LamCaseVariant -> Bool
Eq)
lamCaseKeyword :: LamCaseVariant -> SDoc
lamCaseKeyword :: LamCaseVariant -> SDoc
lamCaseKeyword LamCaseVariant
LamCase = String -> SDoc
text String
"\\case"
lamCaseKeyword LamCaseVariant
LamCases = String -> SDoc
text String
"\\cases"
pprExternalSrcLoc :: (StringLiteral,(Int,Int),(Int,Int)) -> SDoc
pprExternalSrcLoc :: (StringLiteral, (Int, Int), (Int, Int)) -> SDoc
pprExternalSrcLoc (StringLiteral SourceText
_ FieldLabelString
src Maybe RealSrcSpan
_,(Int
n1,Int
n2),(Int
n3,Int
n4))
= forall a. Outputable a => a -> SDoc
ppr (FieldLabelString
src,(Int
n1,Int
n2),(Int
n3,Int
n4))
type LHsCmd id = XRec id (HsCmd id)
data HsCmd id
= HsCmdArrApp
(XCmdArrApp id)
(LHsExpr id)
(LHsExpr id)
HsArrAppType
Bool
| HsCmdArrForm
(XCmdArrForm id)
(LHsExpr id)
LexicalFixity
(Maybe Fixity)
[LHsCmdTop id]
| HsCmdApp (XCmdApp id)
(LHsCmd id)
(LHsExpr id)
| HsCmdLam (XCmdLam id)
(MatchGroup id (LHsCmd id))
| HsCmdPar (XCmdPar id)
!(LHsToken "(" id)
(LHsCmd id)
!(LHsToken ")" id)
| HsCmdCase (XCmdCase id)
(LHsExpr id)
(MatchGroup id (LHsCmd id))
| HsCmdLamCase (XCmdLamCase id) LamCaseVariant
(MatchGroup id (LHsCmd id))
| HsCmdIf (XCmdIf id)
(SyntaxExpr id)
(LHsExpr id)
(LHsCmd id)
(LHsCmd id)
| HsCmdLet (XCmdLet id)
!(LHsToken "let" id)
(HsLocalBinds id)
!(LHsToken "in" id)
(LHsCmd id)
| HsCmdDo (XCmdDo id)
(XRec id [CmdLStmt id])
| XCmd !(XXCmd id)
data HsArrAppType
= HsHigherOrderApp
| HsFirstOrderApp
deriving Typeable HsArrAppType
HsArrAppType -> DataType
HsArrAppType -> Constr
(forall b. Data b => b -> b) -> HsArrAppType -> HsArrAppType
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) -> HsArrAppType -> u
forall u. (forall d. Data d => d -> u) -> HsArrAppType -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsArrAppType -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsArrAppType -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HsArrAppType -> m HsArrAppType
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsArrAppType -> m HsArrAppType
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsArrAppType
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsArrAppType -> c HsArrAppType
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HsArrAppType)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c HsArrAppType)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsArrAppType -> m HsArrAppType
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsArrAppType -> m HsArrAppType
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsArrAppType -> m HsArrAppType
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsArrAppType -> m HsArrAppType
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HsArrAppType -> m HsArrAppType
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HsArrAppType -> m HsArrAppType
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> HsArrAppType -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> HsArrAppType -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> HsArrAppType -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> HsArrAppType -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsArrAppType -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsArrAppType -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsArrAppType -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsArrAppType -> r
gmapT :: (forall b. Data b => b -> b) -> HsArrAppType -> HsArrAppType
$cgmapT :: (forall b. Data b => b -> b) -> HsArrAppType -> HsArrAppType
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c HsArrAppType)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c HsArrAppType)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HsArrAppType)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HsArrAppType)
dataTypeOf :: HsArrAppType -> DataType
$cdataTypeOf :: HsArrAppType -> DataType
toConstr :: HsArrAppType -> Constr
$ctoConstr :: HsArrAppType -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsArrAppType
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsArrAppType
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsArrAppType -> c HsArrAppType
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsArrAppType -> c HsArrAppType
Data
pprHsArrType :: HsArrAppType -> SDoc
pprHsArrType :: HsArrAppType -> SDoc
pprHsArrType HsArrAppType
HsHigherOrderApp = String -> SDoc
text String
"higher order arrow application"
pprHsArrType HsArrAppType
HsFirstOrderApp = String -> SDoc
text String
"first order arrow application"
type LHsCmdTop p = XRec p (HsCmdTop p)
data HsCmdTop p
= HsCmdTop (XCmdTop p)
(LHsCmd p)
| XCmdTop !(XXCmdTop p)
type HsRecordBinds p = HsRecFields p (LHsExpr p)
data MatchGroup p body
= MG { forall p body. MatchGroup p body -> XMG p body
mg_ext :: XMG p body
, forall p body. MatchGroup p body -> XRec p [LMatch p body]
mg_alts :: XRec p [LMatch p body]
, forall p body. MatchGroup p body -> Origin
mg_origin :: Origin }
| XMatchGroup !(XXMatchGroup p body)
data MatchGroupTc
= MatchGroupTc
{ MatchGroupTc -> [Scaled Type]
mg_arg_tys :: [Scaled Type]
, MatchGroupTc -> Type
mg_res_ty :: Type
} deriving Typeable MatchGroupTc
MatchGroupTc -> DataType
MatchGroupTc -> Constr
(forall b. Data b => b -> b) -> MatchGroupTc -> MatchGroupTc
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) -> MatchGroupTc -> u
forall u. (forall d. Data d => d -> u) -> MatchGroupTc -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MatchGroupTc -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MatchGroupTc -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> MatchGroupTc -> m MatchGroupTc
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MatchGroupTc -> m MatchGroupTc
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MatchGroupTc
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MatchGroupTc -> c MatchGroupTc
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MatchGroupTc)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c MatchGroupTc)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MatchGroupTc -> m MatchGroupTc
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MatchGroupTc -> m MatchGroupTc
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MatchGroupTc -> m MatchGroupTc
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MatchGroupTc -> m MatchGroupTc
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> MatchGroupTc -> m MatchGroupTc
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> MatchGroupTc -> m MatchGroupTc
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> MatchGroupTc -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> MatchGroupTc -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> MatchGroupTc -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> MatchGroupTc -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MatchGroupTc -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MatchGroupTc -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MatchGroupTc -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MatchGroupTc -> r
gmapT :: (forall b. Data b => b -> b) -> MatchGroupTc -> MatchGroupTc
$cgmapT :: (forall b. Data b => b -> b) -> MatchGroupTc -> MatchGroupTc
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c MatchGroupTc)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c MatchGroupTc)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MatchGroupTc)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MatchGroupTc)
dataTypeOf :: MatchGroupTc -> DataType
$cdataTypeOf :: MatchGroupTc -> DataType
toConstr :: MatchGroupTc -> Constr
$ctoConstr :: MatchGroupTc -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MatchGroupTc
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MatchGroupTc
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MatchGroupTc -> c MatchGroupTc
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MatchGroupTc -> c MatchGroupTc
Data
type LMatch id body = XRec id (Match id body)
data Match p body
= Match {
forall p body. Match p body -> XCMatch p body
m_ext :: XCMatch p body,
forall p body. Match p body -> HsMatchContext p
m_ctxt :: HsMatchContext p,
forall p body. Match p body -> [LPat p]
m_pats :: [LPat p],
forall p body. Match p body -> GRHSs p body
m_grhss :: (GRHSs p body)
}
| XMatch !(XXMatch p body)
isInfixMatch :: Match id body -> Bool
isInfixMatch :: forall id body. Match id body -> Bool
isInfixMatch Match id body
match = case forall p body. Match p body -> HsMatchContext p
m_ctxt Match id body
match of
FunRhs {mc_fixity :: forall p. HsMatchContext p -> LexicalFixity
mc_fixity = LexicalFixity
Infix} -> Bool
True
HsMatchContext id
_ -> Bool
False
data GRHSs p body
= GRHSs {
forall p body. GRHSs p body -> XCGRHSs p body
grhssExt :: XCGRHSs p body,
forall p body. GRHSs p body -> [LGRHS p body]
grhssGRHSs :: [LGRHS p body],
forall p body. GRHSs p body -> HsLocalBinds p
grhssLocalBinds :: HsLocalBinds p
}
| XGRHSs !(XXGRHSs p body)
type LGRHS id body = XRec id (GRHS id body)
data GRHS p body = GRHS (XCGRHS p body)
[GuardLStmt p]
body
| XGRHS !(XXGRHS p body)
type LStmt id body = XRec id (StmtLR id id body)
type LStmtLR idL idR body = XRec idL (StmtLR idL idR body)
type Stmt id body = StmtLR id id body
type CmdLStmt id = LStmt id (LHsCmd id)
type CmdStmt id = Stmt id (LHsCmd id)
type ExprLStmt id = LStmt id (LHsExpr id)
type ExprStmt id = Stmt id (LHsExpr id)
type GuardLStmt id = LStmt id (LHsExpr id)
type GuardStmt id = Stmt id (LHsExpr id)
type GhciLStmt id = LStmt id (LHsExpr id)
type GhciStmt id = Stmt id (LHsExpr id)
data StmtLR idL idR body
= LastStmt
(XLastStmt idL idR body)
body
(Maybe Bool)
(SyntaxExpr idR)
| BindStmt (XBindStmt idL idR body)
(LPat idL)
body
| ApplicativeStmt
(XApplicativeStmt idL idR body)
[ ( SyntaxExpr idR
, ApplicativeArg idL) ]
(Maybe (SyntaxExpr idR))
| BodyStmt (XBodyStmt idL idR body)
body
(SyntaxExpr idR)
(SyntaxExpr idR)
| LetStmt (XLetStmt idL idR body) (HsLocalBindsLR idL idR)
| ParStmt (XParStmt idL idR body)
[ParStmtBlock idL idR]
(HsExpr idR)
(SyntaxExpr idR)
| TransStmt {
forall idL idR body. StmtLR idL idR body -> XTransStmt idL idR body
trS_ext :: XTransStmt idL idR body,
forall idL idR body. StmtLR idL idR body -> TransForm
trS_form :: TransForm,
forall idL idR body. StmtLR idL idR body -> [ExprLStmt idL]
trS_stmts :: [ExprLStmt idL],
forall idL idR body. StmtLR idL idR body -> [(IdP idR, IdP idR)]
trS_bndrs :: [(IdP idR, IdP idR)],
forall idL idR body. StmtLR idL idR body -> LHsExpr idR
trS_using :: LHsExpr idR,
forall idL idR body. StmtLR idL idR body -> Maybe (LHsExpr idR)
trS_by :: Maybe (LHsExpr idR),
forall idL idR body. StmtLR idL idR body -> SyntaxExpr idR
trS_ret :: SyntaxExpr idR,
forall idL idR body. StmtLR idL idR body -> SyntaxExpr idR
trS_bind :: SyntaxExpr idR,
forall idL idR body. StmtLR idL idR body -> HsExpr idR
trS_fmap :: HsExpr idR
}
| RecStmt
{ forall idL idR body. StmtLR idL idR body -> XRecStmt idL idR body
recS_ext :: XRecStmt idL idR body
, forall idL idR body.
StmtLR idL idR body -> XRec idR [LStmtLR idL idR body]
recS_stmts :: XRec idR [LStmtLR idL idR body]
, forall idL idR body. StmtLR idL idR body -> [IdP idR]
recS_later_ids :: [IdP idR]
, forall idL idR body. StmtLR idL idR body -> [IdP idR]
recS_rec_ids :: [IdP idR]
, forall idL idR body. StmtLR idL idR body -> SyntaxExpr idR
recS_bind_fn :: SyntaxExpr idR
, forall idL idR body. StmtLR idL idR body -> SyntaxExpr idR
recS_ret_fn :: SyntaxExpr idR
, forall idL idR body. StmtLR idL idR body -> SyntaxExpr idR
recS_mfix_fn :: SyntaxExpr idR
}
| XStmtLR !(XXStmtLR idL idR body)
data TransForm
= ThenForm
| GroupForm
deriving Typeable TransForm
TransForm -> DataType
TransForm -> Constr
(forall b. Data b => b -> b) -> TransForm -> TransForm
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) -> TransForm -> u
forall u. (forall d. Data d => d -> u) -> TransForm -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TransForm -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TransForm -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TransForm -> m TransForm
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TransForm -> m TransForm
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TransForm
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TransForm -> c TransForm
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TransForm)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TransForm)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TransForm -> m TransForm
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TransForm -> m TransForm
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TransForm -> m TransForm
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TransForm -> m TransForm
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TransForm -> m TransForm
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TransForm -> m TransForm
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> TransForm -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> TransForm -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> TransForm -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> TransForm -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TransForm -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TransForm -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TransForm -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TransForm -> r
gmapT :: (forall b. Data b => b -> b) -> TransForm -> TransForm
$cgmapT :: (forall b. Data b => b -> b) -> TransForm -> TransForm
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TransForm)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TransForm)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TransForm)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TransForm)
dataTypeOf :: TransForm -> DataType
$cdataTypeOf :: TransForm -> DataType
toConstr :: TransForm -> Constr
$ctoConstr :: TransForm -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TransForm
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TransForm
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TransForm -> c TransForm
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TransForm -> c TransForm
Data
data ParStmtBlock idL idR
= ParStmtBlock
(XParStmtBlock idL idR)
[ExprLStmt idL]
[IdP idR]
(SyntaxExpr idR)
| XParStmtBlock !(XXParStmtBlock idL idR)
type FailOperator id = Maybe (SyntaxExpr id)
data ApplicativeArg idL
= ApplicativeArgOne
{ forall idL. ApplicativeArg idL -> XApplicativeArgOne idL
xarg_app_arg_one :: XApplicativeArgOne idL
, forall idL. ApplicativeArg idL -> LPat idL
app_arg_pattern :: LPat idL
, forall idL. ApplicativeArg idL -> LHsExpr idL
arg_expr :: LHsExpr idL
, forall idL. ApplicativeArg idL -> Bool
is_body_stmt :: Bool
}
| ApplicativeArgMany
{ forall idL. ApplicativeArg idL -> XApplicativeArgMany idL
xarg_app_arg_many :: XApplicativeArgMany idL
, forall idL. ApplicativeArg idL -> [ExprLStmt idL]
app_stmts :: [ExprLStmt idL]
, forall idL. ApplicativeArg idL -> HsExpr idL
final_expr :: HsExpr idL
, forall idL. ApplicativeArg idL -> LPat idL
bv_pattern :: LPat idL
, forall idL. ApplicativeArg idL -> HsDoFlavour
stmt_context :: HsDoFlavour
}
| XApplicativeArg !(XXApplicativeArg idL)
data HsSplice id
= HsTypedSplice
(XTypedSplice id)
SpliceDecoration
(IdP id)
(LHsExpr id)
| HsUntypedSplice
(XUntypedSplice id)
SpliceDecoration
(IdP id)
(LHsExpr id)
| HsQuasiQuote
(XQuasiQuote id)
(IdP id)
(IdP id)
SrcSpan
FastString
| HsSpliced
(XSpliced id)
ThModFinalizers
(HsSplicedThing id)
| XSplice !(XXSplice id)
data SpliceDecoration
= DollarSplice
| BareSplice
deriving (Typeable SpliceDecoration
SpliceDecoration -> DataType
SpliceDecoration -> Constr
(forall b. Data b => b -> b)
-> SpliceDecoration -> SpliceDecoration
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) -> SpliceDecoration -> u
forall u. (forall d. Data d => d -> u) -> SpliceDecoration -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SpliceDecoration -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SpliceDecoration -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SpliceDecoration -> m SpliceDecoration
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SpliceDecoration -> m SpliceDecoration
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SpliceDecoration
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SpliceDecoration -> c SpliceDecoration
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SpliceDecoration)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SpliceDecoration)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SpliceDecoration -> m SpliceDecoration
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SpliceDecoration -> m SpliceDecoration
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SpliceDecoration -> m SpliceDecoration
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SpliceDecoration -> m SpliceDecoration
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SpliceDecoration -> m SpliceDecoration
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SpliceDecoration -> m SpliceDecoration
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> SpliceDecoration -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> SpliceDecoration -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> SpliceDecoration -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> SpliceDecoration -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SpliceDecoration -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SpliceDecoration -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SpliceDecoration -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SpliceDecoration -> r
gmapT :: (forall b. Data b => b -> b)
-> SpliceDecoration -> SpliceDecoration
$cgmapT :: (forall b. Data b => b -> b)
-> SpliceDecoration -> SpliceDecoration
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SpliceDecoration)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SpliceDecoration)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SpliceDecoration)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SpliceDecoration)
dataTypeOf :: SpliceDecoration -> DataType
$cdataTypeOf :: SpliceDecoration -> DataType
toConstr :: SpliceDecoration -> Constr
$ctoConstr :: SpliceDecoration -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SpliceDecoration
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SpliceDecoration
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SpliceDecoration -> c SpliceDecoration
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SpliceDecoration -> c SpliceDecoration
Data, SpliceDecoration -> SpliceDecoration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SpliceDecoration -> SpliceDecoration -> Bool
$c/= :: SpliceDecoration -> SpliceDecoration -> Bool
== :: SpliceDecoration -> SpliceDecoration -> Bool
$c== :: SpliceDecoration -> SpliceDecoration -> Bool
Eq, Int -> SpliceDecoration -> ShowS
[SpliceDecoration] -> ShowS
SpliceDecoration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SpliceDecoration] -> ShowS
$cshowList :: [SpliceDecoration] -> ShowS
show :: SpliceDecoration -> String
$cshow :: SpliceDecoration -> String
showsPrec :: Int -> SpliceDecoration -> ShowS
$cshowsPrec :: Int -> SpliceDecoration -> ShowS
Show)
instance Outputable SpliceDecoration where
ppr :: SpliceDecoration -> SDoc
ppr SpliceDecoration
x = String -> SDoc
text forall a b. (a -> b) -> a -> b
$ forall a. Show a => a -> String
show SpliceDecoration
x
isTypedSplice :: HsSplice id -> Bool
isTypedSplice :: forall id. HsSplice id -> Bool
isTypedSplice (HsTypedSplice {}) = Bool
True
isTypedSplice HsSplice id
_ = Bool
False
newtype ThModFinalizers = ThModFinalizers [ForeignRef (TH.Q ())]
instance Data ThModFinalizers where
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ThModFinalizers
gunfold forall b r. Data b => c (b -> r) -> c r
_ forall r. r -> c r
z Constr
_ = forall r. r -> c r
z forall a b. (a -> b) -> a -> b
$ [ForeignRef (Q ())] -> ThModFinalizers
ThModFinalizers []
toConstr :: ThModFinalizers -> Constr
toConstr ThModFinalizers
a = DataType -> String -> [String] -> Fixity -> Constr
mkConstr (forall a. Data a => a -> DataType
dataTypeOf ThModFinalizers
a) String
"ThModFinalizers" [] Fixity
Data.Prefix
dataTypeOf :: ThModFinalizers -> DataType
dataTypeOf ThModFinalizers
a = String -> [Constr] -> DataType
mkDataType String
"HsExpr.ThModFinalizers" [forall a. Data a => a -> Constr
toConstr ThModFinalizers
a]
data HsSplicedThing id
= HsSplicedExpr (HsExpr id)
| HsSplicedTy (HsType id)
| HsSplicedPat (Pat id)
data UntypedSpliceFlavour
= UntypedExpSplice
| UntypedPatSplice
| UntypedTypeSplice
| UntypedDeclSplice
deriving Typeable UntypedSpliceFlavour
UntypedSpliceFlavour -> DataType
UntypedSpliceFlavour -> Constr
(forall b. Data b => b -> b)
-> UntypedSpliceFlavour -> UntypedSpliceFlavour
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) -> UntypedSpliceFlavour -> u
forall u.
(forall d. Data d => d -> u) -> UntypedSpliceFlavour -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UntypedSpliceFlavour -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UntypedSpliceFlavour -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> UntypedSpliceFlavour -> m UntypedSpliceFlavour
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UntypedSpliceFlavour -> m UntypedSpliceFlavour
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UntypedSpliceFlavour
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> UntypedSpliceFlavour
-> c UntypedSpliceFlavour
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UntypedSpliceFlavour)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UntypedSpliceFlavour)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UntypedSpliceFlavour -> m UntypedSpliceFlavour
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UntypedSpliceFlavour -> m UntypedSpliceFlavour
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UntypedSpliceFlavour -> m UntypedSpliceFlavour
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UntypedSpliceFlavour -> m UntypedSpliceFlavour
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> UntypedSpliceFlavour -> m UntypedSpliceFlavour
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> UntypedSpliceFlavour -> m UntypedSpliceFlavour
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> UntypedSpliceFlavour -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> UntypedSpliceFlavour -> u
gmapQ :: forall u.
(forall d. Data d => d -> u) -> UntypedSpliceFlavour -> [u]
$cgmapQ :: forall u.
(forall d. Data d => d -> u) -> UntypedSpliceFlavour -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UntypedSpliceFlavour -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UntypedSpliceFlavour -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UntypedSpliceFlavour -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UntypedSpliceFlavour -> r
gmapT :: (forall b. Data b => b -> b)
-> UntypedSpliceFlavour -> UntypedSpliceFlavour
$cgmapT :: (forall b. Data b => b -> b)
-> UntypedSpliceFlavour -> UntypedSpliceFlavour
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UntypedSpliceFlavour)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UntypedSpliceFlavour)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UntypedSpliceFlavour)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UntypedSpliceFlavour)
dataTypeOf :: UntypedSpliceFlavour -> DataType
$cdataTypeOf :: UntypedSpliceFlavour -> DataType
toConstr :: UntypedSpliceFlavour -> Constr
$ctoConstr :: UntypedSpliceFlavour -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UntypedSpliceFlavour
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UntypedSpliceFlavour
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> UntypedSpliceFlavour
-> c UntypedSpliceFlavour
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> UntypedSpliceFlavour
-> c UntypedSpliceFlavour
Data
data HsQuote p
= ExpBr (XExpBr p) (LHsExpr p)
| PatBr (XPatBr p) (LPat p)
| DecBrL (XDecBrL p) [LHsDecl p]
| DecBrG (XDecBrG p) (HsGroup p)
| TypBr (XTypBr p) (LHsType p)
| VarBr (XVarBr p) Bool (LIdP p)
| XQuote !(XXQuote p)
data ArithSeqInfo id
= From (LHsExpr id)
| FromThen (LHsExpr id)
(LHsExpr id)
| FromTo (LHsExpr id)
(LHsExpr id)
| FromThenTo (LHsExpr id)
(LHsExpr id)
(LHsExpr id)
data HsMatchContext p
= FunRhs
{ forall p. HsMatchContext p -> LIdP (NoGhcTc p)
mc_fun :: LIdP (NoGhcTc p)
, forall p. HsMatchContext p -> LexicalFixity
mc_fixity :: LexicalFixity
, forall p. HsMatchContext p -> SrcStrictness
mc_strictness :: SrcStrictness
}
| LambdaExpr
| CaseAlt
| LamCaseAlt LamCaseVariant
| IfAlt
| ArrowMatchCtxt
HsArrowMatchContext
| PatBindRhs
| PatBindGuards
| RecUpd
| StmtCtxt (HsStmtContext p)
| ThPatSplice
| ThPatQuote
| PatSyn
isPatSynCtxt :: HsMatchContext p -> Bool
isPatSynCtxt :: forall p. HsMatchContext p -> Bool
isPatSynCtxt HsMatchContext p
ctxt =
case HsMatchContext p
ctxt of
HsMatchContext p
PatSyn -> Bool
True
HsMatchContext p
_ -> Bool
False
data HsStmtContext p
= HsDoStmt HsDoFlavour
| PatGuard (HsMatchContext p)
| ParStmtCtxt (HsStmtContext p)
| TransStmtCtxt (HsStmtContext p)
| ArrowExpr
data HsArrowMatchContext
= ProcExpr
| ArrowCaseAlt
| ArrowLamCaseAlt LamCaseVariant
| KappaExpr
data HsDoFlavour
= DoExpr (Maybe ModuleName)
| MDoExpr (Maybe ModuleName)
| GhciStmtCtxt
| ListComp
| MonadComp
qualifiedDoModuleName_maybe :: HsStmtContext p -> Maybe ModuleName
qualifiedDoModuleName_maybe :: forall p. HsStmtContext p -> Maybe ModuleName
qualifiedDoModuleName_maybe HsStmtContext p
ctxt = case HsStmtContext p
ctxt of
HsDoStmt (DoExpr Maybe ModuleName
m) -> Maybe ModuleName
m
HsDoStmt (MDoExpr Maybe ModuleName
m) -> Maybe ModuleName
m
HsStmtContext p
_ -> forall a. Maybe a
Nothing
isComprehensionContext :: HsStmtContext id -> Bool
isComprehensionContext :: forall id. HsStmtContext id -> Bool
isComprehensionContext (ParStmtCtxt HsStmtContext id
c) = forall id. HsStmtContext id -> Bool
isComprehensionContext HsStmtContext id
c
isComprehensionContext (TransStmtCtxt HsStmtContext id
c) = forall id. HsStmtContext id -> Bool
isComprehensionContext HsStmtContext id
c
isComprehensionContext HsStmtContext id
ArrowExpr = Bool
False
isComprehensionContext (PatGuard HsMatchContext id
_) = Bool
False
isComprehensionContext (HsDoStmt HsDoFlavour
flavour) = HsDoFlavour -> Bool
isDoComprehensionContext HsDoFlavour
flavour
isDoComprehensionContext :: HsDoFlavour -> Bool
isDoComprehensionContext :: HsDoFlavour -> Bool
isDoComprehensionContext HsDoFlavour
GhciStmtCtxt = Bool
False
isDoComprehensionContext (DoExpr Maybe ModuleName
_) = Bool
False
isDoComprehensionContext (MDoExpr Maybe ModuleName
_) = Bool
False
isDoComprehensionContext HsDoFlavour
ListComp = Bool
True
isDoComprehensionContext HsDoFlavour
MonadComp = Bool
True
isMonadStmtContext :: HsStmtContext id -> Bool
isMonadStmtContext :: forall id. HsStmtContext id -> Bool
isMonadStmtContext (ParStmtCtxt HsStmtContext id
ctxt) = forall id. HsStmtContext id -> Bool
isMonadStmtContext HsStmtContext id
ctxt
isMonadStmtContext (TransStmtCtxt HsStmtContext id
ctxt) = forall id. HsStmtContext id -> Bool
isMonadStmtContext HsStmtContext id
ctxt
isMonadStmtContext (HsDoStmt HsDoFlavour
flavour) = HsDoFlavour -> Bool
isMonadDoStmtContext HsDoFlavour
flavour
isMonadStmtContext (PatGuard HsMatchContext id
_) = Bool
False
isMonadStmtContext HsStmtContext id
ArrowExpr = Bool
False
isMonadDoStmtContext :: HsDoFlavour -> Bool
isMonadDoStmtContext :: HsDoFlavour -> Bool
isMonadDoStmtContext HsDoFlavour
ListComp = Bool
False
isMonadDoStmtContext HsDoFlavour
MonadComp = Bool
True
isMonadDoStmtContext DoExpr{} = Bool
True
isMonadDoStmtContext MDoExpr{} = Bool
True
isMonadDoStmtContext HsDoFlavour
GhciStmtCtxt = Bool
True
isMonadCompContext :: HsStmtContext id -> Bool
isMonadCompContext :: forall id. HsStmtContext id -> Bool
isMonadCompContext (HsDoStmt HsDoFlavour
flavour) = HsDoFlavour -> Bool
isMonadDoCompContext HsDoFlavour
flavour
isMonadCompContext (ParStmtCtxt HsStmtContext id
_) = Bool
False
isMonadCompContext (TransStmtCtxt HsStmtContext id
_) = Bool
False
isMonadCompContext (PatGuard HsMatchContext id
_) = Bool
False
isMonadCompContext HsStmtContext id
ArrowExpr = Bool
False
isMonadDoCompContext :: HsDoFlavour -> Bool
isMonadDoCompContext :: HsDoFlavour -> Bool
isMonadDoCompContext HsDoFlavour
MonadComp = Bool
True
isMonadDoCompContext HsDoFlavour
ListComp = Bool
False
isMonadDoCompContext HsDoFlavour
GhciStmtCtxt = Bool
False
isMonadDoCompContext (DoExpr Maybe ModuleName
_) = Bool
False
isMonadDoCompContext (MDoExpr Maybe ModuleName
_) = Bool
False
matchSeparator :: HsMatchContext p -> SDoc
matchSeparator :: forall p. HsMatchContext p -> SDoc
matchSeparator FunRhs{} = String -> SDoc
text String
"="
matchSeparator HsMatchContext p
CaseAlt = String -> SDoc
text String
"->"
matchSeparator LamCaseAlt{} = String -> SDoc
text String
"->"
matchSeparator HsMatchContext p
IfAlt = String -> SDoc
text String
"->"
matchSeparator HsMatchContext p
LambdaExpr = String -> SDoc
text String
"->"
matchSeparator ArrowMatchCtxt{} = String -> SDoc
text String
"->"
matchSeparator HsMatchContext p
PatBindRhs = String -> SDoc
text String
"="
matchSeparator HsMatchContext p
PatBindGuards = String -> SDoc
text String
"="
matchSeparator StmtCtxt{} = String -> SDoc
text String
"<-"
matchSeparator HsMatchContext p
RecUpd = String -> SDoc
text String
"="
matchSeparator HsMatchContext p
ThPatSplice = forall a. String -> a
panic String
"unused"
matchSeparator HsMatchContext p
ThPatQuote = forall a. String -> a
panic String
"unused"
matchSeparator HsMatchContext p
PatSyn = forall a. String -> a
panic String
"unused"
pprMatchContext :: (Outputable (IdP (NoGhcTc p)), UnXRec (NoGhcTc p))
=> HsMatchContext p -> SDoc
pprMatchContext :: forall p.
(Outputable (IdP (NoGhcTc p)), UnXRec (NoGhcTc p)) =>
HsMatchContext p -> SDoc
pprMatchContext HsMatchContext p
ctxt
| forall p. HsMatchContext p -> Bool
want_an HsMatchContext p
ctxt = String -> SDoc
text String
"an" SDoc -> SDoc -> SDoc
<+> forall p.
(Outputable (IdP (NoGhcTc p)), UnXRec (NoGhcTc p)) =>
HsMatchContext p -> SDoc
pprMatchContextNoun HsMatchContext p
ctxt
| Bool
otherwise = String -> SDoc
text String
"a" SDoc -> SDoc -> SDoc
<+> forall p.
(Outputable (IdP (NoGhcTc p)), UnXRec (NoGhcTc p)) =>
HsMatchContext p -> SDoc
pprMatchContextNoun HsMatchContext p
ctxt
where
want_an :: HsMatchContext p -> Bool
want_an (FunRhs {}) = Bool
True
want_an (ArrowMatchCtxt HsArrowMatchContext
ProcExpr) = Bool
True
want_an (ArrowMatchCtxt HsArrowMatchContext
KappaExpr) = Bool
True
want_an HsMatchContext p
_ = Bool
False
pprMatchContextNoun :: forall p. (Outputable (IdP (NoGhcTc p)), UnXRec (NoGhcTc p))
=> HsMatchContext p -> SDoc
pprMatchContextNoun :: forall p.
(Outputable (IdP (NoGhcTc p)), UnXRec (NoGhcTc p)) =>
HsMatchContext p -> SDoc
pprMatchContextNoun (FunRhs {mc_fun :: forall p. HsMatchContext p -> LIdP (NoGhcTc p)
mc_fun=LIdP (NoGhcTc p)
fun}) = String -> SDoc
text String
"equation for"
SDoc -> SDoc -> SDoc
<+> SDoc -> SDoc
quotes (forall a. Outputable a => a -> SDoc
ppr (forall p a. UnXRec p => XRec p a -> a
unXRec @(NoGhcTc p) LIdP (NoGhcTc p)
fun))
pprMatchContextNoun HsMatchContext p
CaseAlt = String -> SDoc
text String
"case alternative"
pprMatchContextNoun (LamCaseAlt LamCaseVariant
lc_variant) = LamCaseVariant -> SDoc
lamCaseKeyword LamCaseVariant
lc_variant
SDoc -> SDoc -> SDoc
<+> String -> SDoc
text String
"alternative"
pprMatchContextNoun HsMatchContext p
IfAlt = String -> SDoc
text String
"multi-way if alternative"
pprMatchContextNoun HsMatchContext p
RecUpd = String -> SDoc
text String
"record-update construct"
pprMatchContextNoun HsMatchContext p
ThPatSplice = String -> SDoc
text String
"Template Haskell pattern splice"
pprMatchContextNoun HsMatchContext p
ThPatQuote = String -> SDoc
text String
"Template Haskell pattern quotation"
pprMatchContextNoun HsMatchContext p
PatBindRhs = String -> SDoc
text String
"pattern binding"
pprMatchContextNoun HsMatchContext p
PatBindGuards = String -> SDoc
text String
"pattern binding guards"
pprMatchContextNoun HsMatchContext p
LambdaExpr = String -> SDoc
text String
"lambda abstraction"
pprMatchContextNoun (ArrowMatchCtxt HsArrowMatchContext
c) = HsArrowMatchContext -> SDoc
pprArrowMatchContextNoun HsArrowMatchContext
c
pprMatchContextNoun (StmtCtxt HsStmtContext p
ctxt) = String -> SDoc
text String
"pattern binding in"
SDoc -> SDoc -> SDoc
$$ forall p.
(Outputable (IdP (NoGhcTc p)), UnXRec (NoGhcTc p)) =>
HsStmtContext p -> SDoc
pprAStmtContext HsStmtContext p
ctxt
pprMatchContextNoun HsMatchContext p
PatSyn = String -> SDoc
text String
"pattern synonym declaration"
pprMatchContextNouns :: forall p. (Outputable (IdP (NoGhcTc p)), UnXRec (NoGhcTc p))
=> HsMatchContext p -> SDoc
pprMatchContextNouns :: forall p.
(Outputable (IdP (NoGhcTc p)), UnXRec (NoGhcTc p)) =>
HsMatchContext p -> SDoc
pprMatchContextNouns (FunRhs {mc_fun :: forall p. HsMatchContext p -> LIdP (NoGhcTc p)
mc_fun=LIdP (NoGhcTc p)
fun}) = String -> SDoc
text String
"equations for"
SDoc -> SDoc -> SDoc
<+> SDoc -> SDoc
quotes (forall a. Outputable a => a -> SDoc
ppr (forall p a. UnXRec p => XRec p a -> a
unXRec @(NoGhcTc p) LIdP (NoGhcTc p)
fun))
pprMatchContextNouns HsMatchContext p
PatBindGuards = String -> SDoc
text String
"pattern binding guards"
pprMatchContextNouns (ArrowMatchCtxt HsArrowMatchContext
c) = HsArrowMatchContext -> SDoc
pprArrowMatchContextNouns HsArrowMatchContext
c
pprMatchContextNouns (StmtCtxt HsStmtContext p
ctxt) = String -> SDoc
text String
"pattern bindings in"
SDoc -> SDoc -> SDoc
$$ forall p.
(Outputable (IdP (NoGhcTc p)), UnXRec (NoGhcTc p)) =>
HsStmtContext p -> SDoc
pprAStmtContext HsStmtContext p
ctxt
pprMatchContextNouns HsMatchContext p
ctxt = forall p.
(Outputable (IdP (NoGhcTc p)), UnXRec (NoGhcTc p)) =>
HsMatchContext p -> SDoc
pprMatchContextNoun HsMatchContext p
ctxt SDoc -> SDoc -> SDoc
<> Char -> SDoc
char Char
's'
pprArrowMatchContextNoun :: HsArrowMatchContext -> SDoc
pprArrowMatchContextNoun :: HsArrowMatchContext -> SDoc
pprArrowMatchContextNoun HsArrowMatchContext
ProcExpr = String -> SDoc
text String
"arrow proc pattern"
pprArrowMatchContextNoun HsArrowMatchContext
ArrowCaseAlt = String -> SDoc
text String
"case alternative within arrow notation"
pprArrowMatchContextNoun (ArrowLamCaseAlt LamCaseVariant
lc_variant) = LamCaseVariant -> SDoc
lamCaseKeyword LamCaseVariant
lc_variant
SDoc -> SDoc -> SDoc
<+> String -> SDoc
text String
"alternative within arrow notation"
pprArrowMatchContextNoun HsArrowMatchContext
KappaExpr = String -> SDoc
text String
"arrow kappa abstraction"
pprArrowMatchContextNouns :: HsArrowMatchContext -> SDoc
pprArrowMatchContextNouns :: HsArrowMatchContext -> SDoc
pprArrowMatchContextNouns HsArrowMatchContext
ArrowCaseAlt = String -> SDoc
text String
"case alternatives within arrow notation"
pprArrowMatchContextNouns (ArrowLamCaseAlt LamCaseVariant
lc_variant) = LamCaseVariant -> SDoc
lamCaseKeyword LamCaseVariant
lc_variant
SDoc -> SDoc -> SDoc
<+> String -> SDoc
text String
"alternatives within arrow notation"
pprArrowMatchContextNouns HsArrowMatchContext
ctxt = HsArrowMatchContext -> SDoc
pprArrowMatchContextNoun HsArrowMatchContext
ctxt SDoc -> SDoc -> SDoc
<> Char -> SDoc
char Char
's'
pprAStmtContext, pprStmtContext :: (Outputable (IdP (NoGhcTc p)), UnXRec (NoGhcTc p))
=> HsStmtContext p -> SDoc
pprAStmtContext :: forall p.
(Outputable (IdP (NoGhcTc p)), UnXRec (NoGhcTc p)) =>
HsStmtContext p -> SDoc
pprAStmtContext (HsDoStmt HsDoFlavour
flavour) = HsDoFlavour -> SDoc
pprAHsDoFlavour HsDoFlavour
flavour
pprAStmtContext HsStmtContext p
ctxt = String -> SDoc
text String
"a" SDoc -> SDoc -> SDoc
<+> forall p.
(Outputable (IdP (NoGhcTc p)), UnXRec (NoGhcTc p)) =>
HsStmtContext p -> SDoc
pprStmtContext HsStmtContext p
ctxt
pprStmtContext :: forall p.
(Outputable (IdP (NoGhcTc p)), UnXRec (NoGhcTc p)) =>
HsStmtContext p -> SDoc
pprStmtContext (HsDoStmt HsDoFlavour
flavour) = HsDoFlavour -> SDoc
pprHsDoFlavour HsDoFlavour
flavour
pprStmtContext (PatGuard HsMatchContext p
ctxt) = String -> SDoc
text String
"pattern guard for" SDoc -> SDoc -> SDoc
$$ forall p.
(Outputable (IdP (NoGhcTc p)), UnXRec (NoGhcTc p)) =>
HsMatchContext p -> SDoc
pprMatchContext HsMatchContext p
ctxt
pprStmtContext HsStmtContext p
ArrowExpr = String -> SDoc
text String
"'do' block in an arrow command"
pprStmtContext (ParStmtCtxt HsStmtContext p
c) =
SDoc -> SDoc -> SDoc
ifPprDebug ([SDoc] -> SDoc
sep [String -> SDoc
text String
"parallel branch of", forall p.
(Outputable (IdP (NoGhcTc p)), UnXRec (NoGhcTc p)) =>
HsStmtContext p -> SDoc
pprAStmtContext HsStmtContext p
c])
(forall p.
(Outputable (IdP (NoGhcTc p)), UnXRec (NoGhcTc p)) =>
HsStmtContext p -> SDoc
pprStmtContext HsStmtContext p
c)
pprStmtContext (TransStmtCtxt HsStmtContext p
c) =
SDoc -> SDoc -> SDoc
ifPprDebug ([SDoc] -> SDoc
sep [String -> SDoc
text String
"transformed branch of", forall p.
(Outputable (IdP (NoGhcTc p)), UnXRec (NoGhcTc p)) =>
HsStmtContext p -> SDoc
pprAStmtContext HsStmtContext p
c])
(forall p.
(Outputable (IdP (NoGhcTc p)), UnXRec (NoGhcTc p)) =>
HsStmtContext p -> SDoc
pprStmtContext HsStmtContext p
c)
pprAHsDoFlavour, pprHsDoFlavour :: HsDoFlavour -> SDoc
pprAHsDoFlavour :: HsDoFlavour -> SDoc
pprAHsDoFlavour HsDoFlavour
flavour = SDoc
article SDoc -> SDoc -> SDoc
<+> HsDoFlavour -> SDoc
pprHsDoFlavour HsDoFlavour
flavour
where
pp_an :: SDoc
pp_an = String -> SDoc
text String
"an"
pp_a :: SDoc
pp_a = String -> SDoc
text String
"a"
article :: SDoc
article = case HsDoFlavour
flavour of
MDoExpr Maybe ModuleName
Nothing -> SDoc
pp_an
HsDoFlavour
GhciStmtCtxt -> SDoc
pp_an
HsDoFlavour
_ -> SDoc
pp_a
pprHsDoFlavour :: HsDoFlavour -> SDoc
pprHsDoFlavour (DoExpr Maybe ModuleName
m) = Maybe ModuleName -> SDoc -> SDoc
prependQualified Maybe ModuleName
m (String -> SDoc
text String
"'do' block")
pprHsDoFlavour (MDoExpr Maybe ModuleName
m) = Maybe ModuleName -> SDoc -> SDoc
prependQualified Maybe ModuleName
m (String -> SDoc
text String
"'mdo' block")
pprHsDoFlavour HsDoFlavour
ListComp = String -> SDoc
text String
"list comprehension"
pprHsDoFlavour HsDoFlavour
MonadComp = String -> SDoc
text String
"monad comprehension"
pprHsDoFlavour HsDoFlavour
GhciStmtCtxt = String -> SDoc
text String
"interactive GHCi command"
prependQualified :: Maybe ModuleName -> SDoc -> SDoc
prependQualified :: Maybe ModuleName -> SDoc -> SDoc
prependQualified Maybe ModuleName
Nothing SDoc
t = SDoc
t
prependQualified (Just ModuleName
_) SDoc
t = String -> SDoc
text String
"qualified" SDoc -> SDoc -> SDoc
<+> SDoc
t