Skip to content

Commit 78665a0

Browse files
committed
Merge pull request #298 from CodaFi/into-the-wild-blue-yonder
Update to Swift 2.2
2 parents b556b74 + 2cfbc2f commit 78665a0

25 files changed

+70
-121
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
language: objective-c
2-
osx_image: xcode7.2
2+
osx_image: xcode7.3
33
env:
44
- TEST_CONFIG="RELEASE"
55
- TEST_CONFIG="PODS"
66

77
before_install: true
88
install: true
99
script:
10-
- if [[ "$TEST_CONFIG" == "RELEASE" ]]; then script/cibuild Swiftz Swiftz-iOS ; fi
10+
- if [[ "$TEST_CONFIG" == "RELEASE" ]]; then script/cibuild Swiftz ; fi
1111
- if [[ "$TEST_CONFIG" == "RELEASE" ]]; then xcodebuild test -scheme Swiftz-tvOS -destination 'platform=tvOS Simulator,name=Apple TV 1080p' ; fi
1212
- if [[ "$TEST_CONFIG" == "RELEASE" ]]; then xcodebuild build -scheme Swiftz-watchOS -destination 'platform=watchOS Simulator,name=Apple Watch - 42mm' ; fi
1313
- if [[ "$TEST_CONFIG" == "PODS" ]]; then pod lib lint; fi

Cartfile.resolved

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
github "typelift/Operadics" "e21d7edbe02c7e34ae6a33ba59d278b613b2ce44"
2-
github "typelift/SwiftCheck" "v0.4.4"
3-
github "typelift/Swiftx" "v0.3.2"
1+
github "typelift/Operadics" "8117a84bb4111814c35af80285f3f9baff290d7e"
2+
github "typelift/SwiftCheck" "v0.6.0"
3+
github "typelift/Swiftx" "v0.4.0"

Carthage/Checkouts/Operadics

Swiftz.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ Pod::Spec.new do |s|
1212
s.tvos.deployment_target = "9.1"
1313
s.watchos.deployment_target = "2.1"
1414
s.source = { :git => "https://github.com/typelift/Swiftz.git", :tag => "v#{s.version}", :submodules => true }
15-
s.source_files = "Swiftz/*.swift", "**/Swiftx/*.swift", "Carthage/Checkouts/Operadics/*.swift"
15+
s.source_files = "Swiftz/*.swift", "**/Swiftx/*.swift", "Carthage/Checkouts/Operadics/Operators.swift"
1616
end

Swiftz/Applicative.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313
/// needing to unwrap or map over their contents.
1414
public protocol Applicative : Pointed, Functor {
1515
/// Type of Functors containing morphisms from our objects to a target.
16-
typealias FAB = K1<A -> B>
16+
associatedtype FAB = K1<A -> B>
1717

1818
/// Applies the function encapsulated by the Functor to the value encapsulated by the receiver.
1919
func ap(f : FAB) -> FB
2020
}
2121

2222
/// Additional functions to be implemented by those types conforming to the Applicative protocol.
2323
public protocol ApplicativeOps : Applicative {
24-
typealias C
25-
typealias FC = K1<C>
26-
typealias D
27-
typealias FD = K1<D>
24+
associatedtype C
25+
associatedtype FC = K1<C>
26+
associatedtype D
27+
associatedtype FD = K1<D>
2828

2929
/// Lift a function to a Functorial action.
3030
static func liftA(f : A -> B) -> Self -> FB

Swiftz/Arrow.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,25 @@
4444
/// Arrows inherit from Category so we can get Composition For Free™.
4545
public 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.
9393
public 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
///
133133
public 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
///
171171
public 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
///
187187
public 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
}

Swiftz/Bifunctor.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
/// FIXME: Something in swiftc doesn't like it when conforming instances use a generic <D> in
1212
/// definitions of rightMap. It has been removed in all instances for now.
1313
public protocol Bifunctor {
14-
typealias L
15-
typealias B
16-
typealias R
17-
typealias D
18-
typealias PAC = K2<L, R>
19-
typealias PAD = K2<L, D>
20-
typealias PBC = K2<B, R>
21-
typealias PBD = K2<B, D>
14+
associatedtype L
15+
associatedtype B
16+
associatedtype R
17+
associatedtype D
18+
associatedtype PAC = K2<L, R>
19+
associatedtype PAD = K2<L, D>
20+
associatedtype PBC = K2<B, R>
21+
associatedtype PBD = K2<B, D>
2222

2323
/// Map two functions individually over both sides of the bifunctor at the same time.
2424
func bimap(f : L -> B, _ g : R -> D) -> PBD

Swiftz/Category.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616
/// function is also called >>>.
1717
public protocol Category {
1818
/// Source
19-
typealias A
19+
associatedtype A
2020
/// Target
21-
typealias B
21+
associatedtype B
2222
/// Other Target; Usually Any.
23-
typealias C
23+
associatedtype C
2424

2525
/// The identity category
26-
typealias CAA = K2<A, A>
26+
associatedtype CAA = K2<A, A>
2727
/// A Category we can compose with.
28-
typealias CBC = K2<B, C>
28+
associatedtype CBC = K2<B, C>
2929
/// The composition of this Category with the Category above.
30-
typealias CAC = K2<A, C>
30+
associatedtype CAC = K2<A, C>
3131

3232
/// The identity morphism.
3333
static func id() -> CAA

0 commit comments

Comments
 (0)