
31 Aug
2012
31 Aug
'12
12:23 p.m.
Good afternoon, I'm going thru Graham Hutton's book "Programming in Haskell" [and am viewing the associated online lectures by Erik Meijer and Graham]. I find both to be excellent. My problem is with the following statements: factorial' :: Int -> Int factorial' 0 = 1 factorial' (n+1) = (n+1)*factorial' n When I load this into GHC I get the following error: pihch01.hs:128:13: Parse error in pattern: n + 1 I'd appreciate any advice. Good day