Lambda Calculus
Check-in [eff3de1005]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:more expln
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:eff3de10057ea22fd6f98353922ad26fd7280aec
User & Date: bill 2011-12-04 07:11:46
Context
2011-12-05
01:01
changed monad implementation to use difference lists check-in: 0686d2898d user: bill tags: trunk
2011-12-04
07:11
more expln check-in: eff3de1005 user: bill tags: trunk
07:07
added evaluator.js to repo check-in: 53604aec06 user: bill tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to evaluator.html.

76
77
78
79
80
81
82


83
84
85
86
87
88
89
] =)= λf . f false nil
| =.= &lambda;f rest g . f false rest</pre>
<br>
<h3>IO Monad</h3>
If you make an IO monad, a "Step" button will appear that you can use to step through your code.  Try testM1-testM9 to see it.  Just run one of the tests and Click the "Step" button that appears until you see the final result.
<br>
The "stepIO" function in lc.js is the driver for the io monad.  The "Step" button calls it with the queued commands in the current IO monad and the latest return value.  If there is more computation left, it returns a two-element array containing the rest of the command list and the latest return value otherwise, it returns a one-element array containing only the final return value.


<br><br>
Have fun!<br>
Bill Burdick (you can send me mail at bill dot burdick on gmail)<br>
<br>
<h2>To do</h2>
save button
</div></td></tr></table>







>
>







76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
] =)= &lambda;f . f false nil
| =.= &lambda;f rest g . f false rest</pre>
<br>
<h3>IO Monad</h3>
If you make an IO monad, a "Step" button will appear that you can use to step through your code.  Try testM1-testM9 to see it.  Just run one of the tests and Click the "Step" button that appears until you see the final result.
<br>
The "stepIO" function in lc.js is the driver for the io monad.  The "Step" button calls it with the queued commands in the current IO monad and the latest return value.  If there is more computation left, it returns a two-element array containing the rest of the command list and the latest return value otherwise, it returns a one-element array containing only the final return value.
<br>
A "real" environment would repeatedly call stepIO until it reaches the final value.  This is just a first crack at an IO monad.  It's not very efficient, but it does demonstrate how to do IO without side effects.
<br><br>
Have fun!<br>
Bill Burdick (you can send me mail at bill dot burdick on gmail)<br>
<br>
<h2>To do</h2>
save button
</div></td></tr></table>