Part of the 'transform' infrastructure.
Part of the 'transform' infrastructure. transform ca take either a T only or a (T, A). (t, a) is bit cumbersome to write and that is why CTWithResult exists. This allows to write t andCollect a instead of (t, List(a))
This is solely use to write collect as def collect[C[_] ] = new CollectInType[C] {..} instead of def collect[C[_] ] = new {} and so to not use reflective calls.
This is solely use to write collect as def collect[C[_] ] = new CollectInType[C] {..} instead of def collect[C[_] ] = new {} and so to not use reflective calls. This as not been benchmarked so I don't really know if it has a real performance impact
This trait is part of the infrastructure required to make the collect combinator have a default parameter to List[_].
This trait is part of the infrastructure required to make the collect combinator have a default parameter to List[_]. C is the type of the collection (ex: List[Int]) given by the User (or inferred to Nothing by the compiler) A is the element inside the collection (in List[Int] it would be Int) R is the 'real' collection that will be used i.e if C = Nothing => R = List[A] else R = C
Note: maybe it would be interesting to generate such boilerplaite with a macro annotation. Something like that:
Alias for select
Same as bottomUpBreak, but does not sop when a transformation/traversal has succeeded
Traverse the tree in a BottomUp manner, stop when a transformation/traversal has succeeded
Traverse the direct children of the tree and apply f to them.
Same as visit but puts the results into a collection (List by default)
same as collect but put the results into a collection of 2 type parameter e.g a Map[K, V]
The infamous fix point combinator
Syntactic sugar for guard combinator so that one doesn't need to type the type parameter
Succeed if the partial function f applied on the tree is defined and return true
Simple Identity combinator.
Simple Identity combinator. a identity = a
Alias for focus{case t: U => some((t,t)}
Same as TopDown, but does not sop when a transformation/traversal has succeeded
Traverse the tree in a TopDown manner, stop when a transformation/traversal has succeeded
Syntactic sugar for transform combinator so that one doesn't need to type the type parameter
Transform a I into a T where both I and O are subtypes of T and where a transformation from I to O is authorized
Traverse the data structure and return a result
This trait contains the base combinators which can be used to write powerful traversers.