Good gotcha, reusing the `enum` typeclass for sum enums will be too confusing. 
Back to `case`?
    
    
    type
      Option[T] = case
        of None: discard
        of Some: T
      
      Either[A, B] = case
        of Le: A
        of Ri: T
      
      BinaryNode = object
        a, b: ref Node
      UnaryNode = object
        a: ref Node
      
      Node = case
        of BinaryOpr: BinaryNode
        of UnaryOpr: UnaryNode
        of Variable: string
        of Value: int
    
    
    
    Run

Reply via email to