Skip to content

Instantly share code, notes, and snippets.

@KarlHerler
Created April 27, 2011 19:02
Show Gist options
  • Save KarlHerler/944940 to your computer and use it in GitHub Desktop.
Save KarlHerler/944940 to your computer and use it in GitHub Desktop.
SML is not always a pretty language.
fun xadd(t1 :moneh, t2 :moneh) = if ((#2 t1)+(#2 t2))>100 then (((#1 t1)+(#1 t2)+1), ((#2 t1)+(#2 t2)-100)) else if ((#2 t1)+(#2 t2)<0) then (((#1 t1)+(#1 t2)-1), (((#2 t1)+(#2 t2))+100)) else (((#1 t1)+(#1 t2)), ((#2 t1)+(#2 t2)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment