molleweide
Effective Haskell: no `Show expr` arising from print
Hi @RebeccaSkinner,
In for example the Calculator segment of chapter 4, if I run the examples in GHCI this error is returned:
λ: Add (Lit 5) (Lit 4) <interactive>:159:1: error: • No instance for (Show Expr) arising from a use of ‘print’ • In a stmt of an interactive GHCi command: print it I understand what it means but personally I am not sure how to make all examples go past this. It seems by your examples in the book also that you don’t have this issue?
First Post!
RebeccaSkinner
Author of Effective Haskell
Thanks for catching this! I’ll take a look and push a fix in the next update!
In the mean time, you can work around this bug by adding deriving Show after your definition of Expr. For example:
data Expr = Lit Int | Sub Expr Expr | Add Expr Expr | Mul Expr Expr | Div Expr Expr deriving Show Popular Pragmatic Bookshelf topics
In Chapter 3, the source for index introduces Config on page 31, followed by more code including tests; Config isn’t introduced until pag...
New
Python Testing With Pytest - Chapter 2, warnings for “unregistered custom marks” While running the smoke tests in Chapter 2, I get these...
New
Title: Web Development with Clojure, Third Edition - migrations/create not working: p159 When I execute the command: user=> (create-...
New
Hi Travis! Thank you for the cool book! :slight_smile: I made a list of issues and thought I could post them chapter by chapter. I’m rev...
New
The book has the same “Problem space/Solution space” diagram on page 18 as is on page 17. The correct Problem/Solution space diagrams ar...
New
Hello! Thanks for the great book. I was attempting the Trie (chap 17) exercises and for number 4 the solution provided for the autocorre...
New
On page 78 the following code appears: <%= link_to ‘Destroy’, product, class: ‘hover:underline’, method: :delete, data: { confirm...
New
I’m a newbie to Rails 7 and have hit an issue with the bin/Dev script mentioned on pages 112-113. Iteration A1 - Seeing the list of prod...
New
Modern Front-End Development for Rails - application does not start after run bin/setup (page xviii)
After some hassle, I was able to finally run bin/setup, now I have started the rails server but I get this error message right when I vis...
New
Getting an error when installing the dependencies at the start of this chapter: could not compile dependency :exla, "mix compile" failed...
New
Other popular topics
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
What chair do you have while working… and why? Is there a ‘best’ type of chair or working position for developers?
New
Which, if any, games do you play? On what platform? I just bought (and completed) Minecraft Dungeons for my Nintendo Switch. Other than ...
New
New
Saw this on TikTok of all places! :lol: Anyone heard of them before? Lite:
New
We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
New
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New
This is a very quick guide, you just need to: Download LM Studio: https://lmstudio.ai/ Click on search Type DeepSeek, then select the o...
New
Curious what kind of results others are getting, I think actually prefer the 7B model to the 32B model, not only is it faster but the qua...
New
Ok, well here are some thoughts and opinions on some of the ergonomic keyboards I have, I guess like mini review of each that I use enoug...
New
Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /ruby
- /wasm
- /erlang
- /phoenix
- /keyboards
- /python
- /js
- /rails
- /security
- /go
- /swift
- /vim
- /clojure
- /emacs
- /haskell
- /java
- /svelte
- /onivim
- /typescript
- /kotlin
- /crystal
- /c-plus-plus
- /tailwind
- /react
- /gleam
- /ocaml
- /flutter
- /elm
- /vscode
- /ash
- /opensuse
- /html
- /centos
- /php
- /deepseek
- /zig
- /scala
- /sublime-text
- /lisp
- /textmate
- /react-native
- /debian
- /nixos
- /agda
- /kubuntu
- /arch-linux
- /django
- /deno
- /ubuntu
- /revery
- /nodejs
- /spring
- /manjaro
- /diversity
- /lua
- /julia
- /markdown
- /c








