packages feed

pandoc-lens 0.6.3 → 0.7.0

raw patch · 2 files changed

+29/−27 lines, 2 filesdep +textdep ~basedep ~containersdep ~lensPVP ok

version bump matches the API change (PVP)

Dependencies added: text

Dependency ranges changed: base, containers, lens, pandoc-types

API changes (from Hackage documentation)

- Text.Pandoc.Lens: _Code :: Prism' Inline String
+ Text.Pandoc.Lens: _Code :: Prism' Inline Text
- Text.Pandoc.Lens: _CodeBlock :: Prism' Block String
+ Text.Pandoc.Lens: _CodeBlock :: Prism' Block Text
- Text.Pandoc.Lens: _Math :: Prism' Inline (MathType, String)
+ Text.Pandoc.Lens: _Math :: Prism' Inline (MathType, Text)
- Text.Pandoc.Lens: _MetaMap :: Prism' MetaValue (Map String MetaValue)
+ Text.Pandoc.Lens: _MetaMap :: Prism' MetaValue (Map Text MetaValue)
- Text.Pandoc.Lens: _MetaString :: Prism' MetaValue String
+ Text.Pandoc.Lens: _MetaString :: Prism' MetaValue Text
- Text.Pandoc.Lens: _RawInline :: Prism' Inline (Format, String)
+ Text.Pandoc.Lens: _RawInline :: Prism' Inline (Format, Text)
- Text.Pandoc.Lens: _Str :: Prism' Inline String
+ Text.Pandoc.Lens: _Str :: Prism' Inline Text
- Text.Pandoc.Lens: attrClasses :: Lens' Attr [String]
+ Text.Pandoc.Lens: attrClasses :: Lens' Attr [Text]
- Text.Pandoc.Lens: attrIdentifier :: Lens' Attr String
+ Text.Pandoc.Lens: attrIdentifier :: Lens' Attr Text
- Text.Pandoc.Lens: attrs :: Lens' Attr [(String, String)]
+ Text.Pandoc.Lens: attrs :: Lens' Attr [(Text, Text)]
- Text.Pandoc.Lens: data Block :: *
+ Text.Pandoc.Lens: data Block
- Text.Pandoc.Lens: data Inline :: *
+ Text.Pandoc.Lens: data Inline
- Text.Pandoc.Lens: data MetaValue :: *
+ Text.Pandoc.Lens: data MetaValue
- Text.Pandoc.Lens: data Pandoc :: *
+ Text.Pandoc.Lens: data Pandoc
- Text.Pandoc.Lens: meta :: String -> Traversal' Pandoc MetaValue
+ Text.Pandoc.Lens: meta :: Text -> Traversal' Pandoc MetaValue

Files

