@trtt Ok, I have a version that works
    
    
    type
      HNil = object
      HCons*[H, T] = ref object
        head*: H
        tail*: T
    
    let hNil = HNil()
    
    proc cons*[H; T](hd: H; tl:T): auto =
      HCons[H, T](head: hd, tail: tl)
    
    let l = cons("hi", cons(2, hNil))
    
    proc printAll(n: HNil) =
      discard
    
    proc printAll[H; T](hl: HCons[H, T]) =
      echo hl.head
      printAll(hl.tail)
    
    printAll(l)
    
    
    Run

Reply via email to