Skip to content

Instantly share code, notes, and snippets.

@fdjones
Created May 12, 2018 17:18
Show Gist options
  • Save fdjones/40f91a46531e92efcbed234d54cb4daa to your computer and use it in GitHub Desktop.
Save fdjones/40f91a46531e92efcbed234d54cb4daa to your computer and use it in GitHub Desktop.
fun number_in_months (dates : int*int*int list, months : int list)
if null dates
then 0
else
number_in_month(dates, hd months) + number_in_months(dates, tl months)
val test3 = number_in_months ([(2012,2,28),(2013,12,1),(2011,3,31),(2011,4,28)],[2,3,4]) = 3;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment