Does the lambda calculus have provisions for I/O? State can be done with free variables.

Hi: Does the lambda calculus have provisions for I/O? State can be done with free variables. -- -- Sent from an expensive device which will be obsolete in a few months! :D Casey

KC
Hi:
Does the lambda calculus have provisions for I/O? State can be done with free variables.
Lambda Calculus can't do IO "internally"; we can't mutate variables, whether or not they're free. However, we can use LC to construct programs in some "external" language, which *does* support IO. We can interface the two by using free variables to represent the "external" functions. This is the same way Haskell implements IO: pure Haskell functions are used to construct a "main" value out of "external" (/"primitive"/ "built-in"/ "foreign") functions. We can regard "main" as a program for an imperative language (the Haskell run-time system). We can do the same thing in Lambda Calculus (which is like Haskell without the type-checking and syntactic sugar). Cheers, Chris
participants (2)
-
Chris Warburton
-
KC