diff --git a/prototype/Doubt/Prism.swift b/prototype/Doubt/Prism.swift index 642fab688..bfb445e71 100644 --- a/prototype/Doubt/Prism.swift +++ b/prototype/Doubt/Prism.swift @@ -28,24 +28,10 @@ extension Prism where To : ArrayConvertible { }, backward: { To(array: [ $0 ]) }) } -} - -public struct Iso { - public init(forward: Here -> There, backward: There -> Here) { - self.forward = forward - self.backward = backward - } - - public let forward: Here -> There - public let backward: There -> Here -} - - -extension Prism where To : ArrayConvertible { - public func map(transform: Iso) -> Prism { + public func map(transform: Prism) -> Prism { return Prism( - forward: { self.forward($0)?.array.map(transform.forward) }, + forward: { self.forward($0)?.array.flatMap(transform.forward) }, backward: { self.backward(To(array: $0.map(transform.backward))) }) } }