| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Language.Lsd.AST.Type
Description
LTML types.
An LTML type is value of an LTML kind, which is a Haskell type
(e.g., SectionType).
LTML types can be named, by wrapping them as (), where NamedType tt
is the specific type/kind.
A kind t can be represented as Haskell value of type .Proxy t
Synopsis
- data NamedType t = NamedType {}
- data ProperTypeMeta = ProperTypeMeta DisplayTypeName (TreeSyntax FullTypeName)
- data TreeSyntax a
- newtype HasEditableHeader = HasEditableHeader Bool
- data ChildrenOrder a
- = SequenceOrder [Disjunction a]
- | StarOrder (Disjunction a)
- class ProperNodeKind t where
- kindNameOf :: Proxy t -> KindName
- typeNameOf :: t -> TypeName
- displayTypeNameOf :: t -> DisplayTypeName
- treeSyntaxMap :: (forall t'. ProperNodeKind t' => t' -> a) -> t -> TreeSyntax a
- class RawProperNodeKind t where
- kindNameOfRaw :: Proxy t -> KindName
- treeSyntaxMapRaw :: (forall t'. ProperNodeKind t' => t' -> a) -> t -> TreeSyntax a
- fullTypeNameOf :: ProperNodeKind t => t -> FullTypeName
- properTypeMetaOf :: ProperNodeKind t => t -> ProperTypeMeta
- properTypeCollect :: (ProperNodeKind t, Ord k) => (forall t'. ProperNodeKind t' => t' -> (k, v)) -> t -> Map k v
- properTypeCollect' :: ProperNodeKind t => (forall t'. ProperNodeKind t' => t' -> v) -> t -> Map FullTypeName v
Documentation
Constructors
| NamedType | |
Fields
| |
Instances
| RawProperNodeKind t => ProperNodeKind (NamedType t) Source # | |
Defined in Language.Lsd.AST.Type Methods kindNameOf :: Proxy (NamedType t) -> KindName Source # typeNameOf :: NamedType t -> TypeName Source # displayTypeNameOf :: NamedType t -> DisplayTypeName Source # treeSyntaxMap :: (forall t'. ProperNodeKind t' => t' -> a) -> NamedType t -> TreeSyntax a Source # | |
data ProperTypeMeta Source #
Metadata on a proper (see ProperNodeKind) LTML type.
To be communicated to and used by the frontend only. Not used for
parsing; some information is duplicated in the parser.
Constructors
| ProperTypeMeta DisplayTypeName (TreeSyntax FullTypeName) |
Instances
data TreeSyntax a Source #
Syntax of an input tree (FlaggedInputTree).
This information is duplicated in the input tree parser (and, arguably,
in the LTML and LSD ASTs, the latter of which it is derived from).
Constructors
| LeafSyntax | |
| TreeSyntax HasEditableHeader (ChildrenOrder a) |
Instances
| FromJSON a => FromJSON (TreeSyntax a) Source # | |||||
Defined in Language.Lsd.AST.Type Methods parseJSON :: Value -> Parser (TreeSyntax a) parseJSONList :: Value -> Parser [TreeSyntax a] omittedField :: Maybe (TreeSyntax a) | |||||
| ToJSON a => ToJSON (TreeSyntax a) Source # | |||||
Defined in Language.Lsd.AST.Type Methods toJSON :: TreeSyntax a -> Value toEncoding :: TreeSyntax a -> Encoding toJSONList :: [TreeSyntax a] -> Value toEncodingList :: [TreeSyntax a] -> Encoding omitField :: TreeSyntax a -> Bool | |||||
| Generic (TreeSyntax a) Source # | |||||
Defined in Language.Lsd.AST.Type Associated Types
| |||||
| Show a => Show (TreeSyntax a) Source # | |||||
Defined in Language.Lsd.AST.Type Methods showsPrec :: Int -> TreeSyntax a -> ShowS # show :: TreeSyntax a -> String # showList :: [TreeSyntax a] -> ShowS # | |||||
| ToSchema a => ToSchema (TreeSyntax a) Source # | |||||
Defined in Language.Lsd.AST.Type Methods declareNamedSchema :: Proxy (TreeSyntax a) -> Declare (Definitions Schema) NamedSchema | |||||
| type Rep (TreeSyntax a) Source # | |||||
Defined in Language.Lsd.AST.Type type Rep (TreeSyntax a) = D1 ('MetaData "TreeSyntax" "Language.Lsd.AST.Type" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "LeafSyntax" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TreeSyntax" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HasEditableHeader) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ChildrenOrder a)))) | |||||
newtype HasEditableHeader Source #
Constructors
| HasEditableHeader Bool |
Instances
| FromJSON HasEditableHeader Source # | |
Defined in Language.Lsd.AST.Type Methods parseJSON :: Value -> Parser HasEditableHeader parseJSONList :: Value -> Parser [HasEditableHeader] | |
| ToJSON HasEditableHeader Source # | |
Defined in Language.Lsd.AST.Type Methods toJSON :: HasEditableHeader -> Value toEncoding :: HasEditableHeader -> Encoding toJSONList :: [HasEditableHeader] -> Value toEncodingList :: [HasEditableHeader] -> Encoding omitField :: HasEditableHeader -> Bool | |
| Show HasEditableHeader Source # | |
Defined in Language.Lsd.AST.Type Methods showsPrec :: Int -> HasEditableHeader -> ShowS # show :: HasEditableHeader -> String # showList :: [HasEditableHeader] -> ShowS # | |
| ToSchema HasEditableHeader Source # | |
Defined in Language.Lsd.AST.Type Methods declareNamedSchema :: Proxy HasEditableHeader -> Declare (Definitions Schema) NamedSchema | |
data ChildrenOrder a Source #
Information on permitted proper (see ProperNodeKind) children of proper
nodes and their order.
Constructors
| SequenceOrder [Disjunction a] | |
| StarOrder (Disjunction a) |
Instances
| FromJSON a => FromJSON (ChildrenOrder a) Source # | |||||
Defined in Language.Lsd.AST.Type Methods parseJSON :: Value -> Parser (ChildrenOrder a) parseJSONList :: Value -> Parser [ChildrenOrder a] omittedField :: Maybe (ChildrenOrder a) | |||||
| ToJSON a => ToJSON (ChildrenOrder a) Source # | |||||
Defined in Language.Lsd.AST.Type Methods toJSON :: ChildrenOrder a -> Value toEncoding :: ChildrenOrder a -> Encoding toJSONList :: [ChildrenOrder a] -> Value toEncodingList :: [ChildrenOrder a] -> Encoding omitField :: ChildrenOrder a -> Bool | |||||
| Generic (ChildrenOrder a) Source # | |||||
Defined in Language.Lsd.AST.Type Associated Types
Methods from :: ChildrenOrder a -> Rep (ChildrenOrder a) x # to :: Rep (ChildrenOrder a) x -> ChildrenOrder a # | |||||
| Show a => Show (ChildrenOrder a) Source # | |||||
Defined in Language.Lsd.AST.Type Methods showsPrec :: Int -> ChildrenOrder a -> ShowS # show :: ChildrenOrder a -> String # showList :: [ChildrenOrder a] -> ShowS # | |||||
| ToSchema a => ToSchema (ChildrenOrder a) Source # | |||||
Defined in Language.Lsd.AST.Type Methods declareNamedSchema :: Proxy (ChildrenOrder a) -> Declare (Definitions Schema) NamedSchema | |||||
| type Rep (ChildrenOrder a) Source # | |||||
Defined in Language.Lsd.AST.Type type Rep (ChildrenOrder a) = D1 ('MetaData "ChildrenOrder" "Language.Lsd.AST.Type" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "SequenceOrder" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Disjunction a])) :+: C1 ('MetaCons "StarOrder" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Disjunction a)))) | |||||
class ProperNodeKind t where Source #
A node in the LTML tree is proper iff it corresponds to a node in the
input tree (InputTree).
Methods
kindNameOf :: Proxy t -> KindName Source #
typeNameOf :: t -> TypeName Source #
displayTypeNameOf :: t -> DisplayTypeName Source #
treeSyntaxMap :: (forall t'. ProperNodeKind t' => t' -> a) -> t -> TreeSyntax a Source #
Instances
| ProperNodeKind DocumentExtroType Source # | |
Defined in Language.Lsd.AST.Type.Document Methods kindNameOf :: Proxy DocumentExtroType -> KindName Source # typeNameOf :: DocumentExtroType -> TypeName Source # displayTypeNameOf :: DocumentExtroType -> DisplayTypeName Source # treeSyntaxMap :: (forall t'. ProperNodeKind t' => t' -> a) -> DocumentExtroType -> TreeSyntax a Source # | |
| ProperNodeKind DocumentIntroType Source # | |
Defined in Language.Lsd.AST.Type.Document Methods kindNameOf :: Proxy DocumentIntroType -> KindName Source # typeNameOf :: DocumentIntroType -> TypeName Source # displayTypeNameOf :: DocumentIntroType -> DisplayTypeName Source # treeSyntaxMap :: (forall t'. ProperNodeKind t' => t' -> a) -> DocumentIntroType -> TreeSyntax a Source # | |
| RawProperNodeKind t => ProperNodeKind (NamedType t) Source # | |
Defined in Language.Lsd.AST.Type Methods kindNameOf :: Proxy (NamedType t) -> KindName Source # typeNameOf :: NamedType t -> TypeName Source # displayTypeNameOf :: NamedType t -> DisplayTypeName Source # treeSyntaxMap :: (forall t'. ProperNodeKind t' => t' -> a) -> NamedType t -> TreeSyntax a Source # | |
class RawProperNodeKind t where Source #
An LTML kind t is raw-proper iff is proper
(see NamedType tProperNodeKind).
Methods
kindNameOfRaw :: Proxy t -> KindName Source #
treeSyntaxMapRaw :: (forall t'. ProperNodeKind t' => t' -> a) -> t -> TreeSyntax a Source #
Instances
| RawProperNodeKind AppendixSectionType Source # | |
Defined in Language.Lsd.AST.Type.AppendixSection Methods kindNameOfRaw :: Proxy AppendixSectionType -> KindName Source # treeSyntaxMapRaw :: (forall t'. ProperNodeKind t' => t' -> a) -> AppendixSectionType -> TreeSyntax a Source # | |
| RawProperNodeKind DocumentMainBodyType Source # | |
Defined in Language.Lsd.AST.Type.Document Methods kindNameOfRaw :: Proxy DocumentMainBodyType -> KindName Source # treeSyntaxMapRaw :: (forall t'. ProperNodeKind t' => t' -> a) -> DocumentMainBodyType -> TreeSyntax a Source # | |
| RawProperNodeKind DocumentType Source # | |
Defined in Language.Lsd.AST.Type.Document Methods kindNameOfRaw :: Proxy DocumentType -> KindName Source # treeSyntaxMapRaw :: (forall t'. ProperNodeKind t' => t' -> a) -> DocumentType -> TreeSyntax a Source # | |
| RawProperNodeKind DocumentContainerType Source # | |
Defined in Language.Lsd.AST.Type.DocumentContainer Methods kindNameOfRaw :: Proxy DocumentContainerType -> KindName Source # treeSyntaxMapRaw :: (forall t'. ProperNodeKind t' => t' -> a) -> DocumentContainerType -> TreeSyntax a Source # | |
| RawProperNodeKind FormattedSectionType Source # | |
Defined in Language.Lsd.AST.Type.Section Methods kindNameOfRaw :: Proxy FormattedSectionType -> KindName Source # treeSyntaxMapRaw :: (forall t'. ProperNodeKind t' => t' -> a) -> FormattedSectionType -> TreeSyntax a Source # | |
fullTypeNameOf :: ProperNodeKind t => t -> FullTypeName Source #
properTypeMetaOf :: ProperNodeKind t => t -> ProperTypeMeta Source #
properTypeCollect :: (ProperNodeKind t, Ord k) => (forall t'. ProperNodeKind t' => t' -> (k, v)) -> t -> Map k v Source #
Collect information on proper (see ProperNodeKind) tree types
recursively.
This should generally be applied to roots of the type tree; that is, to
DocumentContainerTypes.
properTypeCollect' :: ProperNodeKind t => (forall t'. ProperNodeKind t' => t' -> v) -> t -> Map FullTypeName v Source #
Specialized variant of properTypeCollect.