Skip to content

Instantly share code, notes, and snippets.

@fdjones
Created May 14, 2018 17:18
Show Gist options
  • Save fdjones/3839b1d1438086974bbbf7d1a6bde175 to your computer and use it in GitHub Desktop.
Save fdjones/3839b1d1438086974bbbf7d1a6bde175 to your computer and use it in GitHub Desktop.
fun date_to_string (date: int*int*int) =
let val months = [January, February, March, April, May, June, July, August, September, October, November, December]
in
get_nth(months, #2 date) ^ " " ^ Int.toString(#3 date) ^ ", " ^ Int.toString(#1 date)
end
(* errors: *)
Error: unbound variable or constructor: December
Error: unbound variable or constructor: November
Error: unbound variable or constructor: October
etc.....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment