Skip to content

Instantly share code, notes, and snippets.

@piatra
Created July 30, 2017 17:37
Show Gist options
  • Save piatra/0fd7a97662f6affea8fb8febcc20b7d9 to your computer and use it in GitHub Desktop.
Save piatra/0fd7a97662f6affea8fb8febcc20b7d9 to your computer and use it in GitHub Desktop.
mutate i' g =
let i = getDummy i'
(g', newI) = foldl mutateEach (g, []) i
in (Dummy newI, g')
where mutateEach (gen, acc) el =
let (n, gen') = randomR (1, 100) gen
in (gen', el + n : acc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment