Effective Haskell: ch 2 > destructuring lists

  1. The function I am testing is handleNums on page 68.

It returns this error message:

    λ: :reload
    [1 of 1] Compiling Main             ( Chapter2.hs, interpreted )

    Chapter2.hs:306:1: error:
        • Non type-variable argument
            in the constraint: Show ((a -> Bool) -> Bool)
          (Use FlexibleContexts to permit this)
        • When checking the inferred type
            handleNums :: forall a.
                          (Integral a, Show ((a -> Bool) -> Bool), Num ((a -> Bool) -> Bool),
                           Eq ((a -> Bool) -> Bool)) =>
                          [(a -> Bool) -> Bool] -> [Char]
        |
    306 | handleNums l =
        | ^^^^^^^^^^^^^^...
    Failed, no modules loaded.
  1. I sort of understand the err msg but I add this info here so you can see that this can happen to a reader.

  2. Did I post this information under the correct category. Is “errata” correct or should I have chose something else?

  3. The book is great! I’m chugging along and it feels really good.

1 Like

Hi! Can you share the code that you are trying to load. I can’t reproduce this error from the example locally.