diff --git a/prototype/Doubt/Free.swift b/prototype/Doubt/Free.swift index 38fd8a074..b657ff8cb 100644 --- a/prototype/Doubt/Free.swift +++ b/prototype/Doubt/Free.swift @@ -91,7 +91,12 @@ public enum Free: CustomDebugStringConvertible { // MARK: Functor public func map(@noescape transform: Value throws -> C) rethrows -> Free { - return try analysis(ifPure: { try .Pure(transform($0)) }, ifRoll: { try .Roll($0, $1.map { try $0.map(transform) }) }) + switch self { + case let .Pure(a): + return try .Pure(transform(a)) + case let .Roll(annotation, syntax): + return try .Roll(annotation, syntax.map { try $0.map(transform) }) + } }