diff --git a/prototype/Doubt/Matrix.swift b/prototype/Doubt/Matrix.swift index e39e85126..ab3d8dc21 100644 --- a/prototype/Doubt/Matrix.swift +++ b/prototype/Doubt/Matrix.swift @@ -23,6 +23,13 @@ struct Matrix { } + // MARK: Functor + + func map(transform: A -> Other) -> Matrix { + return Matrix(width: width, height: height, values: values.map { $0.map(transform) }) + } + + // MARK: Implementation details private init(width: Int, height: Int, values: [Memo]) {