Skip to content

Commit

Permalink
Merge pull request #32 from tigerpixel/development
Browse files Browse the repository at this point in the history
Swift 5.1
  • Loading branch information
tigerpixel authored Sep 30, 2019
2 parents fd5278f + 51932b6 commit b31909a
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
osx_image: xcode10.3
osx_image: xcode11
language: objective-c

install:
Expand Down
4 changes: 2 additions & 2 deletions Currier.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Pod::Spec.new do |s|
s.name = 'Currier'
s.version = '1.2.1'
s.version = '1.3'
s.summary = 'Fantastically easy function currying in Swift.'
s.description = <<-DESC
Produces a curried version of almost any other function. Just wrap your function in a single call ‘curry(myFunction)’ and the result will be a curried version of your original. A useful tool for working with parser combinators and other functional programming projects. Currently supports up to 14 parameters. Pull requests for improvements are welcome.
Expand All @@ -22,7 +22,7 @@ Produces a curried version of almost any other function. Just wrap your function
s.watchos.deployment_target = '2.0'
s.osx.deployment_target = '10.9'
s.tvos.deployment_target = '9.0'
s.swift_version = '5.0'
s.swift_version = '5.1'

s.source_files = 'Sources/**/*.swift'
end
6 changes: 6 additions & 0 deletions Currier.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -719,9 +719,11 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.3;
PRODUCT_BUNDLE_IDENTIFIER = com.tigerpixel.Currier;
PRODUCT_NAME = Currier;
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = NO;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
};
Expand All @@ -742,9 +744,11 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.3;
PRODUCT_BUNDLE_IDENTIFIER = com.tigerpixel.Currier;
PRODUCT_NAME = Currier;
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = NO;
SWIFT_VERSION = 5.0;
};
name = Release;
Expand Down Expand Up @@ -835,6 +839,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 10.1;
};
name = Debug;
Expand All @@ -851,6 +856,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 10.1;
};
name = Release;
Expand Down
2 changes: 1 addition & 1 deletion Currier/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.2.1</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
6 changes: 5 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:4.0
// swift-tools-version:5.1
//
// Package.swift
// Currier
Expand All @@ -13,6 +13,10 @@ import PackageDescription

let package = Package(
name: "Currier",
platforms: [
// Other platforms compile as far back as possible by default.
.macOS(.v10_10)
],
products: [
.library(name: "Currier", targets: ["Currier"])
],
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,25 @@ The unit tests provide examples of calling the curry function using different nu
There are no external requirements for this project, just Swift.

- iOS 8.0+ / macOS 10.9+ / tvOS 9.0+ / watchOS 2.0+
- Xcode 10.3+
- Swift 5.0+
- Xcode 11+
- Swift 5.1+

For older versions of Swift and Xcode, please see prior releases.

## Installation

### Swift Package Manager

The [Swift Package Manager](https://swift.org/package-manager) is the official tool for managing the distribution of Swift code. It is currently only available for all Apple platforms. It can also be used with Linux but this project does not fully suppourt that at this point.

If you use it to manage your dependencies, simply add Currier to the dependencies value of your Package.swift file.

```swift
dependencies: [
.package(url: "https://github.com/tigerpixel/Currier.git", from: "1.3")
]
```

### Cocoapods

Currier is available through [CocoaPods](https://cocoapods.org/pods/Currier). To install it, simply add the following line to your Podfile:
Expand All @@ -67,18 +79,6 @@ github "tigerpixel/Currier"

If you use Carthage to build your dependencies, make sure you have added `Currier.framework` to the "_Linked Frameworks and Libraries_" section of your target, and have included them in your Carthage framework copying build phase.

### Swift Package Manager

The [Swift Package Manager](https://swift.org/package-manager) is the official tool for managing the distribution of Swift code. It is currently only available for macOS. It can also be used with Linux but this project does not fully suppourt that at this point.

If you use it to manage your dependencies, simply add Currier to the dependencies value of your Package.swift file.

```swift
dependencies: [
.Package(url: "https://github.com/Tigerpixel/Currier.git", majorVersion: 1)
]
```

### Git Submodule

1. Add the Currier repository as a [submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules) of your application’s repository.
Expand Down
50 changes: 25 additions & 25 deletions Sources/Currier/Curry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public func curry<First, Second, Result>(_ uncurried: // Declare generic names.

return { (first: First) -> (Second) -> Result in { (second: Second) -> Result in

return uncurried(first, second)
uncurried(first, second)
}
}
}
Expand All @@ -39,7 +39,7 @@ public func curry<First, Second, Third, Result>(_ uncurried:

return { first in { second in { third in

return uncurried(first, second, third)
uncurried(first, second, third)
}
}
}
Expand All @@ -59,7 +59,7 @@ public func curry<First, Second, Third, Fourth, Result>(_ uncurried:

return { first in { second in { third in { fourth in

return uncurried(first, second, third, fourth)
uncurried(first, second, third, fourth)
}
}
}
Expand All @@ -80,7 +80,7 @@ public func curry<First, Second, Third, Fourth, Fifth, Result>(_ uncurried:

return { first in { second in { third in { fourth in { fifth in

return uncurried(first, second, third, fourth, fifth)
uncurried(first, second, third, fourth, fifth)
}
}
}
Expand All @@ -104,7 +104,7 @@ public func curry<First, Second, Third, Fourth, Fifth, Sixth, Result>(_ uncurrie

return { first in { second in { third in { fourth in { fifth in { sixth in

return uncurried(first, second, third, fourth, fifth, sixth)
uncurried(first, second, third, fourth, fifth, sixth)
}
}
}
Expand All @@ -129,7 +129,7 @@ public func curry<First, Second, Third, Fourth, Fifth, Sixth, Seventh, Result>(_

return { first in { second in { third in { fourth in { fifth in { sixth in { seventh in

return uncurried(first, second, third, fourth, fifth, sixth, seventh)
uncurried(first, second, third, fourth, fifth, sixth, seventh)
}
}
}
Expand All @@ -156,8 +156,8 @@ public func curry<First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, R
return { first in { second in { third in { fourth
in { fifth in { sixth in { seventh in { eighth in

return uncurried(first, second, third, fourth,
fifth, sixth, seventh, eighth)
uncurried(first, second, third, fourth,
fifth, sixth, seventh, eighth)
}
}
}
Expand Down Expand Up @@ -185,8 +185,8 @@ public func curry<First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, N
return { first in { second in { third in { fourth
in { fifth in { sixth in { seventh in { eighth in { ninth in

return uncurried(first, second, third, fourth, fifth,
sixth, seventh, eighth, ninth)
uncurried(first, second, third, fourth, fifth,
sixth, seventh, eighth, ninth)
}
}
}
Expand Down Expand Up @@ -218,8 +218,8 @@ public func curry<First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, N
in { fifth in { sixth in { seventh in { eighth
in { ninth in { tenth in

return uncurried(first, second, third, fourth, fifth,
sixth, seventh, eighth, ninth, tenth)
uncurried(first, second, third, fourth, fifth,
sixth, seventh, eighth, ninth, tenth)
}
}
}
Expand Down Expand Up @@ -253,9 +253,9 @@ public func curry<First, Second, Third, Fourth, Fifth, Sixth, Seventh,
in { fifth in { sixth in { seventh in { eighth
in { ninth in { tenth in { eleventh in

return uncurried(first, second, third, fourth,
fifth, sixth, seventh, eighth,
ninth, tenth, eleventh)
uncurried(first, second, third, fourth,
fifth, sixth, seventh, eighth,
ninth, tenth, eleventh)
}
}
}
Expand Down Expand Up @@ -290,9 +290,9 @@ public func curry<First, Second, Third, Fourth, Fifth, Sixth, Seventh,
in { fifth in { sixth in { seventh in { eighth
in { ninth in { tenth in { eleventh in { twelfth in

return uncurried(first, second, third, fourth,
fifth, sixth, seventh, eighth,
ninth, tenth, eleventh, twelfth)
uncurried(first, second, third, fourth,
fifth, sixth, seventh, eighth,
ninth, tenth, eleventh, twelfth)
}
}
}
Expand Down Expand Up @@ -329,9 +329,9 @@ public func curry<First, Second, Third, Fourth, Fifth, Sixth, Seventh,
in { fifth in { sixth in { seventh in { eighth
in { ninth in { tenth in { eleventh in { twelfth in { thirteenth in

return uncurried(first, second, third, fourth,
fifth, sixth, seventh, eighth,
ninth, tenth, eleventh, twelfth, thirteenth)
uncurried(first, second, third, fourth,
fifth, sixth, seventh, eighth,
ninth, tenth, eleventh, twelfth, thirteenth)
}
}
}
Expand Down Expand Up @@ -371,10 +371,10 @@ public func curry<First, Second, Third, Fourth, Fifth, Sixth, Seventh,
in { ninth in { tenth in { eleventh in { twelfth
in { thirteenth in { fourteenth in

return uncurried(first, second, third, fourth,
fifth, sixth, seventh, eighth,
ninth, tenth, eleventh, twelfth,
thirteenth, fourteenth)
uncurried(first, second, third, fourth,
fifth, sixth, seventh, eighth,
ninth, tenth, eleventh, twelfth,
thirteenth, fourteenth)
}
}
}
Expand Down
Loading

0 comments on commit b31909a

Please sign in to comment.