Lambda Calculus
Check-in [d01c60b446]
Not logged in

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

Overview
Comment:updated slides.html and added dayName back into evaluator, since it's in the talk
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA1:d01c60b44622ce35a754e45d31627acf60baf78c
User & Date: bill 2012-03-31 13:57:25
Context
2012-03-31
13:57
updated slides.html and added dayName back into evaluator, since it's in the talk Leaf check-in: d01c60b446 user: bill tags: trunk
13:50
simplified nextDat and prevDay check-in: 83709ccfd9 user: bill tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to evaluator.html.

188
189
190
191
192
193
194

195
196
197
198
199
200
201
202
203
204
205
monday = \sun mon tue wed thu fri sat . mon
tuesday =   \sun mon tue wed thu fri sat . tue
wednesday = \sun mon tue wed thu fri sat . wed
thursday =  \sun mon tue wed thu fri sat . thu
friday =    \sun mon tue wed thu fri sat . fri
saturday =   \sun mon tue wed thu fri sat . sat


nextDay = \day . day monday tuesday wednesday thursday friday saturday sunday
prevDay = \day . day saturday sunday monday tuesday wednesday thursday friday
testDay = nextDay monday

testMName = bind (alert Please-enter-your-name) \_ . bind (prompt name) \nm . bind (return [nm, Jr]) \nm . alert [Your, actual, name, is, nm]

#define puts i32 @puts(i8* nocapture) nounwind
#define putsl i32 @putsl(i8* nocapture) nounwind
	</pre>
</body>
</html>







>


|








188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
monday = \sun mon tue wed thu fri sat . mon
tuesday =   \sun mon tue wed thu fri sat . tue
wednesday = \sun mon tue wed thu fri sat . wed
thursday =  \sun mon tue wed thu fri sat . thu
friday =    \sun mon tue wed thu fri sat . fri
saturday =   \sun mon tue wed thu fri sat . sat

dayName = \day . day Sunday Monday Tuesday Wednesday Thursday Friday Saturday
nextDay = \day . day monday tuesday wednesday thursday friday saturday sunday
prevDay = \day . day saturday sunday monday tuesday wednesday thursday friday
testDay = dayName (nextDay monday)

testMName = bind (alert Please-enter-your-name) \_ . bind (prompt name) \nm . bind (return [nm, Jr]) \nm . alert [Your, actual, name, is, nm]

#define puts i32 @puts(i8* nocapture) nounwind
#define putsl i32 @putsl(i8* nocapture) nounwind
	</pre>
</body>
</html>

Changes to slides.html.

799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
...
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865

* <code>sunday = <span class="def">λsun mon tue wed thu fri sat</span> . sun</code>
* <code>monday = <span class="def">λsun mon tue wed thu fri sat</span> . mon</code>
* <code>tuesday = <span class="def">λsun mon tue wed thu fri sat</span> . tue</code>
* <code>wednesday = <span class="def">λsun mon tue wed thu fri sat</span> . wed</code>
* <code>thursday = <span class="def">λsun mon tue wed thu fri sat</span> . thu</code>
* <code>friday = <span class="def">λsun mon tue wed thu fri sat</span> . fri</code>
* <code>shabbat = <span class="def">λsun mon tue wed thu fri sat</span> . sat</code>
***
#Custom Control Structures: Enums/Switches

Maybe you already guessed this...

If you can represent a boolean by a function that applies its argument to two values, what about more than 2?

* <code>sunday = <span class="def">λsun mon tue wed thu fri sat</span> . sun</code>
* <code>monday = <span class="def">λsun mon tue wed thu fri sat</span> . mon</code>
* <code>tuesday = <span class="def">λsun mon tue wed thu fri sat</span> . tue</code>
* <code>wednesday = <span class="def">λsun mon tue wed thu fri sat</span> . wed</code>
* <code>thursday = <span class="def">λsun mon tue wed thu fri sat</span> . thu</code>
* <code>friday = <span class="def">λsun mon tue wed thu fri sat</span> . fri</code>
* <code>shabbat = <span class="def">λsun mon tue wed thu fri sat</span> . sat</code>

<code>dayName = <span class="def">λday</span> . day Sunday Monday Tuesday Wednesday Thursday Friday Saturday</code>
***
#Custom Control Structures: Enums/Switches

Maybe you already guessed this...

................................................................................

* <code>sunday = <span class="def">λsun mon tue wed thu fri sat</span> . sun</code>
* <code>monday = <span class="def">λsun mon tue wed thu fri sat</span> . mon</code>
* <code>tuesday = <span class="def">λsun mon tue wed thu fri sat</span> . tue</code>
* <code>wednesday = <span class="def">λsun mon tue wed thu fri sat</span> . wed</code>
* <code>thursday = <span class="def">λsun mon tue wed thu fri sat</span> . thu</code>
* <code>friday = <span class="def">λsun mon tue wed thu fri sat</span> . fri</code>
* <code>shabbat = <span class="def">λsun mon tue wed thu fri sat</span> . sat</code>

