DEV Community

cem kaan kosali
cem kaan kosali

Posted on

λ-calculus in Dart

Lambda calculus is Turing complete, that is, it is a universal model of computation that can be used to simulate any Turing machine.[1] Its namesake, the Greek letter lambda (λ), is used in lambda expressions and lambda terms to denote binding a variable in a function.

Lambda calculus may be untyped or typed. In typed lambda calculus, functions can be applied only if they are capable of accepting the given input's "type" of data.

But how to assign types to functions?

In Dart, functions are objects, just like strings and numbers are objects. A typedef, or function-type alias, gives a function type a name that you can use when declaring fields and return types. A typedef retains type information when a function type is assigned to a variable.
Here is the Type definition example from language tour

Functional Programming with Flutter

Top comments (0)