Skip to content

Instantly share code, notes, and snippets.

@bgerstle
Last active June 18, 2016 18:33
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 bgerstle/91760b54c0b7dcf1d8fa6cff5cf25765 to your computer and use it in GitHub Desktop.
Save bgerstle/91760b54c0b7dcf1d8fa6cff5cf25765 to your computer and use it in GitHub Desktop.
Gen(unGen: { r, n in
let splitGen: () -> StdGen = {
var g: StdGen = r.split.0
return {
g = g.split.0
return g
}
}()
let Foo = Foo()
foo.a = Bool.arbitrary.unGen(splitGen(),n)
foo.b = Int8.arbitrary.unGen(splitGen(),n)
foo.c = Float.arbitrary.unGen(splitGen(),n)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment