Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wayofthepie/conduit-json-stream
Hacking about with conduit and json-stream
https://github.com/wayofthepie/conduit-json-stream
Last synced: 9 days ago
JSON representation
Hacking about with conduit and json-stream
- Host: GitHub
- URL: https://github.com/wayofthepie/conduit-json-stream
- Owner: wayofthepie
- License: bsd-3-clause
- Created: 2015-09-15T20:15:02.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-15T22:47:40.000Z (about 9 years ago)
- Last Synced: 2023-03-12T08:24:08.285Z (over 1 year ago)
- Language: Haskell
- Size: 152 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hacking
Some hacking about with the conduit and json-stream libraries.## Working Example
Some notes so I remember... Given the following json in a file **simple.json**:
```json
{
"a": {
"b" : "c",
"d" : {
"e": "f"
}
}
}
```
I want to extract the value of **b** and **e**:
```haskell
-- | The parser would be as follows
p :: Parser (T.Text, T.Text)
p = (,) <$> "a" .: "b" .: string
<*> "a" .: "d" .: "e" .: string-- | And the conduit
jsonC "simple.json" p-- | This gives
[("c","f")]
```