# Effective Haskell: ch2 combineLists (page 66)

**URL:** <https://forum.devtalk.com/t/effective-haskell-ch2-combinelists-page-66/108306>\
**Category:** PragProg Customers\
**Tags:** book-effective-haskell, errata\
**Created:** [9 May 2023 23:56 UTC](https://forum.devtalk.com/t/effective-haskell-ch2-combinelists-page-66/108306 "2023-05-09T23:56:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![juhp](https://forum.devtalk.com/user_avatar/forum.devtalk.com/juhp/32/3908_2.png) [@juhp](https://forum.devtalk.com/u/juhp)\
**Post date:** [9 May 2023 23:56 UTC](https://forum.devtalk.com/t/effective-haskell-ch2-combinelists-page-66/108306/1 "2023-05-09T23:56:55Z")

</div>

On p66 of B9.0 chapter 2:

```haskell
combineLists as bs = 
  let a = head as
      b = head bs
      as' = tail as
      bs' = tail bs
  in if null as || null bs
     then []
     else (a,b) : combineLists as' bs'

```

I find this `let` clause a bit of an eyesore given that `head` and `tail` are not safe.

How about moving the `let` clause into the `else` branch (or possibly a `where`)? Or is it better just to drop those local variables completely?

---

<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:** [25 June 2023 20:37 UTC](https://forum.devtalk.com/t/effective-haskell-ch2-combinelists-page-66/108306/2 "2023-06-25T20:37:40Z")

</div>

Thanks. It’s sometimes hard to figure out how to format these early examples. I think being verbosely explicit here helps people build an intuition up.
