Created
July 10, 2021 12:12
-
-
Save Octachron/28691ede67b84a8d70341763fc1d6c62 to your computer and use it in GitHub Desktop.
This file contains 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 e = .. | |
type e += A | B | C | D | E | F | |
let f = function | |
| A -> 1 | |
| B -> 2 | |
| C -> 3 | |
| D -> 4 | |
| E -> 5 | |
| F -> 6 | |
| _ -> 7 | |
(* -dlambda output: | |
f/88 = | |
(function param/90 : int | |
(if (== param/90 A/82) 1 | |
(if (== param/90 B/83) 2 | |
(if (== param/90 C/84) 3 | |
(if (== param/90 D/85) 4 | |
(if (== param/90 E/86) 5 (if (== param/90 F/87) 6 7))))))) | |
*) | |
type t = A | B | C | D | E | F | |
let g = function | |
| A -> 1 | |
| B -> 2 | |
| C -> 3 | |
| D -> 4 | |
| E -> 5 | |
| F -> 6 | |
(* dlambda output: | |
g/98 = | |
(function param/100 : int | |
(switch* param/100 | |
case int 0: 1 | |
case int 1: 2 | |
case int 2: 3 | |
case int 3: 4 | |
case int 4: 5 | |
case int 5: 6))) | |
*) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment