
enriquecastl
Effective Haskell: — Chapter 10 is difficult to understand for a Haskell Newbie
Hi,
This is the first book that has truly helped to learn Haskell and to develop confidence to write programs in this language. Thanks so much.
I have some feedback about Chapter 10. In the “Building a Basic Metrics System with IORefs” section, I can’t replicate the space leak problems related to the histogram. The timeFunction
always ends up measuring zero for every function that I’m capturing metrics for:
The memory usage report doesn’t correlate to the number of files that the application is reading either. I acknowledge that every computer environment is different and that may be the cause for my results. Nevertheless, it would be easier to follow the chapter if I could reproduce the memory leak in my local environment.
A smaller observation is that the displayMetrics function isn’t implemented in the chapter although it is referenced in the code examples. Implementing this function is easy, nevertheless, I thought it might be worth mentioning.
Thanks again for writing this book
First Post!

RebeccaSkinner
Thanks for the feedback, I’m really glad the book has been helpful. Sorry that this example isn’t working out. I’ll take another look and make sure that I didn’t let an erroneous version of the code slip in by accident. It’s also possible that a newer version of GHC has changed the behavior.
Could you share the GHC version and environment you ran the code in so I can try to replicate the issue there?
Thanks!
Popular Pragmatic Bookshelf topics










Other popular topics










Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /rails
- /js
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /emacs
- /java
- /haskell
- /onivim
- /svelte
- /typescript
- /crystal
- /c-plus-plus
- /kotlin
- /tailwind
- /gleam
- /ocaml
- /react
- /flutter
- /elm
- /vscode
- /ash
- /opensuse
- /centos
- /php
- /deepseek
- /html
- /scala
- /zig
- /textmate
- /sublime-text
- /nixos
- /debian
- /lisp
- /agda
- /react-native
- /kubuntu
- /arch-linux
- /ubuntu
- /revery
- /spring
- /manjaro
- /django
- /diversity
- /nodejs
- /lua
- /slackware
- /c
- /julia
- /markdown