Fraser Tweedale

56 points
User profile image.
Brisbane

Software Engineer at Red Hat.
Interested in functional programming, category theory
and other intersections of math and programming.
Crazy about jalapeños.

Authored Comments

Hi Florin, I wasn't aware of this book but I asked around about it. Some folks have read it, and recommend it for committed beginners.

Great question Tom. In such cases, the type of the output is a 2-tuple, or product, of the "normal output" and "next state". There are nice abstractions for structuring programs to work with state in this form, so you're not always having to explicitly construct and deconstruct the (state, output) tuple.

A side note: you might be surprised at what you can accomplish without state! Having state can make it easier to express a program or algorithm, but the Church-Turing Thesis tells us that algorithms that truly require state... do not exist :)