Abstract class used to delay delay the time when the type parameter of a meta combinator is decided.
Abstract class used to delay delay the time when the type parameter of a meta combinator is decided. Anonymous functions can't take type parameter, so this ugly stuff is required
Allows to call 'combinators' directly on T For documentation see Combinators.scala
Evaluator at which will be applied m andThen the traversal strategy defined in 'meta'
Evaluator at which will be applied the traversal strategy defined in 'meta'
This has to be outside of EvaluatorAndThen because of covarience stuff it is not possible to write def force(implicit x: Monoid[A]) = ...inside EvaluatorAndThen[A] We should write def force[B >: A](implicit x: Monoid[B]) but Monoid should be made contravarient in A, which is not possible (in part because it is not logical and because contravarient stuff does not work well with implicits)
Make it possible to use the collection like ui api inside different structures A := Result of the Matcher R := Some anonymous type which represents the result of a transformation on each MatchResult V := T | Option[T] | Seq[T] L := R | Option[R] | Seq[R]
System needed to recover the correct type from a 'transfrom' call.
System needed to recover the correct type from a 'transfrom' call. 1) x.transform{case x: T => x} : T 2) x.transform{case x: T => (x, List(1))} : (T, List[Int])
This trait allows to easily write simple traversals. Instead of writing: t : T val x = topDown(collect{...}) val result = x(t).result We can wirte instead t.collect{...}
topDownBreak(focus{..} ~> topDown{transform{...}}) (t) becomes t.topDownBreak.focus{..}.topDown.transform{..} Which is essentially easier to read and to write
The drawbacks:
/!\ Beware: this code contains a lot of implcit magic tricks