Skip to content

Commit a7a20a5

Browse files
committed
Merge pull request #21 from CodaFi/beta-five
Beta Five Updates
2 parents c99f8b1 + 9deb180 commit a7a20a5

File tree

10 files changed

+25
-8
lines changed

10 files changed

+25
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ DerivedData
1717
*.ipa
1818
*.xcuserstate
1919
*.xcscmblueprint
20+
Cartfile.resolved
2021
Carthage/
2122

2223
# CocoaPods

Cartfile.resolved

Lines changed: 0 additions & 1 deletion
This file was deleted.

Concurrent.xcodeproj/project.pbxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
82BA2A041B75E8CA00F9F201 /* ConcurrentSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82BA2A031B75E8CA00F9F201 /* ConcurrentSpec.swift */; };
11+
82BA2A051B75E8CA00F9F201 /* ConcurrentSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82BA2A031B75E8CA00F9F201 /* ConcurrentSpec.swift */; };
1012
8410224B1B1A9F9E00E799A0 /* SwiftCheck.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84A53E011B1A9F1900E8A107 /* SwiftCheck.framework */; };
1113
8410224F1B1A9FAC00E799A0 /* SwiftCheck.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84A53DFD1B1A9F1900E8A107 /* SwiftCheck.framework */; };
1214
841022501B1A9FBE00E799A0 /* SwiftCheck.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84A53DFD1B1A9F1900E8A107 /* SwiftCheck.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
@@ -134,6 +136,7 @@
134136
/* End PBXCopyFilesBuildPhase section */
135137

136138
/* Begin PBXFileReference section */
139+
82BA2A031B75E8CA00F9F201 /* ConcurrentSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConcurrentSpec.swift; sourceTree = "<group>"; };
137140
841022531B1AA00D00E799A0 /* MVarSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MVarSpec.swift; sourceTree = "<group>"; };
138141
84152B791A818C95006387D5 /* SVar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SVar.swift; sourceTree = "<group>"; };
139142
8434F98019E9CD76008D9909 /* Concurrent.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Concurrent.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -246,6 +249,7 @@
246249
8434F98F19E9CD76008D9909 /* ConcurrentTests */ = {
247250
isa = PBXGroup;
248251
children = (
252+
82BA2A031B75E8CA00F9F201 /* ConcurrentSpec.swift */,
249253
84F467811B1B9244002A4C4C /* ChanSpec.swift */,
250254
841022531B1AA00D00E799A0 /* MVarSpec.swift */,
251255
84EA2C5B1B240C4D0001FB3F /* SVarSpec.swift */,
@@ -514,6 +518,7 @@
514518
8434F9D019E9CE1D008D9909 /* PiCalculus.swift in Sources */,
515519
84EA2C5A1B23AE5F0001FB3F /* MVarSpec.swift in Sources */,
516520
84EA2C591B23AE5D0001FB3F /* ChanSpec.swift in Sources */,
521+
82BA2A041B75E8CA00F9F201 /* ConcurrentSpec.swift in Sources */,
517522
);
518523
runOnlyForDeploymentPostprocessing = 0;
519524
};
@@ -541,6 +546,7 @@
541546
84F467831B1B9244002A4C4C /* ChanSpec.swift in Sources */,
542547
841022551B1AA00D00E799A0 /* MVarSpec.swift in Sources */,
543548
84A53D6F1B1A8FC400E8A107 /* PiCalculus.swift in Sources */,
549+
82BA2A051B75E8CA00F9F201 /* ConcurrentSpec.swift in Sources */,
544550
);
545551
runOnlyForDeploymentPostprocessing = 0;
546552
};

Concurrent/Chan.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public struct Chan<A> {
5050

5151
/// Writes a list of values to a channel.
5252
public func writeList(xs : [A]) {
53-
xs.map({ self.write($0) })
53+
xs.forEach(self.write)
5454
}
5555

5656
/// Returns whether the channel is empty.

Concurrent/Future.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public struct Future<A> {
5454

5555
public func forkFutures<A>(ios : [() -> A]) -> Chan<Optional<A>> {
5656
let c : Chan<Optional<A>> = Chan()
57-
_ = ios.map({ forkFuture($0) }).map({ f in f.then({ c.write($0) }) })
57+
ios.map(forkFuture).forEach { f in f.then(c.write) }
5858
return c
5959
}
6060

@@ -80,7 +80,7 @@ public func forkFuture<A>(io : () throws -> A) -> Future<A> {
8080
p.threadID.modify_({ _ in .None })
8181
let val = p.complete(paranoid)
8282
let sTodo = p.finalizers.swap([])
83-
let _ = sTodo.map(p.runFinalizerWithOptional(val))
83+
sTodo.forEach { _ in p.runFinalizerWithOptional(val) }
8484
}
8585

8686
_ = forkIO {

ConcurrentTests/ChanSpec.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import Concurrent
1010
import XCTest
1111
import SwiftCheck
12-
import Swiftz
1312

1413
private enum Action {
1514
case NewChan
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//
2+
// ConcurrentSpec.swift
3+
// Concurrent
4+
//
5+
// Created by Robert Widmann on 8/8/15.
6+
// Copyright © 2015 TypeLift. All rights reserved.
7+
//
8+
9+
import XCTest
10+
11+
public func error<A>(x : String) -> A {
12+
XCTFail(x)
13+
fatalError(x)
14+
}

ConcurrentTests/MVarSpec.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import Concurrent
1010
import XCTest
1111
import SwiftCheck
12-
import Swiftz
1312

1413
private enum Action {
1514
case NewEmptyMVar

ConcurrentTests/SVarSpec.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import Concurrent
1010
import XCTest
1111
import SwiftCheck
12-
import Swiftz
1312

1413
private enum Action {
1514
case NewEmptySVar

0 commit comments

Comments
 (0)