4 ms·
What does the tildes do in `(~[~[~[~[A, B], C], D], E])`?
by bjz_ 13y ago
What does the tildes do in `(~[~[~[~[A, B], C], D], E])`?
- terhechte 13y agoIt's a wrapper over a sequence of matches: http://www.scala-lang.org/api/current/#scala.util.parsing.combinator.Parsers$$tilde http://www.scala-lang.org/api/current/#scala.util.parsing.co... Given p1: Parser[A] and p2: Parser[B], a parser composed with p1 ~ p2 will have type Parser[~[A, B]]. The successful result of the parser can be extracted from this case class. In this case it will use the [[[[A,B] C] D] E] sequence to compose A,B,C,D,E together in order to produce F (A-F are types). At least if I understand things correctly, I've never used flatten5.