# Effective Haskell: no \`Show expr\` arising from print

**URL:** <https://forum.devtalk.com/t/effective-haskell-no-show-expr-arising-from-print/81678>\
**Category:** PragProg Customers\
**Tags:** book-effective-haskell, question\
**Created:** [7 November 2022 14:10 UTC](https://forum.devtalk.com/t/effective-haskell-no-show-expr-arising-from-print/81678 "2022-11-07T14:10:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![molleweide](https://forum.devtalk.com/user_avatar/forum.devtalk.com/molleweide/32/4586_2.png) [@molleweide](https://forum.devtalk.com/u/molleweide)\
**Post date:** [7 November 2022 14:10 UTC](https://forum.devtalk.com/t/effective-haskell-no-show-expr-arising-from-print/81678/1 "2022-11-07T14:10:52Z")

</div>

Hi @RebeccaSkinner,

In for example the `Calculator` segment of chapter 4, if I run the examples in GHCI this error is returned:

```nohighlight
    λ: 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?

---

<div class="post-metadata">

**Author:** ![RebeccaSkinner](https://forum.devtalk.com/user_avatar/forum.devtalk.com/rebeccaskinner/32/3888_2.png) [@RebeccaSkinner](https://forum.devtalk.com/u/RebeccaSkinner)\
**Post date:** [9 December 2022 06:21 UTC](https://forum.devtalk.com/t/effective-haskell-no-show-expr-arising-from-print/81678/2 "2022-12-09T06:21:31Z")

</div>

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:

```auto
data Expr = Lit Int
    | Sub Expr Expr
    | Add Expr Expr
    | Mul Expr Expr
    | Div Expr Expr
    deriving Show

```
