hexpat-lens 0.0.2 → 0.0.3
raw patch · 3 files changed
+35/−3 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- hexpat-lens.cabal +3/−2
- src/Text/XML/Expat/Lens.hs +24/−0
- src/Text/XML/Expat/Lens/Parse.hs +8/−1
hexpat-lens.cabal view
@@ -1,5 +1,5 @@ name: hexpat-lens-version: 0.0.2+version: 0.0.3 synopsis: Lenses for Hexpat. license: MIT license-file: LICENSE@@ -11,7 +11,8 @@ cabal-version: >=1.10 library- exposed-modules: + exposed-modules:+ Text.XML.Expat.Lens Text.XML.Expat.Lens.Unqualified Text.XML.Expat.Lens.Parse Text.XML.Expat.Lens.Names
+ src/Text/XML/Expat/Lens.hs view
@@ -0,0 +1,24 @@++-- |+-- Module : Text.XML.Expat.Lens+-- Copyright : (c) 2013, Joseph Abrahamson+-- License : MIT+-- +-- Maintainer : me@jspha.com+-- Stability : experimental+-- Portability : non-portable+-- +-- A simple Hexpat lens module. Right now this only re-exports lenses+-- on Hexpat 'UName's. In the future it may be better to export the+-- general API in this module.++module Text.XML.Expat.Lens (++ module Text.XML.Expat.Lens.Unqualified,+ module Text.XML.Expat.Lens.Parse+ + ) where++import Text.XML.Expat.Tree+import Text.XML.Expat.Lens.Unqualified+import Text.XML.Expat.Lens.Parse
src/Text/XML/Expat/Lens/Parse.hs view
@@ -43,6 +43,9 @@ -- | Uses "tag soup" parsing to build a 'UNode' tree. Technically a -- retract, since @_HTML@ tries very hard to return *something*, we -- get an 'Iso' instead of a 'Prism'.+-- +-- prop> view (from _HTML . _HTML) = id+-- _HTML :: (GenericXMLString text) => Iso' S.ByteString (UNode text) _HTML = _HTMLWithOptions TS.parseOptions@@ -52,6 +55,9 @@ -- retract, since @_HTML@ tries very hard to return *something*, we -- get an 'Iso' instead of a 'Prism'. Uses the *fast* tag soup parsing -- options.+-- +-- prop> view (from _HTML' . _HTML') = id+-- _HTML' :: (GenericXMLString text) => Iso' S.ByteString (UNode text) _HTML' = _HTMLWithOptions TS.parseOptions@@ -59,6 +65,7 @@ -- | Like '_HTML but allows choice of 'TS.ParseOptions'. _HTMLWithOptions- :: (GenericXMLString text) => TS.ParseOptions S.ByteString -> Iso' S.ByteString (UNode text)+ :: (GenericXMLString text) =>+ TS.ParseOptions S.ByteString -> Iso' S.ByteString (UNode text) _HTMLWithOptions opts = iso (parseTagsOptions opts) format' {-# INLINE _HTMLWithOptions #-}