Skip to content

Commit

Permalink
Miniml documentation and example
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejbauer committed Sep 3, 2016
1 parent 3a99ac7 commit 37050a3
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 84 deletions.
4 changes: 2 additions & 2 deletions src/lambda/README.markdown
Expand Up @@ -16,8 +16,8 @@ We can combine these to get various reduction strategies:
| `#shallow` | weak normal form | weak head normal form |
| `#deep` | normal form | head normal form |

In terms of programming language terminology, weak normal form corresponds to call by
value and the weak head normal form to call by name.
In terms of programming language terminology, weak normal form corresponds approximately
to call by value and the weak head normal form to call by name.

##### Example interaction

Expand Down
35 changes: 35 additions & 0 deletions src/miniml/README.markdown
@@ -0,0 +1,35 @@
An implementation of an eager statically typed functional language with
a compiler and an abstract machine.

The language has the following constructs:

* Integers with arithmetic operations `+`, `-` and `*`. (There is no
division because the language has no exceptions.)
* Booleans with conditional statement and comparison of integers
`=` and `<`.
* Recursive functions and function application. The expression

fun f (x : t) : s is e

denotes a function of type `t -> s` which maps `x` to `e`. In `e`
the function refers to itself as `f`.

* Toplevel definitions

let x = e

There are no local definitions.

Example interaction:

MiniML. Press Ctrl-D to exit.
MiniML> 3 + (if 5 < 6 then 10 else 100) ;;
- : int = 13
MiniML> let x = 14 ;;
x : int = 14
MiniML> let fact = fun f (n : int) : int is if n = 0 then 1 else n * f (n-1) ;;
fact : int -> int = <fun>
MiniML> fact 10 ;;
- : int = 3628800
MiniML>
Good bye.
82 changes: 0 additions & 82 deletions src/miniml/README.txt

This file was deleted.

File renamed without changes.

0 comments on commit 37050a3

Please sign in to comment.