Skip to content

Instantly share code, notes, and snippets.

@fowlmouth
Created November 17, 2013 02:27
Show Gist options
  • Save fowlmouth/7508321 to your computer and use it in GitHub Desktop.
Save fowlmouth/7508321 to your computer and use it in GitHub Desktop.
type
TEither[L,R] = object
case which: bool
of true: left: L
else: right: R
var x : TEither[string,int]
x.right = 42
x.repr.echo
x.reset
x.which = true
x.left = "hi"
x.repr.echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment