Skip to content

Instantly share code, notes, and snippets.

@roberto
Created December 15, 2016 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roberto/61a6bc755a2074fe33db1dc78163f826 to your computer and use it in GitHub Desktop.
Save roberto/61a6bc755a2074fe33db1dc78163f826 to your computer and use it in GitHub Desktop.
import Html exposing (text)
partition n =
break (n - 1, 0)
break (n, total) =
case n of
1 -> total + 1
n -> 1 + break(n - 1, total + 1)
main =
partition 8 |> toString |> text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment