Repository navigation
Processing JSON
Vladislav Zavialov edited this page Dec 6, 2026
·
1 revision
The examples below process the file saved by the Download JSON button with jq. The results shown are for the query ^type\b\s+\w+\s+::\s (standalone kind signatures).
jq -r '.packages[].name' hackage-search.jsonAspectAG-0.8.0.0
MicroHs-0.17.4.0
Win32-notify-0.3.0.3
abstractly-keyed-implicits-0.1.1.0
...
jq -r '.packages[].name | sub("-[0-9.]+$"; "")' hackage-search.jsonAspectAG
MicroHs
Win32-notify
abstractly-keyed-implicits
...
jq -r '.packages | sort_by(-.matches)[] | "\(.matches)\t\(.name)"' hackage-search.json558 proarrow-0.4.0.0
253 moonlight-homology-0.1.0.3
209 moonlight-category-1.1.0.1
201 rel8-internal-1.8.0.0
...
jq -r '.packages[] | .name as $p | .files[] | "\($p)/\(.path)"' hackage-search.jsonAspectAG-0.8.0.0/src/Language/AspectAG/RunningExample.lhs
AspectAG-0.8.0.0/src/Language/AspectAG.hs
MicroHs-0.17.4.0/lib/Control/Monad/Fix.hs-boot
MicroHs-0.17.4.0/lib/Data/Coerce.hs
...
jq -r '.packages[] | .name as $p | .files[] | .path as $f | .lines[]
| select(any(.parts[]; has("match")))
| "\($p)/\($f):\(.number): \([.parts[] | .context // .match] | join("") | sub("\r?\n$"; ""))"' hackage-search.jsonAspectAG-0.8.0.0/src/Language/AspectAG/RunningExample.lhs:384: type H :: Grammar
AspectAG-0.8.0.0/src/Language/AspectAG/RunningExample.lhs:509: type G :: Grammar
AspectAG-0.8.0.0/src/Language/AspectAG.hs:878: type Sem :: Grammar
MicroHs-0.17.4.0/lib/Control/Monad/Fix.hs-boot:5: type MonadFix :: (Type -> Type) -> Constraint
...
jq -r '.. | .match? // empty' hackage-search.json | sort | uniq -c | sort -rn 11 type Env ::
10 type T ::
10 type PickType ::
10 type Add ::
...
jq '{query, packages: (.packages | length), files: ([.packages[].files[]] | length), matches}' hackage-search.json{
"query": "^type\\b\\s+\\w+\\s+::\\s",
"packages": 271,
"files": 1500,
"matches": 4871
}