I'd do
    
    
    type
      HList[T] = ref object
        case kind: HListKind:
          of HNil: discard
          of HCons: head: T; tail: HList[T] # on two lines in real code
      
      HValue = ref object
        case kind: HValueKind:
        of HInt: i: int
        of HString: text: string
        ..
    
    proc action(value: HValue) =
      # case or match value
    
    
    Run

Reply via email to