From 11a2d2700a70cde384da36403a18cc429d915b6e Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 28 Oct 2015 11:53:47 -0400 Subject: [PATCH] =?UTF-8?q?`Free.cata`=E2=80=99s=20argument=20does=20not?= =?UTF-8?q?=20escape.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prototype/Doubt/Free.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) }) }) }