I was reading Bernie Pope's slides on "Parser combinators in Scala". He quotes the method signature type of the "alternative" combinator |
:
def | [U >: T](q: => Parser[U]): Parser[U]
and asks, "Homework: why doesn’t | have this type instead?"
def | [U](q: => Parser[U]): Parser[Either[T,U]]