Switch order of type and term in `as` definitions?

It would be a bit crazy to do this at this very last minute. We are 3 weeks away from RC-1. Even so, I believe your arguments have merit. I am not worried about changing as order in pattern matching, since that’s relatively minor. But changing the syntax of givens again is a big ask!

Just for the sake of the argument, if we do it, then I don’t think we should write

given[A] Foo[A] 

The fact that [A] is attached to the given keyword is a glaring lexical irregularity. The alternative

given [A] Foo[A] 

isn’t any better. Why is Foo between two [A]'s? Why is there a space on the left but not on the right? So, I don’t think this will fly. If we do it we’d have to make it clearer what is a formal parameter and what is an actual argument. The as keyword served to distinguish the two. We did explore => once before, and I still think that’s the best alternative. I.e. it would be

given [A] => Foo[A]

or

given [A] => Ordering[A] => Ordering[List[A]]
4 Likes