Avoid printing lifetimes sometimes, and also print them in a nicer way
Right?
Would make things a lot more readable...
Also, we should probably make them stand out more visually.
type currently prints lifetimes with angle brackets:
鲤 (type "foo")
=> (Ref String <a>)
Maybe we can adopt that everywhere?
Actually, it'd be good to adopt this in the parser for type sigs even, since it would help distinguish between type vars and lifetime vars (which would help w/ #910
Yeah, some kind of signifier would be great. Perhaps angle brackets are OK, though they are a bit annoying to type – any other ideas?
A sigil/prefix (like & or @) would be better imo.
I think & makes a lot of sense since it's already a shorthand for refs!
Oh, I actually meant similar to those. I think the signatures will be too hard to visually parse if we “overload” &, even though the compiler can discern them.
Ahh gotcha, maybe * for nods to pointers?
~t .t
~ is nice too
*
Yes that could work too.
Don’t forget that ~ is already used for calling function references as well. That’s not a deal breaker in refs, but could be visually, confusing.
I really like <a> in term of readability but I understand that might make parsing harder. I feel in that case it's better to optimise for readability than "type-ability" given how often you have manually specify lifetimes.