From 6cca28582dae7c6a2c1392ac5dee275d3c3845c7 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 22 Oct 2015 18:51:14 -0400 Subject: [PATCH] Add a convenience to copy terms into diffs. --- prototype/DoubtTests/SESTests.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/prototype/DoubtTests/SESTests.swift b/prototype/DoubtTests/SESTests.swift index 4885a6871..313644e61 100644 --- a/prototype/DoubtTests/SESTests.swift +++ b/prototype/DoubtTests/SESTests.swift @@ -43,6 +43,10 @@ final class SESTests: XCTestCase { private typealias Term = Cofree private typealias Diff = Free> +private func copy(term: Term) -> Diff { + return hylo(Diff.Introduce(()), Term.unwrap)(term) +} + private let a = Term((), .Leaf("a")) private let b = Term((), .Leaf("b")) private let c = Term((), .Leaf("c"))