4444/// Arrows inherit from Category so we can get Composition For Free™.
4545public protocol Arrow : Category {
4646 /// Some arbitrary target our arrow can compose with.
47- typealias D
47+ associatedtype D
4848 /// Some arbitrary target our arrow can compose with.
49- typealias E
49+ associatedtype E
5050
5151 /// Type of the result of first().
52- typealias FIRST = K2 < ( A , D ) , ( B , D ) >
52+ associatedtype FIRST = K2 < ( A , D ) , ( B , D ) >
5353 /// Type of the result of second().
54- typealias SECOND = K2 < ( D , A ) , ( D , B ) >
54+ associatedtype SECOND = K2 < ( D , A ) , ( D , B ) >
5555
5656 /// Some arrow with an arbitrary target and source. Used in split().
57- typealias ADE = K2 < D , E >
57+ associatedtype ADE = K2 < D , E >
5858 /// Type of the result of ***.
59- typealias SPLIT = K2 < ( A , D ) , ( B , E ) >
59+ associatedtype SPLIT = K2 < ( A , D ) , ( B , E ) >
6060
6161 /// Some arrow from our target to some other arbitrary target. Used in fanout().
62- typealias ABD = K2 < A , D >
62+ associatedtype ABD = K2 < A , D >
6363
6464 /// Type of the result of &&&.
65- typealias FANOUT = K2 < B , ( B , D ) >
65+ associatedtype FANOUT = K2 < B , ( B , D ) >
6666
6767 /// Lift a function to an arrow.
6868 static func arr( _ : A -> B ) -> Self
@@ -92,7 +92,7 @@ public protocol Arrow : Category {
9292/// Arrows that can produce an identity arrow.
9393public protocol ArrowZero : Arrow {
9494 /// An arrow from A -> B. Colloquially, the "zero arrow".
95- typealias ABC = K2 < A , B >
95+ associatedtype ABC = K2 < A , B >
9696
9797 /// The identity arrow.
9898 static func zeroArrow( ) -> ABC
@@ -132,17 +132,17 @@ public protocol ArrowPlus : ArrowZero {
132132///
133133public protocol ArrowChoice : Arrow {
134134 /// The result of left
135- typealias LEFT = K2 < Either < A , D > , Either < B , D > >
135+ associatedtype LEFT = K2 < Either < A , D > , Either < B , D > >
136136 /// The result of right
137- typealias RIGHT = K2 < Either < D , A > , Either < D , B > >
137+ associatedtype RIGHT = K2 < Either < D , A > , Either < D , B > >
138138
139139 /// The result of +++
140- typealias SPLAT = K2 < Either < A , D > , Either < B , E > >
140+ associatedtype SPLAT = K2 < Either < A , D > , Either < B , E > >
141141
142142 /// Some arrow from a different source and target for fanin.
143- typealias ACD = K2 < B , D >
143+ associatedtype ACD = K2 < B , D >
144144 /// The result of |||
145- typealias FANIN = K2 < Either < A , B > , D >
145+ associatedtype FANIN = K2 < Either < A , B > , D >
146146
147147 /// Feed marked inputs through the argument arrow, passing the rest through unchanged to the
148148 /// output.
@@ -169,7 +169,7 @@ public protocol ArrowChoice : Arrow {
169169/// a -------> a - •
170170///
171171public protocol ArrowApply : Arrow {
172- typealias APP = K2 < ( Self , A ) , B >
172+ associatedtype APP = K2 < ( Self , A ) , B >
173173 static func app( ) -> APP
174174}
175175
@@ -185,7 +185,7 @@ public protocol ArrowApply : Arrow {
185185/// d-------•
186186///
187187public protocol ArrowLoop : Arrow {
188- typealias LOOP = K2 < ( A , D ) , ( B , D ) >
188+ associatedtype LOOP = K2 < ( A , D ) , ( B , D ) >
189189
190190 static func loop( _ : LOOP ) -> Self
191191}
0 commit comments