0

I am trying to pick up some basic Haskell skills and wrote the following code:

pennypincherRec :: [Int] -> Int
pennypincherRec (x : xs) | deducted <= 19900 = deducted + rest
                        | otherwise = rest
                        where deducted = discount x
                              rest = pennypincherRec xs

It works if I replace the "rest" with "pennypincherRec xs" and remove the last line.

With the code above, it gives: parse error on input `rest'

So how do I use the where clause for multiple variables?

Tedy S.
  • 89
  • 6

0 Answers0