<code>dayName = <span class="def">λday</span> . day Sunday Monday Tuesday Wednesday Thursday Friday Saturday</code>

<code>dayName thursday &rArr; Thursday</code>
***
#Custom Control Structures: Enums/Switches

So, OK, it's like a switch.  But can we get the next or previous day?
***
#Custom Control Structures: Enums/Switches

So, OK, it's like a switch.  But can we get the next or previous day?

* <code>nextDay = <span class="def">λday sun mon tue wed thu fri sat</span> . day mon tue wed thu fri sat sun</code>
* <code>prevDay = <span class="def">λday sun mon tue wed thu fri sat</span> . day sat sun mon tue wed thu fri</code>
***
#Custom Control Structures: Enums/Switches

So, OK, it's like a switch.  But can we get the next or previous day?

* <code>nextDay = <span class="def">λday sun mon tue wed thu fri sat</span> . day mon tue wed thu fri sat sun</code>
* <code>prevDay = <span class="def">λday sun mon tue wed thu fri sat</span> . day sat sun mon tue wed thu fri</code>

<code>dayName (nextDay monday) &rArr; Tuesday</code>

<code>dayName (prevDay monday) &rArr; Sunday</code>
***
#Computed Streams of Data








|













|







 







|













|
|





|
|







799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
...
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865

* <code>sunday = <span class="def">λsun mon tue wed thu fri sat</span> . sun</code>
* <code>monday = <span class="def">λsun mon tue wed thu fri sat</span> . mon</code>
* <code>tuesday = <span class="def">λsun mon tue wed thu fri sat</span> . tue</code>
* <code>wednesday = <span class="def">λsun mon tue wed thu fri sat</span> . wed</code>
* <code>thursday = <span class="def">λsun mon tue wed thu fri sat</span> . thu</code>
* <code>friday = <span class="def">λsun mon tue wed thu fri sat</span> . fri</code>
* <code>saturday = <span class="def">λsun mon tue wed thu fri sat</span> . sat</code>
***
#Custom Control Structures: Enums/Switches

Maybe you already guessed this...

If you can represent a boolean by a function that applies its argument to two values, what about more than 2?

* <code>sunday = <span class="def">λsun mon tue wed thu fri sat</span> . sun</code>
* <code>monday = <span class="def">λsun mon tue wed thu fri sat</span> . mon</code>
* <code>tuesday = <span class="def">λsun mon tue wed thu fri sat</span> . tue</code>
* <code>wednesday = <span class="def">λsun mon tue wed thu fri sat</span> . wed</code>
* <code>thursday = <span class="def">λsun mon tue wed thu fri sat</span> . thu</code>
* <code>friday = <span class="def">λsun mon tue wed thu fri sat</span> . fri</code>
* <code>saturday = <span class="def">λsun mon tue wed thu fri sat</span> . sat</code>

<code>dayName = <span class="def">λday</span> . day Sunday Monday Tuesday Wednesday Thursday Friday Saturday</code>
***
#Custom Control Structures: Enums/Switches

Maybe you already guessed this...

................................................................................

* <code>sunday = <span class="def">λsun mon tue wed thu fri sat</span> . sun</code>
* <code>monday = <span class="def">λsun mon tue wed thu fri sat</span> . mon</code>
* <code>tuesday = <span class="def">λsun mon tue wed thu fri sat</span> . tue</code>
* <code>wednesday = <span class="def">λsun mon tue wed thu fri sat</span> . wed</code>
* <code>thursday = <span class="def">λsun mon tue wed thu fri sat</span> . thu</code>
* <code>friday = <span class="def">λsun mon tue wed thu fri sat</span> . fri</code>
* <code>saturday = <span class="def">λsun mon tue wed thu fri sat</span> . sat</code>

<code>dayName = <span class="def">λday</span> . day Sunday Monday Tuesday Wednesday Thursday Friday Saturday</code>

<code>dayName thursday &rArr; Thursday</code>
***
#Custom Control Structures: Enums/Switches

So, OK, it's like a switch.  But can we get the next or previous day?
***
#Custom Control Structures: Enums/Switches

So, OK, it's like a switch.  But can we get the next or previous day?

* <code>nextDay = <span class="def">λday</span> . day monday tuesday wednesday thursday friday saturday sunday</code>
* <code>prevDay = <span class="def">λday</span> . day saturday sunday monday tuesday wednesday thursday friday</code>
***
#Custom Control Structures: Enums/Switches

So, OK, it's like a switch.  But can we get the next or previous day?

* <code>nextDay = <span class="def">λday</span> . day monday tuesday wednesday thursday friday saturday sunday</code>
* <code>prevDay = <span class="def">λday</span> . day saturday sunday monday tuesday wednesday thursday friday</code>

<code>dayName (nextDay monday) &rArr; Tuesday</code>

<code>dayName (prevDay monday) &rArr; Sunday</code>
***
#Computed Streams of Data