pandoc-lens 0.6.2 → 0.6.3
raw patch · 2 files changed
+23/−18 lines, 2 filesdep ~basedep ~lens
Dependency ranges changed: base, lens
Files
- Text/Pandoc/Lens.hs +17/−12
- pandoc-lens.cabal +6/−6
Text/Pandoc/Lens.hs view
@@ -51,6 +51,7 @@ , _Image , _Note , _Span+ , inlinePrePlate -- * Metadata -- | Prisms are provided for the constructors of 'MetaValue' -- as well as a 'Plated' instance.@@ -331,19 +332,23 @@ f (Span _ s) = Just s f _ = Nothing +-- | An affine traversal over the '[Inline]' in the last argument of an 'Inline' constructor+inlinePrePlate :: Traversal' Inline [Inline]+inlinePrePlate f inl =+ case inl of+ Emph cs -> Emph <$> f cs+ Strong cs -> Strong <$> f cs+ Strikeout cs -> Strikeout <$> f cs+ Superscript cs -> Superscript <$> f cs+ Subscript cs -> Subscript <$> f cs+ SmallCaps cs -> SmallCaps <$> f cs+ Quoted q cs -> Quoted q <$> f cs+ Cite cit cs -> Cite cit <$> f cs+ Span attrs cs -> Span attrs <$> f cs+ _ -> pure inl+ instance Plated Inline where- plate f inl =- case inl of- Emph cs -> Emph <$> traverseOf each f cs- Strong cs -> Strong <$> traverseOf each f cs- Strikeout cs -> Strikeout <$> traverseOf each f cs- Superscript cs -> Superscript <$> traverseOf each f cs- Subscript cs -> Subscript <$> traverseOf each f cs- SmallCaps cs -> SmallCaps <$> traverseOf each f cs- Quoted q cs -> Quoted q <$> traverseOf each f cs- Cite cit cs -> Cite cit <$> traverseOf each f cs- Span attrs cs -> Span attrs <$> traverseOf each f cs- _ -> pure inl+ plate = inlinePrePlate . each -- | A prism on a piece of 'MetaMap' metadata _MetaMap :: Prism' MetaValue (Map String MetaValue)
pandoc-lens.cabal view
@@ -1,12 +1,12 @@ name: pandoc-lens-version: 0.6.2+version: 0.6.3 synopsis: Lenses for Pandoc documents-description: Lenses for Pandoc documents+description: Lenses for Pandoc documents. homepage: http://github.com/bgamari/pandoc-lens license: BSD3 license-file: LICENSE author: Ben Gamari-maintainer: bgamari.foss@gmail.com+maintainer: ben@smart-cactus.org copyright: (c) 2014 Ben Gamari category: Text build-type: Simple@@ -19,8 +19,8 @@ library exposed-modules: Text.Pandoc.Lens ghc-options: -Wall -fno-warn-orphans- build-depends: base >=4.7 && <4.10,+ build-depends: base >=4.7 && <4.12, containers >=0.5 && <0.6,- pandoc-types >=1.16 && <1.18,- lens >=4.2 && <4.16+ pandoc-types >=1.16 && <1.20,+ lens >=4.2 && <4.17 default-language: Haskell2010