-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add implicit filter to Transformers (#29)
Declaring a transformer "func(T) T" where T is a concrete type is a common transformation. However, this is currently problematic as the transformation now infinitely applies to itself recursively. In order to allow this form of transformation, add a simple (but subtle) filter to Transformers where a Transformer can only apply if that specific Transformer does not already exist within the tail of the current Path since the last non-Transform step. This rule does not prevent more advance usages of Transformers where the user *does* want the Transformer to apply recursively to previously transformed output, since those situations are almost always followed by some path step that is *not* a transformation (e.g., pointer indirect, slice indexing, etc).
- Loading branch information
Showing
3 changed files
with
19 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters