{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Ormolu.Printer.Meat.Declaration.Signature
( p_sigDecl,
p_typeAscription,
p_activation,
p_standaloneKindSig,
)
where
import Control.Monad
import GHC.Data.BooleanFormula
import GHC.Hs
import GHC.Types.Basic
import GHC.Types.Fixity
import GHC.Types.Name.Reader
import GHC.Types.SourceText
import GHC.Types.SrcLoc
import Ormolu.Printer.Combinators
import Ormolu.Printer.Meat.Common
import Ormolu.Printer.Meat.Type
import Ormolu.Utils
p_sigDecl :: Sig GhcPs -> R ()
p_sigDecl :: Sig GhcPs -> R ()
p_sigDecl = \case
TypeSig XTypeSig GhcPs
_ [LIdP GhcPs]
names LHsSigWcType GhcPs
hswc -> Bool -> [LocatedN RdrName] -> LHsSigType GhcPs -> R ()
p_typeSig Bool
True [LocatedN RdrName]
[LIdP GhcPs]
names (HsWildCardBndrs GhcPs (GenLocated SrcSpanAnnA (HsSigType GhcPs))
-> GenLocated SrcSpanAnnA (HsSigType GhcPs)
forall pass thing. HsWildCardBndrs pass thing -> thing
hswc_body HsWildCardBndrs GhcPs (GenLocated SrcSpanAnnA (HsSigType GhcPs))
LHsSigWcType GhcPs
hswc)
PatSynSig XPatSynSig GhcPs
_ [LIdP GhcPs]
names LHsSigType GhcPs
sigType -> [LocatedN RdrName] -> LHsSigType GhcPs -> R ()
p_patSynSig [LocatedN RdrName]
[LIdP GhcPs]
names LHsSigType GhcPs
sigType
ClassOpSig XClassOpSig GhcPs
_ Bool
def [LIdP GhcPs]
names LHsSigType GhcPs
sigType -> Bool -> [LocatedN RdrName] -> LHsSigType GhcPs -> R ()
p_classOpSig Bool
def [LocatedN RdrName]
[LIdP GhcPs]
names LHsSigType GhcPs
sigType
FixSig XFixSig GhcPs
_ FixitySig GhcPs
sig -> FixitySig GhcPs -> R ()
p_fixSig FixitySig GhcPs
sig
InlineSig XInlineSig GhcPs
_ LIdP GhcPs
name InlinePragma
inlinePragma -> LocatedN RdrName -> InlinePragma -> R ()
p_inlineSig LocatedN RdrName
LIdP GhcPs
name InlinePragma
inlinePragma
SpecSig XSpecSig GhcPs
_ LIdP GhcPs
name [LHsSigType GhcPs]
ts InlinePragma
inlinePragma -> LocatedN RdrName -> [LHsSigType GhcPs] -> InlinePragma -> R ()
p_specSig LocatedN RdrName
LIdP GhcPs
name [LHsSigType GhcPs]
ts InlinePragma
inlinePragma
SpecInstSig XSpecInstSig GhcPs
_ SourceText
_ LHsSigType GhcPs
sigType -> LHsSigType GhcPs -> R ()
p_specInstSig LHsSigType GhcPs
sigType
MinimalSig XMinimalSig GhcPs
_ SourceText
_ LBooleanFormula (LIdP GhcPs)
booleanFormula -> LBooleanFormula (LocatedN RdrName) -> R ()
p_minimalSig LBooleanFormula (LocatedN RdrName)
LBooleanFormula (LIdP GhcPs)
booleanFormula
CompleteMatchSig XCompleteMatchSig GhcPs
_ SourceText
_sourceText XRec GhcPs [LIdP GhcPs]
cs Maybe (LIdP GhcPs)
ty -> Located [LocatedN RdrName] -> Maybe (LocatedN RdrName) -> R ()
p_completeSig Located [LocatedN RdrName]
XRec GhcPs [LIdP GhcPs]
cs Maybe (LocatedN RdrName)
Maybe (LIdP GhcPs)
ty
SCCFunSig XSCCFunSig GhcPs
_ SourceText
_ LIdP GhcPs
name Maybe (XRec GhcPs StringLiteral)
literal -> LocatedN RdrName -> Maybe (Located StringLiteral) -> R ()
p_sccSig LocatedN RdrName
LIdP GhcPs
name Maybe (Located StringLiteral)
Maybe (XRec GhcPs StringLiteral)
literal
Sig GhcPs
_ -> String -> R ()
forall a. String -> a
notImplemented String
"certain types of signature declarations"
p_typeSig ::
Bool ->
[LocatedN RdrName] ->
LHsSigType GhcPs ->
R ()
p_typeSig :: Bool -> [LocatedN RdrName] -> LHsSigType GhcPs -> R ()
p_typeSig Bool
_ [] LHsSigType GhcPs
_ = () -> R ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
p_typeSig Bool
indentTail (LocatedN RdrName
n : [LocatedN RdrName]
ns) LHsSigType GhcPs
sigType = do
LocatedN RdrName -> R ()
p_rdrName LocatedN RdrName
n
if [LocatedN RdrName] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [LocatedN RdrName]
ns
then LHsSigType GhcPs -> R ()
p_typeAscription LHsSigType GhcPs
sigType
else Bool -> R () -> R ()
inciIf Bool
indentTail (R () -> R ()) -> R () -> R ()
forall a b. (a -> b) -> a -> b
$ do
R ()
commaDel
R () -> (LocatedN RdrName -> R ()) -> [LocatedN RdrName] -> R ()
forall a. R () -> (a -> R ()) -> [a] -> R ()
sep R ()
commaDel LocatedN RdrName -> R ()
p_rdrName [LocatedN RdrName]
ns
LHsSigType GhcPs -> R ()
p_typeAscription LHsSigType GhcPs
sigType
p_typeAscription ::
LHsSigType GhcPs ->
R ()
p_typeAscription :: LHsSigType GhcPs -> R ()
p_typeAscription LHsSigType GhcPs
sigType = R () -> R ()
inci (R () -> R ()) -> R () -> R ()
forall a b. (a -> b) -> a -> b
$ do
R ()
space
Text -> R ()
txt Text
"::"
if HsType GhcPs -> Bool
hasDocStrings (GenLocated SrcSpanAnnA (HsType GhcPs) -> HsType GhcPs
forall l e. GenLocated l e -> e
unLoc (GenLocated SrcSpanAnnA (HsType GhcPs) -> HsType GhcPs)
-> (GenLocated SrcSpanAnnA (HsSigType GhcPs)
-> GenLocated SrcSpanAnnA (HsType GhcPs))
-> GenLocated SrcSpanAnnA (HsSigType GhcPs)
-> HsType GhcPs
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HsSigType GhcPs -> GenLocated SrcSpanAnnA (HsType GhcPs)
forall pass. HsSigType pass -> LHsType pass
sig_body (HsSigType GhcPs -> GenLocated SrcSpanAnnA (HsType GhcPs))
-> (GenLocated SrcSpanAnnA (HsSigType GhcPs) -> HsSigType GhcPs)
-> GenLocated SrcSpanAnnA (HsSigType GhcPs)
-> GenLocated SrcSpanAnnA (HsType GhcPs)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenLocated SrcSpanAnnA (HsSigType GhcPs) -> HsSigType GhcPs
forall l e. GenLocated l e -> e
unLoc (GenLocated SrcSpanAnnA (HsSigType GhcPs) -> HsType GhcPs)
-> GenLocated SrcSpanAnnA (HsSigType GhcPs) -> HsType GhcPs
forall a b. (a -> b) -> a -> b
$ GenLocated SrcSpanAnnA (HsSigType GhcPs)
LHsSigType GhcPs
sigType)
then R ()
newline
else R ()
breakpoint
GenLocated SrcSpanAnnA (HsSigType GhcPs)
-> (HsSigType GhcPs -> R ()) -> R ()
forall l a. HasSrcSpan l => GenLocated l a -> (a -> R ()) -> R ()
located GenLocated SrcSpanAnnA (HsSigType GhcPs)
LHsSigType GhcPs
sigType HsSigType GhcPs -> R ()
p_hsSigType
p_patSynSig ::
[LocatedN RdrName] ->
LHsSigType GhcPs ->
R ()
p_patSynSig :: [LocatedN RdrName] -> LHsSigType GhcPs -> R ()
p_patSynSig [LocatedN RdrName]
names LHsSigType GhcPs
sigType = do
Text -> R ()
txt Text
"pattern"
let body :: R ()
body = Bool -> [LocatedN RdrName] -> LHsSigType GhcPs -> R ()
p_typeSig Bool
False [LocatedN RdrName]
names LHsSigType GhcPs
sigType
if [LocatedN RdrName] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [LocatedN RdrName]
names Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> Int
1
then R ()
breakpoint R () -> R () -> R ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> R () -> R ()
inci R ()
body
else R ()
space R () -> R () -> R ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> R ()
body
p_classOpSig ::
Bool ->
[LocatedN RdrName] ->
LHsSigType GhcPs ->
R ()
p_classOpSig :: Bool -> [LocatedN RdrName] -> LHsSigType GhcPs -> R ()
p_classOpSig Bool
def [LocatedN RdrName]
names LHsSigType GhcPs
sigType = do
Bool -> R () -> R ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when Bool
def (Text -> R ()
txt Text
"default" R () -> R () -> R ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> R ()
space)
Bool -> [LocatedN RdrName] -> LHsSigType GhcPs -> R ()
p_typeSig Bool
True [LocatedN RdrName]
names LHsSigType GhcPs
sigType
p_fixSig ::
FixitySig GhcPs ->
R ()
p_fixSig :: FixitySig GhcPs -> R ()
p_fixSig = \case
FixitySig XFixitySig GhcPs
NoExtField [LIdP GhcPs]
names (Fixity SourceText
_ Int
n FixityDirection
dir) -> do
Text -> R ()
txt (Text -> R ()) -> Text -> R ()
forall a b. (a -> b) -> a -> b
$ case FixityDirection
dir of
FixityDirection
InfixL -> Text
"infixl"
FixityDirection
InfixR -> Text
"infixr"
FixityDirection
InfixN -> Text
"infix"
R ()
space
Int -> R ()
forall a. Outputable a => a -> R ()
atom Int
n
R ()
space
R () -> R ()
sitcc (R () -> R ()) -> R () -> R ()
forall a b. (a -> b) -> a -> b
$ R () -> (LocatedN RdrName -> R ()) -> [LocatedN RdrName] -> R ()
forall a. R () -> (a -> R ()) -> [a] -> R ()
sep R ()
commaDel LocatedN RdrName -> R ()
p_rdrName [LocatedN RdrName]
[LIdP GhcPs]
names
p_inlineSig ::
LocatedN RdrName ->
InlinePragma ->
R ()
p_inlineSig :: LocatedN RdrName -> InlinePragma -> R ()
p_inlineSig LocatedN RdrName
name InlinePragma {Maybe Int
SourceText
InlineSpec
RuleMatchInfo
Activation
inl_src :: InlinePragma -> SourceText
inl_sat :: InlinePragma -> Maybe Int
inl_rule :: InlinePragma -> RuleMatchInfo
inl_inline :: InlinePragma -> InlineSpec
inl_act :: InlinePragma -> Activation
inl_rule :: RuleMatchInfo
inl_act :: Activation
inl_sat :: Maybe Int
inl_inline :: InlineSpec
inl_src :: SourceText
..} = R () -> R ()
pragmaBraces (R () -> R ()) -> R () -> R ()
forall a b. (a -> b) -> a -> b
$ do
InlineSpec -> R ()
p_inlineSpec InlineSpec
inl_inline
R ()
space
case RuleMatchInfo
inl_rule of
RuleMatchInfo
ConLike -> Text -> R ()
txt Text
"CONLIKE"
RuleMatchInfo
FunLike -> () -> R ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
R ()
space
Bool -> R () -> R ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Activation
inl_act Activation -> Activation -> Bool
forall a. Eq a => a -> a -> Bool
/= Activation
NeverActive) (R () -> R ()) -> R () -> R ()
forall a b. (a -> b) -> a -> b
$ Activation -> R ()
p_activation Activation
inl_act
R ()
space
LocatedN RdrName -> R ()
p_rdrName LocatedN RdrName
name
p_specSig ::
LocatedN RdrName ->
[LHsSigType GhcPs] ->
InlinePragma ->
R ()
p_specSig :: LocatedN RdrName -> [LHsSigType GhcPs] -> InlinePragma -> R ()
p_specSig LocatedN RdrName
name [LHsSigType GhcPs]
ts InlinePragma {Maybe Int
SourceText
InlineSpec
RuleMatchInfo
Activation
inl_rule :: RuleMatchInfo
inl_act :: Activation
inl_sat :: Maybe Int
inl_inline :: InlineSpec
inl_src :: SourceText
inl_src :: InlinePragma -> SourceText
inl_sat :: InlinePragma -> Maybe Int
inl_rule :: InlinePragma -> RuleMatchInfo
inl_inline :: InlinePragma -> InlineSpec
inl_act :: InlinePragma -> Activation
..} = R () -> R ()
pragmaBraces (R () -> R ()) -> R () -> R ()
forall a b. (a -> b) -> a -> b
$ do
Text -> R ()
txt Text
"SPECIALIZE"
R ()
space
InlineSpec -> R ()
p_inlineSpec InlineSpec
inl_inline
R ()
space
Activation -> R ()
p_activation Activation
inl_act
R ()
space
LocatedN RdrName -> R ()
p_rdrName LocatedN RdrName
name
R ()
space
Text -> R ()
txt Text
"::"
R ()
breakpoint
R () -> R ()
inci (R () -> R ()) -> R () -> R ()
forall a b. (a -> b) -> a -> b
$ R ()
-> (GenLocated SrcSpanAnnA (HsSigType GhcPs) -> R ())
-> [GenLocated SrcSpanAnnA (HsSigType GhcPs)]
-> R ()
forall a. R () -> (a -> R ()) -> [a] -> R ()
sep R ()
commaDel ((HsSigType GhcPs -> R ())
-> GenLocated SrcSpanAnnA (HsSigType GhcPs) -> R ()
forall l a. HasSrcSpan l => (a -> R ()) -> GenLocated l a -> R ()
located' HsSigType GhcPs -> R ()
p_hsSigType) [GenLocated SrcSpanAnnA (HsSigType GhcPs)]
[LHsSigType GhcPs]
ts
p_inlineSpec :: InlineSpec -> R ()
p_inlineSpec :: InlineSpec -> R ()
p_inlineSpec = \case
InlineSpec
Inline -> Text -> R ()
txt Text
"INLINE"
InlineSpec
Inlinable -> Text -> R ()
txt Text
"INLINEABLE"
InlineSpec
NoInline -> Text -> R ()
txt Text
"NOINLINE"
InlineSpec
NoUserInlinePrag -> () -> R ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
p_activation :: Activation -> R ()
p_activation :: Activation -> R ()
p_activation = \case
Activation
NeverActive -> Text -> R ()
txt Text
"[~]"
Activation
AlwaysActive -> () -> R ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
ActiveBefore SourceText
_ Int
n -> do
Text -> R ()
txt Text
"[~"
Int -> R ()
forall a. Outputable a => a -> R ()
atom Int
n
Text -> R ()
txt Text
"]"
ActiveAfter SourceText
_ Int
n -> do
Text -> R ()
txt Text
"["
Int -> R ()
forall a. Outputable a => a -> R ()
atom Int
n
Text -> R ()
txt Text
"]"
Activation
FinalActive -> String -> R ()
forall a. String -> a
notImplemented String
"FinalActive"
p_specInstSig :: LHsSigType GhcPs -> R ()
p_specInstSig :: LHsSigType GhcPs -> R ()
p_specInstSig LHsSigType GhcPs
sigType =
Text -> R () -> R ()
pragma Text
"SPECIALIZE instance" (R () -> R ()) -> (R () -> R ()) -> R () -> R ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. R () -> R ()
inci (R () -> R ()) -> R () -> R ()
forall a b. (a -> b) -> a -> b
$
GenLocated SrcSpanAnnA (HsSigType GhcPs)
-> (HsSigType GhcPs -> R ()) -> R ()
forall l a. HasSrcSpan l => GenLocated l a -> (a -> R ()) -> R ()
located GenLocated SrcSpanAnnA (HsSigType GhcPs)
LHsSigType GhcPs
sigType HsSigType GhcPs -> R ()
p_hsSigType
p_minimalSig ::
LBooleanFormula (LocatedN RdrName) ->
R ()
p_minimalSig :: LBooleanFormula (LocatedN RdrName) -> R ()
p_minimalSig =
(BooleanFormula (LocatedN RdrName) -> R ())
-> LBooleanFormula (LocatedN RdrName) -> R ()
forall l a. HasSrcSpan l => (a -> R ()) -> GenLocated l a -> R ()
located' ((BooleanFormula (LocatedN RdrName) -> R ())
-> LBooleanFormula (LocatedN RdrName) -> R ())
-> (BooleanFormula (LocatedN RdrName) -> R ())
-> LBooleanFormula (LocatedN RdrName)
-> R ()
forall a b. (a -> b) -> a -> b
$ \BooleanFormula (LocatedN RdrName)
booleanFormula ->
Text -> R () -> R ()
pragma Text
"MINIMAL" (R () -> R ()
inci (R () -> R ()) -> R () -> R ()
forall a b. (a -> b) -> a -> b
$ BooleanFormula (LocatedN RdrName) -> R ()
p_booleanFormula BooleanFormula (LocatedN RdrName)
booleanFormula)
p_booleanFormula ::
BooleanFormula (LocatedN RdrName) ->
R ()
p_booleanFormula :: BooleanFormula (LocatedN RdrName) -> R ()
p_booleanFormula = \case
Var LocatedN RdrName
name -> LocatedN RdrName -> R ()
p_rdrName LocatedN RdrName
name
And [LBooleanFormula (LocatedN RdrName)]
xs ->
R () -> R ()
sitcc (R () -> R ()) -> R () -> R ()
forall a b. (a -> b) -> a -> b
$
R ()
-> (LBooleanFormula (LocatedN RdrName) -> R ())
-> [LBooleanFormula (LocatedN RdrName)]
-> R ()
forall a. R () -> (a -> R ()) -> [a] -> R ()
sep
R ()
commaDel
((BooleanFormula (LocatedN RdrName) -> R ())
-> LBooleanFormula (LocatedN RdrName) -> R ()
forall l a. HasSrcSpan l => (a -> R ()) -> GenLocated l a -> R ()
located' BooleanFormula (LocatedN RdrName) -> R ()
p_booleanFormula)
[LBooleanFormula (LocatedN RdrName)]
xs
Or [LBooleanFormula (LocatedN RdrName)]
xs ->
R () -> R ()
sitcc (R () -> R ()) -> R () -> R ()
forall a b. (a -> b) -> a -> b
$
R ()
-> (LBooleanFormula (LocatedN RdrName) -> R ())
-> [LBooleanFormula (LocatedN RdrName)]
-> R ()
forall a. R () -> (a -> R ()) -> [a] -> R ()
sep
(R ()
breakpoint R () -> R () -> R ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Text -> R ()
txt Text
"|" R () -> R () -> R ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> R ()
space)
((BooleanFormula (LocatedN RdrName) -> R ())
-> LBooleanFormula (LocatedN RdrName) -> R ()
forall l a. HasSrcSpan l => (a -> R ()) -> GenLocated l a -> R ()
located' BooleanFormula (LocatedN RdrName) -> R ()
p_booleanFormula)
[LBooleanFormula (LocatedN RdrName)]
xs
Parens LBooleanFormula (LocatedN RdrName)
l -> LBooleanFormula (LocatedN RdrName)
-> (BooleanFormula (LocatedN RdrName) -> R ()) -> R ()
forall l a. HasSrcSpan l => GenLocated l a -> (a -> R ()) -> R ()
located LBooleanFormula (LocatedN RdrName)
l (BracketStyle -> R () -> R ()
parens BracketStyle
N (R () -> R ())
-> (BooleanFormula (LocatedN RdrName) -> R ())
-> BooleanFormula (LocatedN RdrName)
-> R ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BooleanFormula (LocatedN RdrName) -> R ()
p_booleanFormula)
p_completeSig ::
Located [LocatedN RdrName] ->
Maybe (LocatedN RdrName) ->
R ()
p_completeSig :: Located [LocatedN RdrName] -> Maybe (LocatedN RdrName) -> R ()
p_completeSig Located [LocatedN RdrName]
cs' Maybe (LocatedN RdrName)
mty =
Located [LocatedN RdrName] -> ([LocatedN RdrName] -> R ()) -> R ()
forall l a. HasSrcSpan l => GenLocated l a -> (a -> R ()) -> R ()
located Located [LocatedN RdrName]
cs' (([LocatedN RdrName] -> R ()) -> R ())
-> ([LocatedN RdrName] -> R ()) -> R ()
forall a b. (a -> b) -> a -> b
$ \[LocatedN RdrName]
cs ->
Text -> R () -> R ()
pragma Text
"COMPLETE" (R () -> R ()) -> (R () -> R ()) -> R () -> R ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. R () -> R ()
inci (R () -> R ()) -> R () -> R ()
forall a b. (a -> b) -> a -> b
$ do
R () -> (LocatedN RdrName -> R ()) -> [LocatedN RdrName] -> R ()
forall a. R () -> (a -> R ()) -> [a] -> R ()
sep R ()
commaDel LocatedN RdrName -> R ()
p_rdrName [LocatedN RdrName]
cs
Maybe (LocatedN RdrName) -> (LocatedN RdrName -> R ()) -> R ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
t a -> (a -> m b) -> m ()
forM_ Maybe (LocatedN RdrName)
mty ((LocatedN RdrName -> R ()) -> R ())
-> (LocatedN RdrName -> R ()) -> R ()
forall a b. (a -> b) -> a -> b
$ \LocatedN RdrName
ty -> do
R ()
space
Text -> R ()
txt Text
"::"
R ()
breakpoint
R () -> R ()
inci (LocatedN RdrName -> R ()
p_rdrName LocatedN RdrName
ty)
p_sccSig :: LocatedN RdrName -> Maybe (Located StringLiteral) -> R ()
p_sccSig :: LocatedN RdrName -> Maybe (Located StringLiteral) -> R ()
p_sccSig LocatedN RdrName
loc Maybe (Located StringLiteral)
literal = Text -> R () -> R ()
pragma Text
"SCC" (R () -> R ()) -> (R () -> R ()) -> R () -> R ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. R () -> R ()
inci (R () -> R ()) -> R () -> R ()
forall a b. (a -> b) -> a -> b
$ do
LocatedN RdrName -> R ()
p_rdrName LocatedN RdrName
loc
Maybe (Located StringLiteral)
-> (Located StringLiteral -> R ()) -> R ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
t a -> (a -> m b) -> m ()
forM_ Maybe (Located StringLiteral)
literal ((Located StringLiteral -> R ()) -> R ())
-> (Located StringLiteral -> R ()) -> R ()
forall a b. (a -> b) -> a -> b
$ \Located StringLiteral
x -> do
R ()
breakpoint
Located StringLiteral -> R ()
forall a. Outputable a => a -> R ()
atom Located StringLiteral
x
p_standaloneKindSig :: StandaloneKindSig GhcPs -> R ()
p_standaloneKindSig :: StandaloneKindSig GhcPs -> R ()
p_standaloneKindSig (StandaloneKindSig XStandaloneKindSig GhcPs
_ LIdP GhcPs
name LHsSigType GhcPs
sigTy) = do
Text -> R ()
txt Text
"type"
R () -> R ()
inci (R () -> R ()) -> R () -> R ()
forall a b. (a -> b) -> a -> b
$ do
R ()
space
LocatedN RdrName -> R ()
p_rdrName LocatedN RdrName
LIdP GhcPs
name
R ()
space
Text -> R ()
txt Text
"::"
R ()
breakpoint
GenLocated SrcSpanAnnA (HsSigType GhcPs)
-> (HsSigType GhcPs -> R ()) -> R ()
forall l a. HasSrcSpan l => GenLocated l a -> (a -> R ()) -> R ()
located GenLocated SrcSpanAnnA (HsSigType GhcPs)
LHsSigType GhcPs
sigTy HsSigType GhcPs -> R ()
p_hsSigType