Copyright | ©2020 James Alexander Feldman-Crough |
---|---|
License | MPL-2.0 |
Maintainer | alex@fldcr.com |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- class HasMetadata t where
- properties :: HasMetadata m => Lens' m (Set Key)
- settings :: HasMetadata m => Lens' m (Assoc Key Text)
- hasProperty :: HasMetadata m => Key -> Lens' m Bool
- atSetting :: HasMetadata m => Key -> Lens' m (Maybe Text)
- class HasContent t where
- tag :: Lens' (Tag a) Key
- fragment :: Lens' Fragment Text
- tagged :: Key -> Prism' (Tag a) (Region a)
- _BlockTag :: Prism' Block BlockTag
- _BlockLiteral :: Prism' Block LiteralTag
- _BlockParagraph :: Prism' Block Paragraph
- _InlineTag :: Prism' Inline InlineTag
- _Text :: Prism' Inline Fragment
- _Break :: Prism' Inline ()
- key :: Prism' Text Key
- _Assoc :: Iso (Assoc k v) (Assoc k' v') (HashMap k v) (HashMap k' v')
- _NonEmpty :: Prism' (Series a) (SeriesNE a)
- _Series :: Iso (Series a) (Series b) (Seq a) (Seq b)
- _SeriesNE :: Prism' (Seq a) (SeriesNE a)
- _Set :: Iso (Set a) (Set b) (HashSet a) (HashSet b)
Classy optics
Items with Metadata
class HasMetadata t where Source #
Instances
properties :: HasMetadata m => Lens' m (Set Key) Source #
Fetch all properties from items which contain metadata.
settings :: HasMetadata m => Lens' m (Assoc Key Text) Source #
Fetch all settings defined on items which contain metadata.
hasProperty :: HasMetadata m => Key -> Lens' m Bool Source #
atSetting :: HasMetadata m => Key -> Lens' m (Maybe Text) Source #
Select a setting from an item attached to metadata. Returns Nothing
if
no value is set.
Items wrapping content
class HasContent t where Source #
An optic for selecting children of an item in a recursive structure.
Instances
Accessors for fields not otherwise covered
Conversion between Tag
s and Region
s.
Prisms on Block
contexts
_BlockLiteral :: Prism' Block LiteralTag Source #
Focus only on literal tags.
_BlockParagraph :: Prism' Block Paragraph Source #
Focus only on paragraphs'
Prisms on Inline
contexts
_InlineTag :: Prism' Inline InlineTag Source #
Focus only on inline tags.
Optics on common types
_NonEmpty :: Prism' (Series a) (SeriesNE a) Source #
A prism between possibly-empty and non-empty containers.