Text/Pandoc/Lens.hs view
@@ -69,27 +69,27 @@     , attrs     ) where -import Control.Applicative import Control.Lens import Text.Pandoc.Definition import Data.Map (Map)+import Data.Text (Text)  -- | The body of a pandoc document body :: Lens' Pandoc [Block] body = lens (\(Pandoc _ b)->b) (\(Pandoc m _) b->Pandoc m b)  -- | A traversal focusing on a particular metadata value of a document-meta :: String -> Traversal' Pandoc MetaValue+meta :: Text -> Traversal' Pandoc MetaValue meta name = metaL . _Wrapped' . ix name   where     metaL :: Lens' Pandoc Meta     metaL = lens (\(Pandoc m _)->m) (\(Pandoc _ a) m->Pandoc m a)  instance Wrapped Meta where-    type Unwrapped Meta = Map String MetaValue+    type Unwrapped Meta = Map Text MetaValue     _Wrapped' = iso unMeta Meta -type instance Index Meta = String+type instance Index Meta = Text type instance IxValue Meta = MetaValue  instance Ixed Meta where@@ -113,7 +113,7 @@     f _         = Nothing  -- | A prism on the text of a 'CodeBlock'-_CodeBlock :: Prism' Block String+_CodeBlock :: Prism' Block Text _CodeBlock = prism' (CodeBlock nullAttr) f   where     f (CodeBlock _ x)    = Just x@@ -185,14 +185,14 @@ instance Plated Block where     plate f blk =       case blk of-        BlockQuote blks        -> BlockQuote <$> traverse f blks-        OrderedList attrs blks -> OrderedList attrs <$> traverseOf (each . each) f blks-        BulletList blks        -> BulletList <$> traverseOf (each . each) f blks-        DefinitionList blks    -> DefinitionList <$> traverseOf (each . _2 . each . each) f blks-        Table a b c hdrs rows  -> Table a b c <$> traverseOf (each . each) f hdrs+        BlockQuote blks         -> BlockQuote <$> traverse f blks+        OrderedList attrs' blks -> OrderedList attrs' <$> traverseOf (each . each) f blks+        BulletList blks         -> BulletList <$> traverseOf (each . each) f blks+        DefinitionList blks     -> DefinitionList <$> traverseOf (each . _2 . each . each) f blks+        Table a b c hdrs rows   -> Table a b c <$> traverseOf (each . each) f hdrs                                               <*> traverseOf (each . each . each) f rows-        Div attrs blks         -> Div attrs <$> traverseOf each f blks-        _                      -> pure blk+        Div attrs' blks         -> Div attrs' <$> traverseOf each f blks+        _                       -> pure blk  -- | Traverse over the 'Inline' children of a 'Block' blockInlines :: Traversal' Block Inline@@ -207,7 +207,7 @@       _                  -> pure blk  -- | A prism on a 'Str' 'Inline'-_Str :: Prism' Inline String+_Str :: Prism' Inline Text _Str = prism' Str f   where     f (Str s) = Just s@@ -270,7 +270,7 @@     f _           = Nothing  -- | A prism on the body of a 'Code' 'Inline'-_Code :: Prism' Inline String+_Code :: Prism' Inline Text _Code = prism' (Code nullAttr) f   where     f (Code _ s) = Just s@@ -291,14 +291,14 @@     f _         = Nothing  -- | A prism on a 'Math' 'Inline'-_Math :: Prism' Inline (MathType, String)+_Math :: Prism' Inline (MathType, Text) _Math = prism' (uncurry Math) f   where     f (Math a b) = Just (a, b)     f _          = Nothing  -- | A prism on a 'RawInline' 'Inline'-_RawInline :: Prism' Inline (Format, String)+_RawInline :: Prism' Inline (Format, Text) _RawInline = prism' (uncurry RawInline) f   where     f (RawInline a b) = Just (a, b)@@ -344,14 +344,14 @@     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+    Span attrs' cs -> Span attrs' <$> f cs     _              -> pure inl  instance Plated Inline where     plate = inlinePrePlate . each  -- | A prism on a piece of 'MetaMap' metadata-_MetaMap :: Prism' MetaValue (Map String MetaValue)+_MetaMap :: Prism' MetaValue (Map Text MetaValue) _MetaMap = prism' MetaMap f   where     f (MetaMap x) = Just x@@ -372,7 +372,7 @@     f _            = Nothing  -- | A prism on a piece of 'MetaString' metadata-_MetaString :: Prism' MetaValue String+_MetaString :: Prism' MetaValue Text _MetaString = prism' MetaString f   where     f (MetaString x) = Just x@@ -416,13 +416,13 @@     attributes _ x = pure x  -- | A lens onto identifier of an 'Attr'-attrIdentifier :: Lens' Attr String+attrIdentifier :: Lens' Attr Text attrIdentifier = _1  -- | A lens onto classes of an 'Attr'-attrClasses :: Lens' Attr [String]+attrClasses :: Lens' Attr [Text] attrClasses = _2  -- | A lens onto the key-value pairs of an 'Attr'-attrs :: Lens' Attr [(String, String)]+attrs :: Lens' Attr [(Text, Text)] attrs = _3
pandoc-lens.cabal view
@@ -1,5 +1,5 @@ name:                pandoc-lens-version:             0.6.3+version:             0.7.0 synopsis:            Lenses for Pandoc documents description:         Lenses for Pandoc documents. homepage:            http://github.com/bgamari/pandoc-lens@@ -11,6 +11,7 @@ category:            Text build-type:          Simple cabal-version:       >=1.10+tested-with:         GHC==8.8.1, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2  source-repository head   type:                git@@ -19,8 +20,9 @@ library   exposed-modules:     Text.Pandoc.Lens   ghc-options:         -Wall -fno-warn-orphans-  build-depends:       base >=4.7 && <4.12,-                       containers >=0.5 && <0.6,-                       pandoc-types >=1.16 && <1.20,-                       lens >=4.2 && <4.17+  build-depends:       base >=4.7 && <4.15,+                       containers >=0.5 && <0.7,+                       pandoc-types >=1.20 && <1.21,+                       lens >=4.2 && <4.20,+                       text   default-language:    Haskell2010