Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fumieval/xml-lens
Lenses and traversals for xml-conduit
https://github.com/fumieval/xml-lens
Last synced: about 2 months ago
JSON representation
Lenses and traversals for xml-conduit
- Host: GitHub
- URL: https://github.com/fumieval/xml-lens
- Owner: fumieval
- License: bsd-3-clause
- Created: 2013-06-18T12:02:09.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2023-01-26T01:45:04.000Z (almost 2 years ago)
- Last Synced: 2024-04-25T23:31:19.883Z (8 months ago)
- Language: Haskell
- Homepage:
- Size: 31.3 KB
- Stars: 48
- Watchers: 4
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
xml-lens
========Lenses and traversals for [xml-conduit](http://hackage.haskell.org/package/xml-conduit).
Example
========```haskell
> doc <- Text.XML.readFile def "examples/books.xml"> doc ^.. root . named "books" ... named "book" . attributeIs "category" "Textbooks" ... named "title" . text
["Learn You a Haskell for Great Good!","Programming in Haskell","Real World Haskell"]> lengthOf ?? doc $ root . named "books" ... named "book"
7> doc ^? root . named "books" ... attributeIs "category" "Joke" ... named "title" . text
Just "Functional Ikamusume"> doc & root . named "books" ... named "book" ... named "pages" . text <>~ " pages" & renderLBS def & BL.putStrLn
``````xml
Haskell 98 language and libraries: the Revised Report
Simon Peyton Jones
272 pages
£45.00Learn You a Haskell for Great Good!
Miran Lipovaca
360 pagesProgramming in Haskell
Graham Hutton
200 pages…
```Tips
----* Use [cosmos](http://hackage.haskell.org/package/lens-4.19.2/docs/Control-Lens-Plated.html) to traverse over all children
* You can do or-composition of traversals with [failing](http://hackage.haskell.org/package/lens-4.19.2/docs/Control-Lens-Traversal.html#v:failing)