For `repr` though, it seems is has to be in a macro (I'd been using it before 
asking this question actually and I didn't even put together that the `gensym` 
I was seeing was actually modifying the identifiers!)

🤔 I suppose I can just make a utility macro for the repr in which case I guess 
my question is just "does a utility already exist that does this in global code 
like dumpAst?"

These posts: recent: <https://forum.nim-lang.org/t/10494#70006> older: 
<https://forum.nim-lang.org/t/9441#61985>

might have been another.

I thing the generic template will work. I'll try that.

> There is nothing in your code saying that T should be char and R should be a 
> string.

sorry here is the definition of `Parser`
    
    
    ParseFn*[T, R] = proc(stream: Stream[T]; index: var int): Result[R]
    Parser*[T, R] = object
      fn*: ParseFn[T, R]
      description*: string
    
    Run

Here is my logic on how the type could have been inferred:

(forgive some adhoc notation) `Parser[T, R](temp[T, R]) -> block[Parser[T, R]] 
-> t: Parser[char, string]`

in my mind, the information is all there if the type checker can walk this 
chain in reverse.

Reply via email to