mirror of
https://github.com/github/semantic.git
synced 2024-11-24 08:54:07 +03:00
Nothing ever flat maps an Algorithm.
This commit is contained in:
parent
c15c2715f5
commit
90cd2ee2d7
@ -33,13 +33,6 @@ public enum Algorithm<Term: CofreeType, Result> {
|
||||
public func map<Other>(transform: Result -> Other) -> Algorithm<Term, Other> {
|
||||
return analysis(ifPure: transform >>> Algorithm<Term, Other>.Pure, ifRoll: { .Roll($0.map { $0.map(transform) }) })
|
||||
}
|
||||
|
||||
|
||||
// MARK: Monad
|
||||
|
||||
public func flatMap<C>(transform: Result -> Algorithm<Term, C>) -> Algorithm<Term, C> {
|
||||
return analysis(ifPure: transform, ifRoll: { .Roll($0.map { $0.flatMap(transform) }) })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user