Skip to content

Commit f432e97

Browse files
committed
Test build restored
1 parent 260cd1e commit f432e97

38 files changed

+385
-397
lines changed

Abstract.xcodeproj/project.pbxproj

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@
181181
38A14E501F2A2DAB00A2900C /* SwiftCheck.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0951F2421F09690200EA362C /* SwiftCheck.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
182182
38A14E521F2A2DC300A2900C /* SwiftCheck.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0951F2441F09690200EA362C /* SwiftCheck.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
183183
38A14E531F2A2DCB00A2900C /* SwiftCheck.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0951F2441F09690200EA362C /* SwiftCheck.framework */; };
184+
38DFE65F208260B800489BDF /* FreeSemiring.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38DFE65E208260B800489BDF /* FreeSemiring.swift */; };
185+
38DFE660208260B800489BDF /* FreeSemiring.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38DFE65E208260B800489BDF /* FreeSemiring.swift */; };
186+
38DFE661208260B800489BDF /* FreeSemiring.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38DFE65E208260B800489BDF /* FreeSemiring.swift */; };
187+
38DFE662208260B800489BDF /* FreeSemiring.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38DFE65E208260B800489BDF /* FreeSemiring.swift */; };
188+
38DFE66420826CBB00489BDF /* FunctionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38DFE66320826CBB00489BDF /* FunctionTests.swift */; };
189+
38DFE66520826CBB00489BDF /* FunctionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38DFE66320826CBB00489BDF /* FunctionTests.swift */; };
190+
38DFE66620826CBB00489BDF /* FunctionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38DFE66320826CBB00489BDF /* FunctionTests.swift */; };
184191
38E185801FD7E50700208B0A /* Arbitrary.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 387A1DBF1F7909A000928A8C /* Arbitrary.generated.swift */; };
185192
38E185811FD7E50700208B0A /* CustomArbitraryTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 387A1DC01F7909A000928A8C /* CustomArbitraryTypes.swift */; };
186193
38E185821FD7E50800208B0A /* Arbitrary.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 387A1DBF1F7909A000928A8C /* Arbitrary.generated.swift */; };
@@ -302,6 +309,8 @@
302309
38D737E11EE9A761000BAF0C /* InfoTests.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = InfoTests.plist; sourceTree = "<group>"; };
303310
38D737E91EE9B86F000BAF0C /* Semigroup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Semigroup.swift; sourceTree = "<group>"; };
304311
38D737EB1EE9B95C000BAF0C /* Law.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Law.swift; sourceTree = "<group>"; };
312+
38DFE65E208260B800489BDF /* FreeSemiring.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FreeSemiring.swift; sourceTree = "<group>"; };
313+
38DFE66320826CBB00489BDF /* FunctionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = FunctionTests.swift; path = Tests/AbstractTests/FunctionTests.swift; sourceTree = SOURCE_ROOT; };
305314
/* End PBXFileReference section */
306315

307316
/* Begin PBXFrameworksBuildPhase section */
@@ -366,12 +375,12 @@
366375
09F9FD0D1EEE5C5D002342E5 /* Abstract */ = {
367376
isa = PBXGroup;
368377
children = (
369-
3812574620808FA500CD625D /* Support */,
370-
3812573B20808D7D00CD625D /* Morphism */,
371378
381256EA20807B1A00CD625D /* Free */,
379+
3833AC7820163D8400CE907E /* Generated */,
380+
3812573B20808D7D00CD625D /* Morphism */,
372381
381256E920807AB400CD625D /* Protocols */,
382+
3812574620808FA500CD625D /* Support */,
373383
381256E820807A9F00CD625D /* Types */,
374-
3833AC7820163D8400CE907E /* Generated */,
375384
38B83C901EED6E29007AB12A /* Utility */,
376385
);
377386
path = Abstract;
@@ -381,22 +390,22 @@
381390
isa = PBXGroup;
382391
children = (
383392
381256F020807B8500CD625D /* Add.swift */,
384-
381256F520807C3500CD625D /* Multiply.swift */,
385-
381256FA20807D7B00CD625D /* Max.swift */,
386-
381256FF20807E1F00CD625D /* Min.swift */,
387393
3812570420807E8100CD625D /* And.swift */,
388-
3812570920807F2600CD625D /* Or.swift */,
389-
3812570E20807FB500CD625D /* First.swift */,
390-
3812571320807FF800CD625D /* Last.swift */,
394+
3812572C2080852E00CD625D /* Array.swift */,
395+
3812573C20808ECD00CD625D /* Bool.swift */,
391396
381257182080803000CD625D /* EndoFunction.swift */,
397+
3812570E20807FB500CD625D /* First.swift */,
392398
3812571D2080827B00CD625D /* Function.swift */,
399+
3812571320807FF800CD625D /* Last.swift */,
400+
381256FA20807D7B00CD625D /* Max.swift */,
401+
381256FF20807E1F00CD625D /* Min.swift */,
402+
381256F520807C3500CD625D /* Multiply.swift */,
403+
381257312080855400CD625D /* Optional.swift */,
404+
3812570920807F2600CD625D /* Or.swift */,
393405
381257222080837600CD625D /* Ordering.swift */,
394406
38125727208084F900CD625D /* String.swift */,
395-
3812572C2080852E00CD625D /* Array.swift */,
396-
381257312080855400CD625D /* Optional.swift */,
397-
38125736208085C400CD625D /* Update.swift */,
398-
3812573C20808ECD00CD625D /* Bool.swift */,
399407
3812574120808EE200CD625D /* Tropical.swift */,
408+
38125736208085C400CD625D /* Update.swift */,
400409
);
401410
path = Types;
402411
sourceTree = "<group>";
@@ -405,11 +414,11 @@
405414
isa = PBXGroup;
406415
children = (
407416
38B83C9B1EED8A15007AB12A /* BoundedSemilattice.swift */,
408-
3853BF9F1EF1294400791099 /* Semiring.swift */,
409417
38B83C991EED85C6007AB12A /* CommutativeMonoid.swift */,
418+
38D737BD1EE9A711000BAF0C /* Magma.swift */,
410419
38943A781EEC4EFF00F587AD /* Monoid.swift */,
411420
38D737E91EE9B86F000BAF0C /* Semigroup.swift */,
412-
38D737BD1EE9A711000BAF0C /* Magma.swift */,
421+
3853BF9F1EF1294400791099 /* Semiring.swift */,
413422
);
414423
path = Protocols;
415424
sourceTree = "<group>";
@@ -420,6 +429,7 @@
420429
381256EB20807B3000CD625D /* FreeSemigroup.swift */,
421430
381257472080935A00CD625D /* FreeMonoid.swift */,
422431
3812574C2080952B00CD625D /* FreeCommutativeMonoid.swift */,
432+
38DFE65E208260B800489BDF /* FreeSemiring.swift */,
423433
);
424434
path = Free;
425435
sourceTree = "<group>";
@@ -519,6 +529,7 @@
519529
children = (
520530
387A1DBE1F7909A000928A8C /* Utility */,
521531
380A4B291F1BF66B002D70E0 /* BoundedSemilatticeTests.generated.swift */,
532+
38DFE66320826CBB00489BDF /* FunctionTests.swift */,
522533
380A4B241F1BF5AC002D70E0 /* CommutativeMonoidTests.generated.swift */,
523534
38943A681EEC25AE00F587AD /* HomomorphismTests.swift */,
524535
380A4B1F1F1BE383002D70E0 /* MonoidTests.generated.swift */,
@@ -845,6 +856,7 @@
845856
3812570120807E1F00CD625D /* Min.swift in Sources */,
846857
0950FEF41EFC5C7900513DF7 /* BoundedSemilattice.swift in Sources */,
847858
381256FC20807D7B00CD625D /* Max.swift in Sources */,
859+
38DFE660208260B800489BDF /* FreeSemiring.swift in Sources */,
848860
3812570B20807F2600CD625D /* Or.swift in Sources */,
849861
3812571020807FB500CD625D /* First.swift in Sources */,
850862
381256F220807B8500CD625D /* Add.swift in Sources */,
@@ -875,6 +887,7 @@
875887
38E185821FD7E50800208B0A /* Arbitrary.generated.swift in Sources */,
876888
380A4B1B1F1B775F002D70E0 /* WrapperTests.generated.swift in Sources */,
877889
380A4B161F1B7336002D70E0 /* SemigroupTests.generated.swift in Sources */,
890+
38DFE66520826CBB00489BDF /* FunctionTests.swift in Sources */,
878891
380A4B261F1BF5BE002D70E0 /* CommutativeMonoidTests.generated.swift in Sources */,
879892
0950FF071EFC5C8100513DF7 /* HomomorphismTests.swift in Sources */,
880893
380A4B2B1F1BF66B002D70E0 /* BoundedSemilatticeTests.generated.swift in Sources */,
@@ -904,6 +917,7 @@
904917
3812570220807E1F00CD625D /* Min.swift in Sources */,
905918
0950FF381F09488B00513DF7 /* Monoid.swift in Sources */,
906919
381256FD20807D7B00CD625D /* Max.swift in Sources */,
920+
38DFE661208260B800489BDF /* FreeSemiring.swift in Sources */,
907921
3812570C20807F2600CD625D /* Or.swift in Sources */,
908922
3812571120807FB500CD625D /* First.swift in Sources */,
909923
381256F320807B8500CD625D /* Add.swift in Sources */,
@@ -934,6 +948,7 @@
934948
38E185841FD7E50900208B0A /* Arbitrary.generated.swift in Sources */,
935949
380A4B1C1F1B775F002D70E0 /* WrapperTests.generated.swift in Sources */,
936950
380A4B171F1B7336002D70E0 /* SemigroupTests.generated.swift in Sources */,
951+
38DFE66620826CBB00489BDF /* FunctionTests.swift in Sources */,
937952
380A4B271F1BF5BF002D70E0 /* CommutativeMonoidTests.generated.swift in Sources */,
938953
0950FF3F1F0948D000513DF7 /* HomomorphismTests.swift in Sources */,
939954
380A4B2C1F1BF66B002D70E0 /* BoundedSemilatticeTests.generated.swift in Sources */,
@@ -963,6 +978,7 @@
963978
3812570320807E1F00CD625D /* Min.swift in Sources */,
964979
0950FF551F094A2C00513DF7 /* Monoid.swift in Sources */,
965980
381256FE20807D7B00CD625D /* Max.swift in Sources */,
981+
38DFE662208260B800489BDF /* FreeSemiring.swift in Sources */,
966982
3812570D20807F2600CD625D /* Or.swift in Sources */,
967983
3812571220807FB500CD625D /* First.swift in Sources */,
968984
381256F420807B8500CD625D /* Add.swift in Sources */,
@@ -1006,6 +1022,7 @@
10061022
3812570020807E1F00CD625D /* Min.swift in Sources */,
10071023
0950FF7F1F094AA100513DF7 /* Monoid.swift in Sources */,
10081024
381256FB20807D7B00CD625D /* Max.swift in Sources */,
1025+
38DFE65F208260B800489BDF /* FreeSemiring.swift in Sources */,
10091026
3812570A20807F2600CD625D /* Or.swift in Sources */,
10101027
3812570F20807FB500CD625D /* First.swift in Sources */,
10111028
381256F120807B8500CD625D /* Add.swift in Sources */,
@@ -1036,6 +1053,7 @@
10361053
38E185801FD7E50700208B0A /* Arbitrary.generated.swift in Sources */,
10371054
380A4B1A1F1B775F002D70E0 /* WrapperTests.generated.swift in Sources */,
10381055
380A4B151F1B7336002D70E0 /* SemigroupTests.generated.swift in Sources */,
1056+
38DFE66420826CBB00489BDF /* FunctionTests.swift in Sources */,
10391057
380A4B251F1BF5BD002D70E0 /* CommutativeMonoidTests.generated.swift in Sources */,
10401058
0950FF861F094AB500513DF7 /* HomomorphismTests.swift in Sources */,
10411059
380A4B2A1F1BF66B002D70E0 /* BoundedSemilatticeTests.generated.swift in Sources */,

Sources/Abstract/Free/FreeCommutativeMonoid.swift

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
import Operadics
33
#endif
44

5-
// sourcery: fixedTypesForPropertyBasedTests = "TestStructure"
6-
// sourcery: arbitrary
7-
// sourcery: constrainedArbitraryParameter = "A"
5+
// sourcery: fixedTypesForPropertyBasedTests = "Int"
86
public struct FreeCommutativeMonoid<A>: Wrapper, CommutativeMonoid {
97
public typealias WrappedType = Array<A>
108

@@ -13,15 +11,26 @@ public struct FreeCommutativeMonoid<A>: Wrapper, CommutativeMonoid {
1311
self.unwrap = value
1412
}
1513

14+
public init(unwrap: Array<A>) {
15+
self.init(unwrap)
16+
}
17+
1618
public static func <> (lhs: FreeCommutativeMonoid<A>, rhs: FreeCommutativeMonoid<A>) -> FreeCommutativeMonoid<A> {
1719
if lhs.unwrap.count > rhs.unwrap.count {
18-
return FreeCommutativeMonoid(lhs.unwrap)
20+
return FreeCommutativeMonoid(lhs.unwrap + rhs.unwrap)
1921
} else {
20-
return FreeCommutativeMonoid(rhs.unwrap)
22+
return FreeCommutativeMonoid(rhs.unwrap + lhs.unwrap)
2123
}
2224
}
2325

2426
public static var empty: FreeCommutativeMonoid {
2527
return FreeCommutativeMonoid([])
2628
}
2729
}
30+
31+
extension FreeCommutativeMonoid: Equatable where A: Equatable {}
32+
33+
extension FreeCommutativeMonoid: EquatableInContext where A: EquatableInContext {
34+
public typealias Context = A.Context
35+
}
36+

Sources/Abstract/Free/FreeMonoid.swift

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
import Operadics
33
#endif
44

5-
// sourcery: fixedTypesForPropertyBasedTests = "TestStructure"
6-
// sourcery: arbitrary
7-
// sourcery: constrainedArbitraryParameter = "A"
5+
// sourcery: fixedTypesForPropertyBasedTests = "Int"
86
public struct FreeMonoid<A>: Wrapper, Monoid {
97
public typealias WrappedType = Array<A>
108

@@ -13,6 +11,10 @@ public struct FreeMonoid<A>: Wrapper, Monoid {
1311
self.unwrap = value
1412
}
1513

14+
public init(unwrap: Array<A>) {
15+
self.init(unwrap)
16+
}
17+
1618
public static func <> (lhs: FreeMonoid<A>, rhs: FreeMonoid<A>) -> FreeMonoid<A> {
1719
return FreeMonoid(lhs.unwrap + rhs.unwrap)
1820
}
@@ -21,3 +23,10 @@ public struct FreeMonoid<A>: Wrapper, Monoid {
2123
return FreeMonoid([])
2224
}
2325
}
26+
27+
extension FreeMonoid: Equatable where A: Equatable {}
28+
29+
extension FreeMonoid: EquatableInContext where A: EquatableInContext {
30+
public typealias Context = A.Context
31+
}
32+

Sources/Abstract/Free/FreeSemigroup.swift

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
import Operadics
33
#endif
44

5-
// sourcery: fixedTypesForPropertyBasedTests = "TestStructure"
6-
// sourcery: arbitrary
7-
// sourcery: constrainedArbitraryParameter = "A"
5+
// sourcery: fixedTypesForPropertyBasedTests = "Int"
86
public struct FreeSemigroup<A>: Wrapper, Semigroup {
97
public typealias WrappedType = Array<A>
108

@@ -13,7 +11,17 @@ public struct FreeSemigroup<A>: Wrapper, Semigroup {
1311
self.unwrap = value
1412
}
1513

14+
public init(unwrap: Array<A>) {
15+
self.init(unwrap)
16+
}
17+
1618
public static func <> (lhs: FreeSemigroup, rhs: FreeSemigroup) -> FreeSemigroup {
1719
return FreeSemigroup(lhs.unwrap + rhs.unwrap)
1820
}
1921
}
22+
23+
extension FreeSemigroup: Equatable where A: Equatable {}
24+
25+
extension FreeSemigroup: EquatableInContext where A: EquatableInContext {
26+
public typealias Context = A.Context
27+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#if SWIFT_PACKAGE
2+
import Operadics
3+
#endif
4+
5+
// sourcery: fixedTypesForPropertyBasedTests = "Int"
6+
public struct FreeSemiring<A>: Wrapper, Semiring {
7+
public typealias WrappedType = Array<A>
8+
public typealias Additive = FreeCommutativeMonoid<A>
9+
public typealias Multiplicative = FreeMonoid<A>
10+
11+
public let unwrap: Array<A>
12+
public init(_ value: Array<A>) {
13+
self.unwrap = value
14+
}
15+
16+
public init(unwrap: Array<A>) {
17+
self.init(unwrap)
18+
}
19+
}
20+
21+
extension FreeSemiring: Equatable where A: Equatable {}
22+
23+
extension FreeSemiring: EquatableInContext where A: EquatableInContext {
24+
public typealias Context = A.Context
25+
}
26+

Sources/Abstract/Generated/WrapperEquatable.generated.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ extension Multiply: Equatable where WrappedType: Equatable {}
3737
extension Multiply: EquatableInContext where WrappedType: EquatableInContext {
3838
public typealias Context = WrappedType.Context
3939
}
40+

Sources/Abstract/Types/Add.swift

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
1-
//
2-
// Add.swift
3-
// Abstract
4-
//
5-
// Created by Elviro Rocca on 13/04/18.
6-
// Copyright © 2018 TypeLift. All rights reserved.
7-
//
8-
91
#if SWIFT_PACKAGE
102
import Operadics
113
#endif
124

135
// sourcery: wrapperEquatable
146
// sourcery: fixedTypesForPropertyBasedTests = "Int"
157
// sourcery: arbitrary
16-
// sourcery: arbitraryGenericParameterProtocols = "Addable & Equatable"
8+
// sourcery: constrainedArbitraryParameter = "A"
9+
// sourcery: arbitraryGenericParameterProtocols = "Addable"
1710
public struct Add<A>: Wrapper where A: Addable {
1811
public typealias WrappedType = A
1912

Sources/Abstract/Types/And.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
//
2-
// And.swift
3-
// Abstract
4-
//
5-
// Created by Elviro Rocca on 13/04/18.
6-
// Copyright © 2018 TypeLift. All rights reserved.
7-
//
8-
91
#if SWIFT_PACKAGE
102
import Operadics
113
#endif

Sources/Abstract/Types/Array.swift

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
1-
//
2-
// Array.swift
3-
// Abstract
4-
//
5-
// Created by Elviro Rocca on 13/04/18.
6-
// Copyright © 2018 TypeLift. All rights reserved.
7-
//
8-
91
#if SWIFT_PACKAGE
102
import Operadics
113
#endif
124

13-
// sourcery: fixedTypesForPropertyBasedTests = "TestStructure"
14-
// sourcery: arbitrary
15-
// sourcery: arbitraryGenericParameterProtocols = "Equatable"
5+
// sourcery: fixedTypesForPropertyBasedTests = "Int"
166
extension Array: Monoid {
177
public static var empty: Array {
188
return []

Sources/Abstract/Types/EndoFunction.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
//
2-
// EndoFunction.swift
3-
// Abstract
4-
//
5-
// Created by Elviro Rocca on 13/04/18.
6-
// Copyright © 2018 TypeLift. All rights reserved.
7-
//
8-
91
#if SWIFT_PACKAGE
102
import Operadics
113
#endif

0 commit comments

Comments
 (0)