git.iko.soy/typeable/dom-parser
on cdcd5ba help sign in
11 files changed+26−97
since splitsnapshots
unifiedsplit
.travis.yml+5−7 CHANGELOG.md−20 dom-parser.cabal+4−8 ghc-802.yaml+3 ghc-821.yaml+3 ghc-963.yaml−7 src/Text/XML/DOM/Parser/Combinators.hs+1 src/Text/XML/DOM/Parser/Content.hs+3−4 src/Text/XML/DOM/Parser/Types.hs+4−4 src/Text/XML/Soap.hs−46 stack.yaml+3−1
.travis.yml+5−7
@@ -4,12 +4,6 @@ sudo: false
44# Do not choose a language; we provide our own build tools.
55language: generic
66
7−env:
8− - STACK_YAML=stack.yaml
9− - STACK_YAML=ghc-802.yaml
10− - STACK_YAML=ghc-822.yaml
11− - STACK_YAML=ghc-841.yaml
12−
137# Caching so the next build will be fast too.
148cache:
159 directories:
@@ -27,6 +21,10 @@ before_install:
2721- export PATH=$HOME/.local/bin:$PATH
2822- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
2923
24+install:
25+# Build dependencies
26+- stack --no-terminal --install-ghc build --only-dependencies
27+
3028script:
3129# Build the package, its tests, and its docs and run the tests
32−- stack --no-terminal --install-ghc test --haddock --no-haddock-deps
30+- stack --no-terminal test --haddock --no-haddock-deps
CHANGELOG.md−20
@@ -1,25 +1,5 @@
11# CHANGELOG
22
3−## HEAD
4−
5−## 3.2.0
6−
7−### Added
8−
9−* Text.XML.Soap module with XmlEnvelope stuff in it.
10−* GHC 9 compatibility.
11−
12−### Removed
13−
14−* Old stackage files.
15−
16−## 3.1.0
17−
18−### Added
19−
20−* Additional builds with GHC 8.0.2 and 8.2.1
21−* Compatibility with GHC 8.4.1
22−
233## 3.0.0
244
255* GHC 8 compatible release
dom-parser.cabal+4−8
@@ -1,5 +1,5 @@
11name: dom-parser
2−version: 3.2.0
2+version: 3.0.0
33synopsis: Simple monadic DOM parser
44license: MIT
55license-file: LICENSE
@@ -9,9 +9,6 @@ category: XML
99build-type: Simple
1010cabal-version: >=1.10
1111homepage: https://github.com/typeable/dom-parser
12−tested-with: GHC == 9.2.7
13− , GHC == 9.4.8
14− , GHC == 9.6.3
1512extra-source-files: CHANGELOG.md
1613 , README.md
1714
@@ -44,16 +41,16 @@ library
4441 , TypeFamilies
4542 , TypeOperators
4643 , UndecidableInstances
47− build-depends: base >= 4.11 && < 5
44+ build-depends: base >= 4.7 && < 5
4845 , case-insensitive
4946 , containers
5047 , lens
51− , mtl < 2.3 || > 2.3
48+ , mtl
5249 , scientific
50+ , semigroups
5351 , text
5452 , transformers
5553 , xml-conduit
56− , xml-conduit-writer
5754 , xml-lens
5855 exposed-modules: Text.XML.DOM.Parser
5956 , Text.XML.DOM.Parser.Attributes
@@ -63,7 +60,6 @@ library
6360 , Text.XML.DOM.Parser.FromAttribute
6461 , Text.XML.DOM.Parser.FromDom
6562 , Text.XML.DOM.Parser.Types
66− , Text.XML.Soap
6763
6864test-suite test
6965 type: exitcode-stdio-1.0
ghc-802.yamlnew file+3
@@ -0,0 +1,3 @@
1+resolver: lts-9.0
2+packages:
3+ - .
ghc-821.yamlnew file+3
@@ -0,0 +1,3 @@
1+resolver: nightly-2017-09-14
2+packages:
3+ - .
ghc-963.yamldeleted−7
@@ -1,7 +0,0 @@
1−resolver: lts-22.6
2−
3−extra-deps:
4− - xml-conduit-writer-0.1.1.5
5−
6−nix:
7− packages: [zlib]
src/Text/XML/DOM/Parser/Combinators.hs+1
@@ -22,6 +22,7 @@ import Control.Monad.Reader
2222import Data.Foldable as F
2323import Data.List as L
2424import Data.List.NonEmpty (NonEmpty(..))
25+import Data.Monoid
2526import Data.Text as T
2627import Data.Traversable
2728import Text.XML
src/Text/XML/DOM/Parser/Content.hs+3−4
@@ -20,7 +20,6 @@ import Data.List as L
2020import Data.Monoid
2121import Data.Text as T
2222import Data.Typeable
23−import Prelude as P
2423import Text.Read
2524import Text.XML.DOM.Parser.Types
2625import Text.XML.Lens
@@ -94,7 +93,7 @@ maybeReadContent
9493maybeReadContent f t = maybe (Left msg) Right $ f t
9594 where
9695 msg = "Not readable " <> n <> ": " <> t
97− n = T.pack $ P.show $ typeRep (Proxy :: Proxy a)
96+ n = T.pack $ show $ typeRep (Proxy :: Proxy a)
9897
9998
10099-- | Tries to read given text to value using 'Read'. Useful to use
@@ -115,8 +114,8 @@ readBool t =
115114 tvals = ["y", "yes", "t", "true", "1"]
116115 fvals = ["n", "no", "f", "false", "0"]
117116 in if
118− | lowt `L.elem` tvals -> Right True
119− | lowt `L.elem` fvals -> Right False
117+ | lowt `elem` tvals -> Right True
118+ | lowt `elem` fvals -> Right False
120119 | otherwise ->
121120 Left $ "Could not read " <> t <> " as Bool"
122121
src/Text/XML/DOM/Parser/Types.hs+4−4
@@ -88,6 +88,8 @@ data NameMatcher = NameMatcher
8888 -- ^ Field for 'Show' instance and bulding usefull errors
8989 }
9090
91+makeLenses ''NameMatcher
92+
9193-- | Instance use 'matchCILocalName' as most general and liberal
9294-- matching strategy (while XML is often malformed).
9395--
@@ -119,8 +121,6 @@ matchCILocalName tname = NameMatcher
119121 , _nmShow = tname
120122 }
121123
122−makeLenses ''NameMatcher
123−
124124-- | Makes matcher which match name by 'Eq' with given
125125--
126126-- @since 2.0.0
@@ -134,7 +134,7 @@ matchName n = NameMatcher
134134-- element of the document. Errors are much more usefull with path.
135135newtype DomPath = DomPath
136136 { unDomPath :: [Text]
137− } deriving (Eq, Ord, Show, Semigroup, Monoid)
137+ } deriving (Eq, Ord, Show, Monoid)
138138
139139-- | DOM parser error description.
140140data ParserError
@@ -184,7 +184,7 @@ instance Exception ParserError
184184
185185newtype ParserErrors = ParserErrors
186186 { unParserErrors :: [ParserError]
187− } deriving (Show, Semigroup, Monoid, Generic)
187+ } deriving (Show, Monoid, Generic)
188188
189189makePrisms ''ParserErrors
190190
src/Text/XML/Soap.hsdeleted−46
@@ -1,46 +0,0 @@
1−module Text.XML.Soap where
2−
3−import Control.Lens
4−import Data.String
5−import Text.XML
6−import Text.XML.DOM.Parser
7−import Text.XML.Writer
8−
9−data XmlEnvelope h b = XmlEnvelope
10− { _xeHeader :: !(Maybe h)
11− , _xeBody :: !(Maybe b)
12− } deriving (Eq, Show)
13−
14−makeLenses ''XmlEnvelope
15−
16−xmlEnvelopeToDocument :: (ToXML h, ToXML b) => XmlEnvelope h b -> Document
17−xmlEnvelopeToDocument xe = doc
18− where
19− sname n = fromString $ "{http://schemas.xmlsoap.org/soap/envelope/}" <> n
20− doc =
21− Document
22− { documentPrologue = Prologue [] Nothing []
23− , documentRoot =
24− Element
25− { elementName = sname "Envelope"
26− , elementAttributes = mempty
27− , elementNodes = [NodeElement header, NodeElement body]
28− }
29− , documentEpilogue = []
30− }
31− header =
32− Element
33− { elementName = sname "Header"
34− , elementAttributes = mempty
35− , elementNodes = render . toXML $ xe ^. xeHeader
36− }
37− body =
38− Element
39− { elementName = sname "Body"
40− , elementAttributes = mempty
41− , elementNodes = render . toXML $ xe ^. xeBody
42− }
43−
44−instance (FromDom h, FromDom b) => FromDom (XmlEnvelope h b) where
45− fromDom = XmlEnvelope <$> inElemMay "Header" fromDom
46− <*> inElemMay "Body" fromDom
stack.yamlmode 120000 → 100644+3−1
@@ -1 +0,0 @@
1−ghc-963.yaml
@@ -0,0 +1,3 @@
1+resolver: lts-6.35
2+packages:
3+ - .