diff --git a/prototype/Doubt/Free.swift b/prototype/Doubt/Free.swift index 1fba0da64..0bc4908c3 100644 --- a/prototype/Doubt/Free.swift +++ b/prototype/Doubt/Free.swift @@ -56,10 +56,10 @@ public enum Free: CustomDebugStringConvertible { /// While not every function on a given `Free` can be computed using `cata`, these guarantees of termination and complexity, as well as the brevity and focus on the operation being performed n times, make it a desirable scaffolding for any function which can. /// /// For a lucid, in-depth tutorial on recursion schemes, I recommend [Patrick Thomson](https://twitter.com/importantshock)’s _[An Introduction to Recursion Schemes](http://patrickthomson.ghost.io/an-introduction-to-recursion-schemes/)_ and _[Recursion Schemes, Part 2: A Mob of Morphisms](http://patrickthomson.ghost.io/recursion-schemes-part-2/)_. - public func cata(transform: Syntax -> Value) -> Value { + public func cata(@noescape transform: Syntax -> Value) -> Value { return analysis( ifPure: id, - ifRoll: { $1.map { $0.cata(transform) } } >>> transform) + ifRoll: { transform($1.map { $0.cata(transform) }) }) }