diff --git a/prototype/Doubt/Cofree.swift b/prototype/Doubt/Cofree.swift index 7e3378463..864ac8bd5 100644 --- a/prototype/Doubt/Cofree.swift +++ b/prototype/Doubt/Cofree.swift @@ -3,3 +3,15 @@ public enum Cofree { case Unroll(B) } + + +// MARK: - Comonad + +extension Cofree { + var extract: B { + switch self { + case let .Unroll(b): + return b + } + } +}