enriquecastl

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:

Screen Shot 2022-10-08 at 5.52.56 PM

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 :heart:

0 369 2

First Post!

RebeccaSkinner

RebeccaSkinner

Author of Effective Haskell

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!

Where Next?

Popular Pragmatic Bookshelf topics Top

jon
Some minor things in the paper edition that says “3 2020” on the title page verso, not mentioned in the book’s errata online: p. 186 But...
10 2622 9
New
JohnS
I can’t setup the Rails source code. This happens in a working directory containing multiple (postgres) Rails apps. With: ruby-3.0.0 s...
0 1272 3
New
leba0495
Hello! Thanks for the great book. I was attempting the Trie (chap 17) exercises and for number 4 the solution provided for the autocorre...
0 1148 3
New
leonW
I ran this command after installing the sample application: $ cards add do something --owner Brian And got a file not found error: Fil...
5 4369 7
New
jskubick
I’m running Android Studio “Arctic Fox” 2020.3.1 Patch 2, and I’m embarrassed to admit that I only made it to page 8 before running into ...
0 1696 3
New
nicoatridge
Hi, I have just acquired Michael Fazio’s “Kotlin and Android Development” to learn about game programming for Android. I have a game in p...
0 7996 6
New
brunogirin
When trying to run tox in parallel as explained on page 151, I got the following error: tox: error: argument -p/–parallel: expected one...
0 1105 1
New
adamwoolhether
Is there any place where we can discuss the solutions to some of the exercises? I can figure most of them out, but am having trouble with...
17 1372 9
New
hazardco
On page 78 the following code appears: <%= link_to ‘Destroy’, product, class: ‘hover:underline’, method: :delete, data: { confirm...
1 1265 2
New
creminology
Skimming ahead, much of the following is explained in Chapter 3, but new readers (like me!) will hit a roadblock in Chapter 2 with their ...
6 1112 5
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
476 5781 112
New
malloryerik
Any thoughts on Svelte? Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue...
54 3555 17
New
AstonJ
Or looking forward to? :nerd_face:
480 9438 251
New
siddhant3030
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor? Also, I want to know if someone is using it for program...
51 4319 20
New
AstonJ
poll poll Be sure to check out @Dusty’s article posted here: An Introduction to Alternative Keyboard Layouts It’s one of the best write-...
10 5348 11
New
Exadra37
I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
66 21694 24
New
DevotionGeo
The V Programming Language Simple language for building maintainable programs V is already mentioned couple of times in the forum, but I...
21 11128 7
New
AstonJ
Biggest jackpot ever apparently! :upside_down_face: I don’t (usually) gamble/play the lottery, but working on a program to predict the...
19 3178 10
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
49 4462 14
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
1 2188 1
New

Sub Categories: