diff --git a/prototype/Doubt.xcodeproj/project.pbxproj b/prototype/Doubt.xcodeproj/project.pbxproj index 488954213..8b23866e5 100644 --- a/prototype/Doubt.xcodeproj/project.pbxproj +++ b/prototype/Doubt.xcodeproj/project.pbxproj @@ -22,6 +22,7 @@ D45A36C91BBC667D00BE3DDE /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = D45A36C81BBC667D00BE3DDE /* Category.swift */; settings = {ASSET_TAGS = (); }; }; D45A36CD1BBC75DF00BE3DDE /* Info.swift in Sources */ = {isa = PBXBuildFile; fileRef = D45A36CC1BBC75DF00BE3DDE /* Info.swift */; settings = {ASSET_TAGS = (); }; }; D49C2CA41BBD72E300949127 /* AnyHashable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D49C2CA31BBD72E300949127 /* AnyHashable.swift */; settings = {ASSET_TAGS = (); }; }; + D49FCBAD1BBD7A3100C5E9C3 /* AnyEquatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D49FCBAC1BBD7A3100C5E9C3 /* AnyEquatable.swift */; settings = {ASSET_TAGS = (); }; }; D4A71DC51BB45B850051416D /* Vertex.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4A71DC41BB45B850051416D /* Vertex.swift */; settings = {ASSET_TAGS = (); }; }; D4A71DC71BB4AC9E0051416D /* VertexTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4A71DC61BB4AC9E0051416D /* VertexTests.swift */; settings = {ASSET_TAGS = (); }; }; D4AAE50E1B5AE22E004E581F /* Doubt.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4AAE4FD1B5AE22E004E581F /* Doubt.framework */; }; @@ -100,6 +101,7 @@ D45A36C81BBC667D00BE3DDE /* Category.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; D45A36CC1BBC75DF00BE3DDE /* Info.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Info.swift; sourceTree = ""; }; D49C2CA31BBD72E300949127 /* AnyHashable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnyHashable.swift; sourceTree = ""; }; + D49FCBAC1BBD7A3100C5E9C3 /* AnyEquatable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnyEquatable.swift; sourceTree = ""; }; D4A71DC41BB45B850051416D /* Vertex.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Vertex.swift; sourceTree = ""; }; D4A71DC61BB4AC9E0051416D /* VertexTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VertexTests.swift; sourceTree = ""; }; D4AAE4FD1B5AE22E004E581F /* Doubt.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Doubt.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -208,6 +210,7 @@ D45A36C81BBC667D00BE3DDE /* Category.swift */, D45A36CC1BBC75DF00BE3DDE /* Info.swift */, D49C2CA31BBD72E300949127 /* AnyHashable.swift */, + D49FCBAC1BBD7A3100C5E9C3 /* AnyEquatable.swift */, D4AAE5001B5AE22E004E581F /* Supporting Files */, ); path = Doubt; @@ -396,6 +399,7 @@ D432D4731BA9C55300F3FABC /* Stream.swift in Sources */, D4AAE5421B5AE2D0004E581F /* Doc.swift in Sources */, D49C2CA41BBD72E300949127 /* AnyHashable.swift in Sources */, + D49FCBAD1BBD7A3100C5E9C3 /* AnyEquatable.swift in Sources */, D432D4771BA9FE6A00F3FABC /* Comparable.swift in Sources */, D45A36CD1BBC75DF00BE3DDE /* Info.swift in Sources */, D4AAE5461B5AE2D0004E581F /* Parse.swift in Sources */, diff --git a/prototype/Doubt/AnyEquatable.swift b/prototype/Doubt/AnyEquatable.swift new file mode 100644 index 000000000..0be914841 --- /dev/null +++ b/prototype/Doubt/AnyEquatable.swift @@ -0,0 +1,10 @@ +public enum AnyEquatable: Equatable { + case External(A, (A, A) -> Bool) +} + +public func == (left: AnyEquatable, right: AnyEquatable) -> Bool { + switch (left, right) { + case let (.External(a, eq), .External(b, _)): + return eq(left, right) + } +}