From fa2bfcd367bd3db8d960d61395c71580c21e7c42 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 14 Oct 2015 10:24:16 -0400 Subject: [PATCH] `duplicate()` is just `extend(id)`. --- prototype/Doubt/Cofree.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/prototype/Doubt/Cofree.swift b/prototype/Doubt/Cofree.swift index b67823373..e875dfad9 100644 --- a/prototype/Doubt/Cofree.swift +++ b/prototype/Doubt/Cofree.swift @@ -44,6 +44,9 @@ extension Cofree { /// Returns a new `Cofree` constructed by recursively annotating each subtree with itself. public var duplicate: Cofree> { - return .Unroll(self, unwrap.map { $0.duplicate }) + return extend(id) } } + + +import Prelude