backend-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

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 (NamedType t), where t is the specific type/kind.

A kind t can be represented as Haskell value of type Proxy t.

Synopsis

Documentation

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.

Instances

Instances details
FromJSON ProperTypeMeta Source # 
Instance details

Defined in Language.Lsd.AST.Type

Methods

parseJSON :: Value -> Parser ProperTypeMeta

parseJSONList :: Value -> Parser [ProperTypeMeta]

omittedField :: Maybe ProperTypeMeta

ToJSON ProperTypeMeta Source # 
Instance details

Defined in Language.Lsd.AST.Type

Generic ProperTypeMeta Source # 
Instance details

Defined in Language.Lsd.AST.Type

Associated Types

type Rep ProperTypeMeta 
Instance details

Defined in Language.Lsd.AST.Type

type Rep ProperTypeMeta = D1 ('MetaData "ProperTypeMeta" "Language.Lsd.AST.Type" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "ProperTypeMeta" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DisplayTypeName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TreeSyntax FullTypeName))))
Show ProperTypeMeta Source # 
Instance details

Defined in Language.Lsd.AST.Type

ToSchema ProperTypeMeta Source # 
Instance details

Defined in Language.Lsd.AST.Type

Methods

declareNamedSchema :: Proxy ProperTypeMeta -> Declare (Definitions Schema) NamedSchema

type Rep ProperTypeMeta Source # 
Instance details

Defined in Language.Lsd.AST.Type

type Rep ProperTypeMeta = D1 ('MetaData "ProperTypeMeta" "Language.Lsd.AST.Type" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "ProperTypeMeta" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DisplayTypeName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TreeSyntax FullTypeName))))

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).

Instances

Instances details
FromJSON a => FromJSON (TreeSyntax a) Source # 
Instance details

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 # 
Instance details

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 # 
Instance details

Defined in Language.Lsd.AST.Type

Associated Types

type Rep (TreeSyntax a) 
Instance details

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))))

Methods

from :: TreeSyntax a -> Rep (TreeSyntax a) x #

to :: Rep (TreeSyntax a) x -> TreeSyntax a #

Show a => Show (TreeSyntax a) Source # 
Instance details

Defined in Language.Lsd.AST.Type

ToSchema a => ToSchema (TreeSyntax a) Source # 
Instance details

Defined in Language.Lsd.AST.Type

Methods

declareNamedSchema :: Proxy (TreeSyntax a) -> Declare (Definitions Schema) NamedSchema

type Rep (TreeSyntax a) Source # 
Instance details

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

Instances details
FromJSON HasEditableHeader Source # 
Instance details

Defined in Language.Lsd.AST.Type

ToJSON HasEditableHeader Source # 
Instance details

Defined in Language.Lsd.AST.Type

Show HasEditableHeader Source # 
Instance details

Defined in Language.Lsd.AST.Type

ToSchema HasEditableHeader Source # 
Instance details

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.

Instances

Instances details
FromJSON a => FromJSON (ChildrenOrder a) Source # 
Instance details

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 # 
Instance details

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 # 
Instance details

Defined in Language.Lsd.AST.Type

Associated Types

type Rep (ChildrenOrder a) 
Instance details

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))))
Show a => Show (ChildrenOrder a) Source # 
Instance details

Defined in Language.Lsd.AST.Type

ToSchema a => ToSchema (ChildrenOrder a) Source # 
Instance details

Defined in Language.Lsd.AST.Type

Methods

declareNamedSchema :: Proxy (ChildrenOrder a) -> Declare (Definitions Schema) NamedSchema

type Rep (ChildrenOrder a) Source # 
Instance details

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).

class RawProperNodeKind t where Source #

An LTML kind t is raw-proper iff NamedType t is proper (see ProperNodeKind).

Methods

kindNameOfRaw :: Proxy t -> KindName Source #

treeSyntaxMapRaw :: (forall t'. ProperNodeKind t' => t' -> a) -> t -> TreeSyntax a 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.