Skip to content

Commit

Permalink
Merge pull request #341 from CodaFi/touch-up
Browse files Browse the repository at this point in the history
Update to Swift 5
  • Loading branch information
CodaFi authored Mar 29, 2019
2 parents 556236a + 125518d commit 6cc1136
Show file tree
Hide file tree
Showing 15 changed files with 42 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0
5.0
13 changes: 6 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ matrix:
include:
- os: osx
language: objective-c
osx_image: xcode9.3
osx_image: xcode10.2
before_install:
- git submodule update --init --recursive
script:
# Restore pod build before shipping for 3.0
# - pod lib lint
- pod lib lint
- carthage build --no-skip-current
- os: osx
language: objective-c
osx_image: xcode9.3
osx_image: xcode10.2
before_install:
- git submodule update --init --recursive
script:
Expand All @@ -31,9 +30,9 @@ matrix:
before_install:
- git submodule update --init --recursive
- wget -q -O - https://swift.org/keys/all-keys.asc | gpg --import -
- wget https://swift.org/builds/swift-4.1-release/ubuntu1404/swift-4.1-RELEASE/swift-4.1-RELEASE-ubuntu14.04.tar.gz
- tar xzf swift-4.1-RELEASE-ubuntu14.04.tar.gz
- export PATH=${PWD}/swift-4.1-RELEASE-ubuntu14.04/usr/bin:"${PATH}"
- wget https://swift.org/builds/swift-5.0-release/ubuntu1404/swift-5.0-RELEASE/swift-5.0-RELEASE-ubuntu14.04.tar.gz
- tar xzf swift-5.0-RELEASE-ubuntu14.04.tar.gz
- export PATH=${PWD}/swift-5.0-RELEASE-ubuntu14.04/usr/bin:"${PATH}"
script:
- swift test
notifications:
Expand Down
6 changes: 3 additions & 3 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "typelift/Operadics" "0.3.0"
github "typelift/SwiftCheck" "0.10.0"
github "typelift/Swiftx" "0.7.0"
github "typelift/Operadics" "0.4.0"
github "typelift/SwiftCheck" "0.12.0"
github "typelift/Swiftx" "0.8.0"
2 changes: 1 addition & 1 deletion Carthage/Checkouts/Operadics
Submodule Operadics updated 1 files
+1 −1 Package.swift
4 changes: 4 additions & 0 deletions Sources/Swiftz/Function.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,14 @@ extension Function /*: ArrowApply*/ {
}
}

/*
FIXME: This cannot work with strictness.
extension Function /*: ArrowLoop*/ {
public typealias LOOP = Function<(A, D), (B, D)>
public static func loop<B, C>(_ f : Function<(B, D), (C, D)>) -> Function<B, C> {
return Function<B, C>.arr(Function.loop(f).apply)
}
}
*/

6 changes: 0 additions & 6 deletions Sources/Swiftz/List.swift
Original file line number Diff line number Diff line change
Expand Up @@ -437,12 +437,6 @@ public struct List<Element> {
return (snd ev) <^> self.find({ ev($0).0 == key })
}

/// Returns a List of an infinite number of iteratations of applications of
/// a function to an initial value.
public static func iterate(_ f : @escaping (Element) -> Element, initial : Element) -> List<Element> {
return List(initial, self.iterate(f, initial: f(initial)))
}

/// Cycles a finite list into an infinite list.
public func cycle() -> List<Element> {
let (hd, tl) = self.next()
Expand Down
6 changes: 3 additions & 3 deletions Sources/Swiftz/OptionalExt.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ extension Optional /*: Foldable*/ {
}

extension Optional : Sequence {
public typealias Iterator = IteratorOverOne<Wrapped>
public typealias Iterator = CollectionOfOne<Wrapped>.Iterator

public func makeIterator() -> IteratorOverOne<Wrapped> {
return IteratorOverOne(_elements: self)
public func makeIterator() -> CollectionOfOne<Wrapped>.Iterator {
return CollectionOfOne.Iterator(_elements: self)
}
}

Expand Down
4 changes: 1 addition & 3 deletions Sources/Swiftz/Unit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ public func >(l : Unit, r : Unit) -> Bool {
}

extension Unit : Hashable {
public var hashValue : Int {
return 0
}
public func hash(into hasher: inout Hasher) { }
}

extension Unit : Monoid {
Expand Down
39 changes: 17 additions & 22 deletions Swiftz.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = TypeLift;
TargetAttributes = {
8240CD1B1C3A395F00EF4D29 = {
Expand All @@ -886,28 +886,29 @@
};
84A88F971A71DF7F003D53CF = {
CreatedOnToolsVersion = 6.2;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
};
84A88FA21A71DF7F003D53CF = {
CreatedOnToolsVersion = 6.2;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
};
84DF751D1B0BD17700C912B0 = {
CreatedOnToolsVersion = 6.4;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
};
84DF75271B0BD17700C912B0 = {
CreatedOnToolsVersion = 6.4;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
};
};
};
buildConfigurationList = 84A88F921A71DF7F003D53CF /* Build configuration list for PBXProject "Swiftz" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 84A88F8E1A71DF7F003D53CF;
productRefGroup = 84A88F991A71DF7F003D53CF /* Products */;
Expand Down Expand Up @@ -1489,6 +1490,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -1547,6 +1549,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -1614,8 +1617,7 @@
SWIFT_INSTALL_OBJC_HEADER = NO;
SWIFT_OBJC_INTERFACE_HEADER_NAME = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -1639,8 +1641,7 @@
SKIP_INSTALL = YES;
SWIFT_INSTALL_OBJC_HEADER = NO;
SWIFT_OBJC_INTERFACE_HEADER_NAME = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -1664,8 +1665,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "io.maxs.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -1684,8 +1684,7 @@
OTHER_SWIFT_FLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = "io.maxs.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down Expand Up @@ -1714,8 +1713,7 @@
SKIP_INSTALL = YES;
SWIFT_INSTALL_OBJC_HEADER = NO;
SWIFT_OBJC_INTERFACE_HEADER_NAME = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -1740,8 +1738,7 @@
SKIP_INSTALL = YES;
SWIFT_INSTALL_OBJC_HEADER = NO;
SWIFT_OBJC_INTERFACE_HEADER_NAME = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
Expand Down Expand Up @@ -1771,8 +1768,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -1794,8 +1790,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "io.maxs.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Swiftz.xcodeproj/xcshareddata/xcschemes/Swiftz.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down

0 comments on commit 6cc1136

Please sign in to comment.