Content deleted Content added
Tag: |
syntaxhighlight & fix lint |
||
Line 39:
::Consider the following example in typed lambda calculus, which takes a boolean and two functional thunks and returns another thunk:
<syntaxhighlight lang="text">
λ b : (unit -> a) -> (unit -> a) -> a. λ tr : unit -> a. λ fa : unit -> a. λ u : unit. b tr fa
</syntaxhighlight>
::In this case, b could be a suspended [[Church encoding]] of "true" or "false":
<syntaxhighlight lang="text">
true := λ tr : unit -> a. λ fa : unit -> a. tr ()
false := λ tr : unit -> a. λ fa : unit -> a. fa ()
</syntaxhighlight>
::So all you really need are functions and unit; non-strictness is just a matter of convenience if you don't want to deal with explicitly invoking your thunks. I won't claim it's not convenient, because it is; but it's not really a matter of expressiveness. --[[User:Donhalcon|bmills]] 19:26, 19 February 2006 (UTC)
|