# Title: Effective Haskell (Page 31)

**URL:** <https://forum.devtalk.com/t/title-effective-haskell-page-31/130484>\
**Category:** PragProg Customers\
**Tags:** book-effective-haskell\
**Created:** [1 November 2023 01:45 UTC](https://forum.devtalk.com/t/title-effective-haskell-page-31/130484 "2023-11-01T01:45:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MeEd](https://forum.devtalk.com/user_avatar/forum.devtalk.com/meed/32/5517_2.png) [@MeEd](https://forum.devtalk.com/u/MeEd)\
**Post date:** [1 November 2023 01:45 UTC](https://forum.devtalk.com/t/title-effective-haskell-page-31/130484/1 "2023-11-01T01:45:13Z")

</div>

@RebeccaSkinner

At the bottom of page 31 when let is added to the example greeting I cannot get the example to work. I’ve tried rechecking spacing inside the example, made sure I copied the example correctly and put in hours trying to get the example to work. I get different errors every time I try to run it in ghci.

---

<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:** [1 November 2023 19:29 UTC](https://forum.devtalk.com/t/title-effective-haskell-page-31/130484/2 "2023-11-01T19:29:17Z")

</div>

Hey, sorry you’re having a problem! Here’s a working version of the example you can copy and paste:

```haskell
module Main where

makeGreeting salutation person =
  let messageWithTrailingSpace = salutation <> " "
  in messageWithTrailingSpace <> person

extendedGreeting person =
  let hello = makeGreeting "Hello" person
      goodDay = makeGreeting "I hope you have a nice afternoon" person
      goodBye = makeGreeting "see you later" person
  in hello <> "\n" <> goodDay <> "\n" <> goodBye

main = print $ extendedGreeting "George"

```

If you can paste your code and the output of the errors I’d be happy to help you spot what’s going on!

---

<div class="post-metadata">

**Author:** ![MeEd](https://forum.devtalk.com/user_avatar/forum.devtalk.com/meed/32/5517_2.png) [@MeEd](https://forum.devtalk.com/u/MeEd)\
**Post date:** [1 November 2023 23:56 UTC](https://forum.devtalk.com/t/title-effective-haskell-page-31/130484/3 "2023-11-01T23:56:54Z")

</div>

Thank you so much for your help.  
Ed

---

<div class="post-metadata">

**Author:** ![MeEd](https://forum.devtalk.com/user_avatar/forum.devtalk.com/meed/32/5517_2.png) [@MeEd](https://forum.devtalk.com/u/MeEd)\
**Post date:** [2 November 2023 18:53 UTC](https://forum.devtalk.com/t/title-effective-haskell-page-31/130484/4 "2023-11-02T18:53:47Z")

</div>

Hello Rebecca,

Thanks to your code I was able to get the example to work.

Thank you very much,

Ed
