Last active
December 26, 2015 09:49
-
-
Save orionll/7131981 to your computer and use it in GitHub Desktop.
How ML code looks like with tabs
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
fun all_except_option(str, lst) = | |
case lst of | |
[] => NONE | |
| x :: xs => | |
if same_string(str, x) | |
then SOME xs | |
else case all_except_option(str, xs) of | |
NONE => NONE | |
| SOME xs' => SOME (x :: xs') | |
fun get_substitutions1(substitutions, s) = | |
case substitutions of | |
[] => [] | |
| lst :: tail => case all_except_option(s, lst) of | |
NONE => get_substitutions1(tail, s) | |
| SOME lst' => lst' @ get_substitutions1(tail, s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My: