Skip to content

Instantly share code, notes, and snippets.

@michaelchum
Created January 25, 2016 07:05
Show Gist options
  • Save michaelchum/21876e63e108d4b918cf to your computer and use it in GitHub Desktop.
Save michaelchum/21876e63e108d4b918cf to your computer and use it in GitHub Desktop.

Revisions

  1. michaelchum created this gist Jan 25, 2016.
    9 changes: 9 additions & 0 deletions odd_even.ml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    let rec
    is_even = function
    | 0 -> true
    | n -> is_odd (n-1)
    and
    is_odd = function
    | 0 -> false
    | n -> is_even (n-1)
    ;;