1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 17:04:47 +03:00

Free.map rethrows errors.

This commit is contained in:
Rob Rix 2015-10-28 11:56:49 -04:00
parent abab6f3c7b
commit feabaa01a7

View File

@ -87,8 +87,8 @@ public enum Free<Leaf, Annotation, Value>: CustomDebugStringConvertible {
// MARK: Functor
public func map<C>(@noescape transform: Value -> C) -> Free<Leaf, Annotation, C> {
return analysis(ifPure: { .Pure(transform($0)) }, ifRoll: { .Roll($0, $1.map { $0.map(transform) }) })
public func map<C>(@noescape transform: Value throws -> C) rethrows -> Free<Leaf, Annotation, C> {
return try analysis(ifPure: { try .Pure(transform($0)) }, ifRoll: { try .Roll($0, $1.map { try $0.map(transform) }) })
}