Skip to content

Instantly share code, notes, and snippets.

@etorreborre
Created May 12, 2019 09:57
Show Gist options
  • Select an option

  • Save etorreborre/695a9d755ff88376b5b5d56753e89c3b to your computer and use it in GitHub Desktop.

Select an option

Save etorreborre/695a9d755ff88376b5b5d56753e89c3b to your computer and use it in GitHub Desktop.
tagging-constructors
fun genEmployeeStatus
<: genFun (tag @"permanent" Permanent) -- Gen (Tag "permanent" EmployeeStatus)
<: genFun (tag @"temporary" Temporary) -- Gen (Tag "temporary" EmployeeStatus)
genEmployeeStatus ::
GenIO (Tag "permanent" EmployeeStatus)
-> GenIO (Tag "temporary" EmployeeStatus)
-> GenIO EmployeeStatus
genEmployeeStatus g1 g2 = Gen.choice [fmap unTagg1, fmap unTag g2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment