I’ve been fooling around with the indentation on this for a while now, but it looks correct to me. Can anyone see where I’m going wrong?
deposit :: NodeType -> NodeType -> Amount -> Node
deposit (Income income) (Account bal grow) amount =
Account (bal + transfer) grow where transfer = case amount of
AbsoluteAmount amount -> min income amount -- This is line 34
RelativeAmount percent -> (min 1.0 percent) * income
The error message I’m getting is:
Prelude> :load BudgetFlow.hs
[1 of 1] Compiling Main ( BudgetFlow.hs, interpreted )
BudgetFlow.hs:34:5: parse error (possibly incorrect indentation)
Failed, modules loaded: none.
Line 34 (the line with the parse error) is the line that begins AbsoluteAmount (I marked it with a comment above). I’ve tried putting the case statement on its own line and indenting the two cases fully to the right of the of keyword, but I still get the same error message. Thanks so much for any help!
Put the
whereclause on its own line.