![]() For example, a function may take a function and invoke it with a constant `` calls a given function with 2Ī more interesting thing a function can do is to return another function. Some examples of such functions are `` identityįunctions can also take other functions as input, and operate on them. See lambda.ink on GitHub → The world of (pure) functionsįor simplicity, we’ll only consider functions that take one input, and return one output value. You can also find the full source file of everything covered in this post in the lambda.ink project, including a thoroughly commented implementation. We’ll end with an implementation of the factorial function, implemented fully within our Ink-based mini lambda calculus implementation. Through this post, we’ll pick apart the basic building blocks of programs we’re normally familiar with, like numbers and conditionals, using the primitives of the lambda calculus. ![]() ![]() While the lambda calculus is a theoretical model, we can also build real, executable implementations of the lambda calculus using programming languages with first-class functions, by modeling all computation using functions in the programming language. The lambda calculus also happens to be a generally useful model of computation for functional programming languages, like Lisps and Haskell. It allows computer theoreticians to model more complex computation using simpler parts that lend themselves nicely to study. Lambda calculus is a useful model because of its inherent simplicity. Unlike the other popular theoretical model, the Turing machine, the lambda calculus describes all computation in terms of pure functions, and functions acting on other functions. ![]() The lambda calculus is a formal model of computation, a mathematically rigorous way of thinking about what computers do. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |