| License | AGPL-3 |
|---|---|
| Maintainer | stu235271@mail.uni-kiel.de stu236925@mail.uni-kiel.de |
| Safe Haskell | None |
| Language | Haskell2010 |
Docs.Tree
Description
This module contains the definition of the tree structure of a Document.
Synopsis
- data Tree a
- data Node a = Node {
- header :: NodeHeader
- children :: [Tree a]
- data NodeHeader = NodeHeader {
- headerKind :: Text
- headerType :: Text
- heading :: Maybe Text
- data WithTitle a = WithTitle {}
- treeMapM :: Monad m => (a -> m b) -> Node a -> m (Node b)
- withTextRevisions :: Monad m => (TextElementID -> m (Maybe TextRevision)) -> Node TextElement -> m (Node TextElementRevision)
- filterMapNode :: (a -> Maybe b) -> Node a -> Node b
Documentation
A tree. Either a tree or a leaf.
Instances
| Foldable Tree Source # | |
Defined in Docs.Tree Methods fold :: Monoid m => Tree m -> m # foldMap :: Monoid m => (a -> m) -> Tree a -> m # foldMap' :: Monoid m => (a -> m) -> Tree a -> m # foldr :: (a -> b -> b) -> b -> Tree a -> b # foldr' :: (a -> b -> b) -> b -> Tree a -> b # foldl :: (b -> a -> b) -> b -> Tree a -> b # foldl' :: (b -> a -> b) -> b -> Tree a -> b # foldr1 :: (a -> a -> a) -> Tree a -> a # foldl1 :: (a -> a -> a) -> Tree a -> a # elem :: Eq a => a -> Tree a -> Bool # maximum :: Ord a => Tree a -> a # | |
| Traversable Tree Source # | |
| Functor Tree Source # | |
| FromJSON a => FromJSON (Tree a) Source # | |
Defined in Docs.Tree Methods parseJSON :: Value -> Parser (Tree a) parseJSONList :: Value -> Parser [Tree a] omittedField :: Maybe (Tree a) | |
| ToJSON a => ToJSON (Tree a) Source # | |
Defined in Docs.Tree Methods toEncoding :: Tree a -> Encoding toJSONList :: [Tree a] -> Value toEncodingList :: [Tree a] -> Encoding | |
| ToSchema a => ToSchema (Tree a) Source # | |
Defined in Docs.Tree Methods declareNamedSchema :: Proxy (Tree a) -> Declare (Definitions Schema) NamedSchema | |
A node of a tree.
Constructors
| Node | |
Fields
| |
Instances
| Foldable Node Source # | |||||
Defined in Docs.Tree Methods fold :: Monoid m => Node m -> m # foldMap :: Monoid m => (a -> m) -> Node a -> m # foldMap' :: Monoid m => (a -> m) -> Node a -> m # foldr :: (a -> b -> b) -> b -> Node a -> b # foldr' :: (a -> b -> b) -> b -> Node a -> b # foldl :: (b -> a -> b) -> b -> Node a -> b # foldl' :: (b -> a -> b) -> b -> Node a -> b # foldr1 :: (a -> a -> a) -> Node a -> a # foldl1 :: (a -> a -> a) -> Node a -> a # elem :: Eq a => a -> Node a -> Bool # maximum :: Ord a => Node a -> a # | |||||
| Traversable Node Source # | |||||
| Functor Node Source # | |||||
| FromJSON a => FromJSON (Node a) Source # | |||||
Defined in Docs.Tree Methods parseJSON :: Value -> Parser (Node a) parseJSONList :: Value -> Parser [Node a] omittedField :: Maybe (Node a) | |||||
| ToJSON a => ToJSON (Node a) Source # | |||||
Defined in Docs.Tree Methods toEncoding :: Node a -> Encoding toJSONList :: [Node a] -> Value toEncodingList :: [Node a] -> Encoding | |||||
| Generic (Node a) Source # | |||||
Defined in Docs.Tree Associated Types
| |||||
| ToSchema a => ToSchema (Node a) Source # | |||||
Defined in Docs.Tree Methods declareNamedSchema :: Proxy (Node a) -> Declare (Definitions Schema) NamedSchema | |||||
| type Rep (Node a) Source # | |||||
Defined in Docs.Tree type Rep (Node a) = D1 ('MetaData "Node" "Docs.Tree" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "Node" 'PrefixI 'True) (S1 ('MetaSel ('Just "header") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NodeHeader) :*: S1 ('MetaSel ('Just "children") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Tree a]))) | |||||
data NodeHeader Source #
Contains metdata for a tree node.
Constructors
| NodeHeader | |
Fields
| |
Instances
Wrapper type to add a title to an element.
Instances
| FromJSON a => FromJSON (WithTitle a) Source # | |||||
Defined in Docs.Tree Methods parseJSON :: Value -> Parser (WithTitle a) parseJSONList :: Value -> Parser [WithTitle a] omittedField :: Maybe (WithTitle a) | |||||
| ToJSON a => ToJSON (WithTitle a) Source # | |||||
Defined in Docs.Tree Methods toJSON :: WithTitle a -> Value toEncoding :: WithTitle a -> Encoding toJSONList :: [WithTitle a] -> Value toEncodingList :: [WithTitle a] -> Encoding | |||||
| Generic (WithTitle a) Source # | |||||
Defined in Docs.Tree Associated Types
| |||||
| ToSchema a => ToSchema (WithTitle a) Source # | |||||
Defined in Docs.Tree Methods declareNamedSchema :: Proxy (WithTitle a) -> Declare (Definitions Schema) NamedSchema | |||||
| type Rep (WithTitle a) Source # | |||||
Defined in Docs.Tree type Rep (WithTitle a) = D1 ('MetaData "WithTitle" "Docs.Tree" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "WithTitle" 'PrefixI 'True) (S1 ('MetaSel ('Just "title") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "content") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) | |||||
Arguments
| :: Monad m | |
| => (TextElementID -> m (Maybe TextRevision)) | (potentially effectful) function for obtaining a text revision |
| -> Node TextElement | document structure tree |
| -> m (Node TextElementRevision) | document structure tree with concrete text revisions |
Takes a tree and emplaces concrete text revision. | The text revions are obtained via the specified getter function.