git.iko.soy/typeable/dom-parser
on cdcd5ba help sign in
.travis.yml+5−7
since splitsnapshots
unifiedsplit
@@ -4,12 +4,6 @@ sudo: false
4# Do not choose a language; we provide our own build tools.
4# Do not choose a language; we provide our own build tools.
5language: generic
5language: generic
6
6
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−
13# Caching so the next build will be fast too.
7# Caching so the next build will be fast too.
14cache:
8cache:
15 directories:
9 directories:
@@ -27,6 +21,10 @@ before_install:
27- export PATH=$HOME/.local/bin:$PATH
21- export PATH=$HOME/.local/bin:$PATH
28- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
22- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
29
23
24+install:
25+# Build dependencies
26+- stack --no-terminal --install-ghc build --only-dependencies
27+
30script:
28script:
31# Build the package, its tests, and its docs and run the tests
29# 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 @@
1# CHANGELOG
1# CHANGELOG
2
2
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−
23## 3.0.0
3## 3.0.0
24
4
25* GHC 8 compatible release
5* GHC 8 compatible release
dom-parser.cabal+4−8
@@ -1,5 +1,5 @@
1name: dom-parser
1name: dom-parser
2−version: 3.2.0
2+version: 3.0.0
3synopsis: Simple monadic DOM parser
3synopsis: Simple monadic DOM parser
4license: MIT
4license: MIT
5license-file: LICENSE
5license-file: LICENSE
@@ -9,9 +9,6 @@ category: XML
9build-type: Simple
9build-type: Simple
10cabal-version: >=1.10
10cabal-version: >=1.10
11homepage: https://github.com/typeable/dom-parser
11homepage: https://github.com/typeable/dom-parser
12−tested-with: GHC == 9.2.7
13− , GHC == 9.4.8
14− , GHC == 9.6.3
15extra-source-files: CHANGELOG.md
12extra-source-files: CHANGELOG.md
16 , README.md
13 , README.md
17
14
@@ -44,16 +41,16 @@ library
44 , TypeFamilies
41 , TypeFamilies
45 , TypeOperators
42 , TypeOperators
46 , UndecidableInstances
43 , UndecidableInstances
47− build-depends: base >= 4.11 && < 5
44+ build-depends: base >= 4.7 && < 5
48 , case-insensitive
45 , case-insensitive
49 , containers
46 , containers
50 , lens
47 , lens
51− , mtl < 2.3 || > 2.3
48+ , mtl
52 , scientific
49 , scientific
50+ , semigroups
53 , text
51 , text
54 , transformers
52 , transformers
55 , xml-conduit
53 , xml-conduit
56− , xml-conduit-writer
57 , xml-lens
54 , xml-lens
58 exposed-modules: Text.XML.DOM.Parser
55 exposed-modules: Text.XML.DOM.Parser
59 , Text.XML.DOM.Parser.Attributes
56 , Text.XML.DOM.Parser.Attributes
@@ -63,7 +60,6 @@ library
63 , Text.XML.DOM.Parser.FromAttribute
60 , Text.XML.DOM.Parser.FromAttribute
64 , Text.XML.DOM.Parser.FromDom
61 , Text.XML.DOM.Parser.FromDom
65 , Text.XML.DOM.Parser.Types
62 , Text.XML.DOM.Parser.Types
66− , Text.XML.Soap
67
63
68test-suite test
64test-suite test
69 type: exitcode-stdio-1.0
65 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
22import Data.Foldable as F
22import Data.Foldable as F
23import Data.List as L
23import Data.List as L
24import Data.List.NonEmpty (NonEmpty(..))
24import Data.List.NonEmpty (NonEmpty(..))
25+import Data.Monoid
25import Data.Text as T
26import Data.Text as T
26import Data.Traversable
27import Data.Traversable
27import Text.XML
28import Text.XML
src/Text/XML/DOM/Parser/Content.hs+3−4
@@ -20,7 +20,6 @@ import Data.List as L
20import Data.Monoid
20import Data.Monoid
21import Data.Text as T
21import Data.Text as T
22import Data.Typeable
22import Data.Typeable
23−import Prelude as P
24import Text.Read
23import Text.Read
25import Text.XML.DOM.Parser.Types
24import Text.XML.DOM.Parser.Types
26import Text.XML.Lens
25import Text.XML.Lens
@@ -94,7 +93,7 @@ maybeReadContent
94maybeReadContent f t = maybe (Left msg) Right $ f t
93maybeReadContent f t = maybe (Left msg) Right $ f t
95 where
94 where
96 msg = "Not readable " <> n <> ": " <> t
95 msg = "Not readable " <> n <> ": " <> t
97− n = T.pack $ P.show $ typeRep (Proxy :: Proxy a)
96+ n = T.pack $ show $ typeRep (Proxy :: Proxy a)
98
97
99
98
100-- | Tries to read given text to value using 'Read'. Useful to use
99-- | Tries to read given text to value using 'Read'. Useful to use
@@ -115,8 +114,8 @@ readBool t =
115 tvals = ["y", "yes", "t", "true", "1"]
114 tvals = ["y", "yes", "t", "true", "1"]
116 fvals = ["n", "no", "f", "false", "0"]
115 fvals = ["n", "no", "f", "false", "0"]
117 in if
116 in if
118− | lowt `L.elem` tvals -> Right True
117+ | lowt `elem` tvals -> Right True
119− | lowt `L.elem` fvals -> Right False
118+ | lowt `elem` fvals -> Right False
120 | otherwise ->
119 | otherwise ->
121 Left $ "Could not read " <> t <> " as Bool"
120 Left $ "Could not read " <> t <> " as Bool"
122
121
src/Text/XML/DOM/Parser/Types.hs+4−4
@@ -88,6 +88,8 @@ data NameMatcher = NameMatcher
88 -- ^ Field for 'Show' instance and bulding usefull errors
88 -- ^ Field for 'Show' instance and bulding usefull errors
89 }
89 }
90
90
91+makeLenses ''NameMatcher
92+
91-- | Instance use 'matchCILocalName' as most general and liberal
93-- | Instance use 'matchCILocalName' as most general and liberal
92-- matching strategy (while XML is often malformed).
94-- matching strategy (while XML is often malformed).
93--
95--
@@ -119,8 +121,6 @@ matchCILocalName tname = NameMatcher
119 , _nmShow = tname
121 , _nmShow = tname
120 }
122 }
121
123
122−makeLenses ''NameMatcher
123−
124-- | Makes matcher which match name by 'Eq' with given
124-- | Makes matcher which match name by 'Eq' with given
125--
125--
126-- @since 2.0.0
126-- @since 2.0.0
@@ -134,7 +134,7 @@ matchName n = NameMatcher
134-- element of the document. Errors are much more usefull with path.
134-- element of the document. Errors are much more usefull with path.
135newtype DomPath = DomPath
135newtype DomPath = DomPath
136 { unDomPath :: [Text]
136 { unDomPath :: [Text]
137− } deriving (Eq, Ord, Show, Semigroup, Monoid)
137+ } deriving (Eq, Ord, Show, Monoid)
138
138
139-- | DOM parser error description.
139-- | DOM parser error description.
140data ParserError
140data ParserError
@@ -184,7 +184,7 @@ instance Exception ParserError
184
184
185newtype ParserErrors = ParserErrors
185newtype ParserErrors = ParserErrors
186 { unParserErrors :: [ParserError]
186 { unParserErrors :: [ParserError]
187− } deriving (Show, Semigroup, Monoid, Generic)
187+ } deriving (Show, Monoid, Generic)
188
188
189makePrisms ''ParserErrors
189makePrisms ''ParserErrors
190
190
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+ - .