mirror of
https://github.com/github/semantic.git
synced 2024-12-25 16:02:43 +03:00
Free.para
’s transformation function receives the annotation.
This commit is contained in:
parent
aa815e8010
commit
3fbfeccce9
@ -63,10 +63,10 @@ public enum Free<Leaf, Annotation, Value>: CustomDebugStringConvertible {
|
||||
}
|
||||
|
||||
/// Like `cata`, except the `Syntax` values are parameterized by the `Free` values as well as the reduced form.
|
||||
public func para(@noescape transform: Syntax<(Free, Value), Leaf> throws -> Value) rethrows -> Value {
|
||||
public func para(@noescape transform: (Annotation, Syntax<(Free, Value), Leaf>) throws -> Value) rethrows -> Value {
|
||||
return try analysis(
|
||||
ifPure: id,
|
||||
ifRoll: { try transform($1.map { try ($0, $0.para(transform)) }) })
|
||||
ifRoll: { try transform($0, $1.map { try ($0, $0.para(transform)) }) })
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user