Types
Result[T; E] = object when E is void and T is void: isOk*: bool elif E is void and T isnot void: case isOk*: bool of true: value*: T else: nil elif E isnot void and T is void: case isOk*: bool of true: nil else: error*: E else: case isOk*: bool of true: value*: T else: error*: E