mstksg / auto

Haskell DSL and platform providing denotational, compositional api for discrete-step, locally stateful, interactive programs, games & automations. http://hackage.haskell.org/package/auto
MIT License
180 stars 11 forks source link

Problem with tutorial or me? #9

Closed psycotica0 closed 9 years ago

psycotica0 commented 9 years ago

In the tutorial, just above the section on proc notation, you've got the auto foo.

The tutorial says the first output is (4, Just 4), but wouldn't it be (8, Just 4)?

First x goes in to sumX which returns 4, but then we add x + sumX, which is 4 + 4, right? That goes into prodX, which just returns 8.

lastEven appears to just pull from x, so it'd just be Just 4.

I can't actually install or run auto on my computer to check, but I wanted to check just in case my understanding is wrong.

mstksg commented 9 years ago

Thanks :) You're right, the tutorial is wrong on that line. The rest of the output is correct, it's just that 4. I've uploaded a corrected version :)