| CARVIEW |
Select Language
HTTP/1.1 200 OK
Connection: keep-alive
Server: nginx/1.24.0 (Ubuntu)
Content-Type: text/html; charset=utf-8
Cache-Control: public, max-age=300
Content-Encoding: gzip
Via: 1.1 varnish, 1.1 varnish
Accept-Ranges: bytes
Age: 0
Date: Sat, 17 Jan 2026 22:51:36 GMT
X-Served-By: cache-dfw-kdfw8210159-DFW, cache-bom-vanm7210030-BOM
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1768690296.861819,VS0,VE331
Vary: Accept, Accept-Encoding
transfer-encoding: chunked
hw-mquery: Monadic query DSL
hw-mquery: Monadic query DSL
Modules
[Index] [Quick Jump]
Downloads
- hw-mquery-0.2.1.2.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
| Versions [RSS] | 0.0.0.1, 0.1.0.0, 0.1.0.1, 0.1.0.3, 0.2.0.0, 0.2.0.1, 0.2.0.2, 0.2.1.0, 0.2.1.1, 0.2.1.2 |
|---|---|
| Dependencies | base (>=4.11 && <5), dlist (>=0.8.0 && <1.1), hw-mquery, lens (>=4.17 && <6), prettyprinter (>=1 && <2) [details] |
| Tested with | ghc ==9.2.2, ghc ==9.0.2, ghc ==8.10.7, ghc ==8.8.4, ghc ==8.6.5 |
| License | BSD-3-Clause |
| Copyright | 2018-2021 John Ky |
| Author | John Ky |
| Maintainer | newhoggy@gmail.com |
| Uploaded | by haskellworks at 2024-11-08T07:28:23Z |
| Category | Data |
| Home page | https://github.com/haskell-works/hw-mquery#readme |
| Bug tracker | https://github.com/haskell-works/hw-mquery/issues |
| Source repo | head: git clone https://github.com/haskell-works/hw-mquery |
| Distributions | LTSHaskell:0.2.1.2, NixOS:0.2.1.2, Stackage:0.2.1.2 |
| Reverse Dependencies | 3 direct, 4 indirect [details] |
| Executables | hw-mquery-example |
| Downloads | 5885 total (46 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs available [build log] Last success reported on 2024-11-08 [all 1 reports] |
Readme for hw-mquery-0.2.1.2
[back to package description]hw-mquery
import Control.Monad
import Data.Function
import Data.List
import HaskellWorks.Data.Json.Load
import HaskellWorks.Data.Json.PartialValue
import HaskellWorks.Data.Micro
import HaskellWorks.Data.MQuery
import HaskellWorks.Data.Row
import HaskellWorks.Diagnostics
import Text.PrettyPrint.ANSI.Leijen
import qualified Data.DList as DL
!json <- loadJsonPartial "../data/78mb.json"
!json <- loadJsonWithIndex "../data/78mb.json"
!json <- loadJsonWithPoppy512Index "../data/78mb.json"
!json <- loadJsonWithPoppy512SMinMaxIndex "../data/78mb.json"
let q = MQuery (DL.singleton json)
putPretty $ q >>= item & limit 10
putPretty $ q >>= item & page 10 1
putPretty $ q >>= item >>= hasKV "founded_year" (JsonPartialNumber 2005) & limit 10
putPretty $ q >>= item >>= entry
putPretty $ q >>= item >>= entry >>= named "name" & limit 10
putPretty $ q >>= item >>= entry >>= satisfying (\(k, _) -> k == "name") >>= value & limit 10
putPretty $ q >>= item >>= entry >>= satisfying ((== "name") . fst) >>= value & limit 10
putPretty $ q >>= (item >=> entry >=> key) & limit 10
putPretty $ q >>= item >>= entry >>= key & limit 100 & onList (uniq . sort)
putPretty $ (q >>= item >>= entry & limit 1) >>= field "name" & limit 10
putPretty $ do {j <- q; e <- item j; (k, v) <- entry e; return k}
putPretty $ do {j <- q; e <- item j; (k, v) <- entry e; guard (k == "name"); return v}
Decoding
Line separated base 64 encoded gzipped json
while read in; do echo "$in" | base64 --decode | gunzip; echo ""; done < file.lgz > firehose.json
Profiling with stack traces
mafia build -p
cabal repl --ghc-options='-fexternal-interpreter -prof'
import HaskellWorks.Data.Succinct.BalancedParens
import HaskellWorks.Data.Succinct.RankSelect.Binary.Poppy512
import HaskellWorks.Data.Positioning
import qualified Data.Vector.Storable as DVS
import HaskellWorks.Data.IndexedSeq
(jsonBS, jsonIb, jsonBp) <- loadJsonRawWithIndex "firehose.json"
let bp1 = SimpleBalancedParens jsonBp
let bp2 = SimpleBalancedParens (makePoppy512 jsonBp)
let bp3 = makePoppy512 jsonBp