Skip to content

Instantly share code, notes, and snippets.

@niorad
Created January 23, 2016 18:59
Show Gist options
  • Save niorad/45187d9eb76c585e573e to your computer and use it in GitHub Desktop.
Save niorad/45187d9eb76c585e573e to your computer and use it in GitHub Desktop.
Haskell Go-Function Example
divideBy x y = go x y 0
where go a b count
| a < b = (count, a)
| otherwise = go (a - b) b (count + 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment