| CARVIEW |
Select Language
HTTP/2 200
date: Sun, 18 Jan 2026 03:16:17 GMT
content-type: text/html; charset=utf-8
server: cloudflare
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=iTXSFF7OITZSPxcECQkI6ImIigjpnjaSPSGkVWu0PIJW1j4yWvW7ipygj1FBQKpb1optuTycaIq%2B6JHXa9%2F%2F9pM8KfgK5wiGJhJtJJfCOCI%3D"}]}
vary: Accept-Encoding, Accept, Accept-Language
x-xss-protection: 1; mode=block
last-modified: Sun, 18 Jan 2026 03:16:17 GMT
cache-control: max-age=3600
cf-cache-status: EXPIRED
content-encoding: gzip
cf-ray: 9bfaeec86d9effab-BOM
alt-svc: h3=":443"; ma=86400
weigh :: Stackage Server
weigh
weigh
Measure allocations of a Haskell functions/values
https://github.com/fpco/weigh#readme
| LTS Haskell 24.28: | 0.0.18 |
| Stackage Nightly 2026-01-18: | 0.0.18 |
| Latest on Hackage: | 0.0.18 |
BSD-3-Clause licensed by Chris Done
Maintained by [email protected]
This version can be pinned in stack with:
weigh-0.0.18@sha256:78b183a32f86b216db889965da1c67992263040f440ad71d65e4454c36a6dba1,1214Module documentation for 0.0.18
- Weigh
Depends on 7 packages(full list with versions):
weigh 
Measures the memory usage of a Haskell value or function
Limitations
- :warning: Turn off the
-threadedflag, otherwise it will cause inconsistent results.
Example use
import Weigh
main :: IO ()
main =
mainWith
(do func "integers count 0" count 0
func "integers count 1" count 1
func "integers count 10" count 10
func "integers count 100" count 100)
where
count :: Integer -> ()
count 0 = ()
count a = count (a - 1)
Output results:
| Case | Allocated | GCs |
|---|---|---|
| integers count 0 | 16 | 0 |
| integers count 1 | 88 | 0 |
| integers count 10 | 736 | 0 |
| integers count 100 | 7,216 | 0 |
Output by default is plain text table; pass --markdown to get a
markdown output like the above.