-
-
Save kjellski/cd75963b4685a4303f11 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Expr = | |
| Zahl of int | |
| Plus of Expr * Expr | |
let rec eval sexp = | |
match sexp with | |
| Zahl a -> a | |
| Plus (aexp, bexp) -> eval aexp + eval bexp | |
eval (Plus(Zahl 3, Plus(Zahl 5, Zahl 2))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment