This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- The assumption here is that stream based I/O is a better fit for | |
| -- distributed systems than monadic I/O, because there is a greater | |
| -- separation between logic, which can be idempotent and distributed | |
| -- via something like differential dataflow, and actions, which can | |
| -- be represented like ports and actuators | |
| -- We already know that stream based I/O is a good fit for reactive programs | |
| -- but what about more "imperative" ones that fit monads well? I took an imperative | |
| -- example and tried to express it via stream I/O |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Here's a derivation for a tail recursive fibonacci function. | |
| Let's start from the Maths definition: | |
| fib(0) = 0 | |
| fib(1) = 1 | |
| fib(n) = fib(n - 1) + fib(n - 2) | |
| */ | |
| // Let's translate the structure, leaving the recursive case unspecified: |
OlderNewer