# Effective Haskell: Example doesn’t work (page 8)

**URL:** <https://forum.devtalk.com/t/effective-haskell-example-doesn-t-work-page-8/43622>\
**Category:** PragProg Customers\
**Tags:** book-effective-haskell, errata\
**Created:** [5 March 2022 22:48 UTC](https://forum.devtalk.com/t/effective-haskell-example-doesn-t-work-page-8/43622 "2022-03-05T22:48:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DW\_Roth](https://forum.devtalk.com/user_avatar/forum.devtalk.com/dw_roth/32/3943_2.png) [@DW\_Roth](https://forum.devtalk.com/u/DW_Roth)\
**Post date:** [5 March 2022 22:48 UTC](https://forum.devtalk.com/t/effective-haskell-example-doesn-t-work-page-8/43622/1 "2022-03-05T22:48:21Z")

</div>

Title: Effective Haskell - Example doesn’t work (page 8)

Middle of page 8 says: "Create a new Main.hs and copy the example below to get started.

module Main where

makeGreeting salutation person =  
salutation \<\> " " \<\> person

Now load up ghci and test out…"

If I load this file into ghci (or try to compile it), I get errors: "The IO action ‘main’ is not defined in the module ‘Main’.

The text shown is not complete as it doesn’t include a main module. The reader is left to figure out why it doesn’t work.

---

<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:** [6 March 2022 01:49 UTC](https://forum.devtalk.com/t/effective-haskell-example-doesn-t-work-page-8/43622/2 "2022-03-06T01:49:16Z")

</div>

Thanks for pointing out that bug! It will be fixed as soon as the next beta update is released.  
Until then, the correct example should be:

```auto
module Main where

makeGreeting salutation person =
  salutation <> " " <> person

main = print "no salutation to show yet"

```

---

<div class="post-metadata">

**Author:** ![melston](https://forum.devtalk.com/user_avatar/forum.devtalk.com/melston/32/1824_2.png) [@melston](https://forum.devtalk.com/u/melston)\
**Post date:** [23 March 2022 20:35 UTC](https://forum.devtalk.com/t/effective-haskell-example-doesn-t-work-page-8/43622/3 "2022-03-23T20:35:48Z")

</div>

I am seeing a different error.

```auto
Prelude> :load Main
[1 of 1] Compiling Main ( Main.hs, interpreted )

Main.hs:4:16: error:
    • Variable not in scope: (<>) :: t2 -> [Char] -> t0
    • Perhaps you meant one of these:
        ‘<*>’ (imported from Prelude), ‘*>’ (imported from Prelude),
        ‘>>’ (imported from Prelude)

Main.hs:4:23: error:
    • Variable not in scope: (<>) :: t0 -> t1 -> t
    • Perhaps you meant one of these:
        ‘<*>’ (imported from Prelude), ‘*>’ (imported from Prelude),
        ‘>>’ (imported from Prelude)
Failed, modules loaded: none.

```

It works if I add `import Data.Monoid` after the module declaration
