Functional proofs (Haskell)
问题 I failed at reading RWH; and not one to quit, I ordered Haskell: The Craft of Functional Programming . Now I'm curious about these functional proofs on page 146. Specifically I'm trying to prove 8.5.1 sum (reverse xs) = sum xs . I can do some of the induction proof but then I get stuck.. HYP: sum ( reverse xs ) = sum xs BASE: sum ( reverse [] ) = sum [] Left = sum ( [] ) (reverse.1) = 0 (sum.1) Right = 0 (sum.1) INDUCTION: sum ( reverse (x:xs) ) = sum (x:xs) Left = sum ( reverse xs ++ [x] )