Wavelength is THE IDE for the world's most awesome programming language : the untyped lambda calculus.
Lambda expressions can be written into the editor the usual way
(\x.x) y
or by using the unicode lambda symbol.
(λx.x) y
You may also define custom aliases for terms or use predefined library terms by selecting a library in the main menu .
id = (λx.x)
Insert comments to clearify your code.
-- welcome to wavelength
Evaluate your input by pressing . The result and all steps leading to the result will be displayed in the output area beneath the editor.
Congrats, you just evaluated your first lambda expression!
Instead of evaluating the lambda term from beginning to end with one click, you can step through the evaluation manually by using the and buttons, or by clicking a reducible expression (redex) in the output area (only possible if unicode output format is selected).
Pressing or CTRL + ENTER will always start the execution from the beginning, whereas will run the execution from the current point of execution. will pause a running execution, allowing you to step manually.
Use or CTRL + BACKSPACE to clear the output area.
You can choose between two display formats, either unicode or syntax trees, by selecting the dedicated option in the left-most combobox beneath the editor.
The output format cannot be changed during an ongoing execution.
The default output format is unicode output, which will display the terms using the unicode lambda symbol (λ).
The redex that will be reduced next (concerning the selected reduction order) is underlined.
Blue highlighted terms can be reduced manually by clicking on them.
The reduced redex will be underlined when the new term is displayed.
In syntax trees light blue nodes indicate a redex and the dark blue node is the redex that will be evaluated next concerning the selected reduction order.
To change the reduction order for the execution process select the desired option in the combobox in the middle. All common orders of the untyped lambda calculus are provided.
Selecting a new reduction order while stepping manually will affect the execution process.
In case you do not want to get every step of the execution displayed you can change the output size with the right-most combobox.
Full: Every step of the execution is displayed.
Periodically: Every 50th step of the execution is displayed.
Shortened: Only the first and last 10 steps are displayed.
Result only: Only the result is displayed.
To improve your programming experience you can include different libraries by selecting them in the main menu . Press CTRL + SPACE in the editor to view the available predefined terms.
true
false
and
or
not
ifThenElse
Allows you to use arabic numerals in the input. All arithmetic operations provided are prefix expressions.
plus
: takes two arguments n and m, calculates n + mminus
: takes two arguments n and m, calculates n - mtimes
: takes two arguments n and m, calculates n * mpow
: takes two arguments n and m, calculates nmpred
: takes one argument and calculates its predecessorsucc
: takes one argument and calculates its successor
All provided operations are prefix expressions.
true
false
pair
: takes two parameters n and m, constructs a tuple (n,m)first
: takes a tuple as parameter and returns the first argumentsecond
: takes a tuple as parameter and returns the second argumentnewList
: constructs a new empty singly linked listprepend
: takes an element and a list of elements as parameter and sets the element as the lists new headhead
: takes a list as parameter and returns its first elementtail
: takes a list as parameter and returns its last elementisEmpty
: returns true if the list contains no elements
Provides the named term Y
to use as the Y-Combinator.
To copy the current output in a desired format press beneath the output area and select a predefined format. In the current version plaintext, unicode, LaTeX, Haskell and Lisp are support. Notice that we do not guarantee executable Haskell or Lisp code since it is only a syntactic translation.
For sharing the current state of the IDE with you friends you can press beneath the output area and copy the generated URL.
To test your understanding of the untyped lambda calculus, Wavelength provides different exercises. Each exercise consists of a task description and a sample solution. Just select an exercise in the main menu and master the lambda calculus!
Copyright (c) 2017-2018 Muhammet Gümüs, Markus Himmel, Marc Huisinga, Philip Klemens, Julia Schmid, Jean-Pierre von der Heydt
Wavelength is licensed under BSD 3-Clause.