3 ms·
Good point! It becomes hard to do mechanical transforms like I suggested when you have to keep track of properties like this for every function. Thanks!
by sophacles 16y ago
Good point! It becomes hard to do mechanical transforms like I suggested when you have to keep track of properties like this for every function. Thanks!
- Psyonic 16y agoYa that's the problem. Here's what I originally intended to write, but couldn't think of how to do cons in haskell so I used list addition. With cons (:), you can't rewrite it with the arguments swapped, so no simple mechanical transform will be able to fix this. blah 0 = [] blah n = (:) n (blah ((-) n 1)) -- blah 5 -> [5,4,3,2,1] blah2 0 acc = acc blah2 n acc = blah2 ((-) n 1) ((:) n acc) -- blah2 5 [] -> [1,2,3,4,5]