Skip to content

Commit

Permalink
Merge pull request #314 from typelift/swift-develop
Browse files Browse the repository at this point in the history
Merge Swift 3.0 Support into Master
  • Loading branch information
CodaFi committed Sep 18, 2016
2 parents 2827502 + 0405aca commit afe8639
Show file tree
Hide file tree
Showing 92 changed files with 4,546 additions and 4,603 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Xcode
.DS_Store
build/
.build/*
Packages/*
*.pbxuser
!default.pbxuser
*.mode1v3
Expand Down
20 changes: 10 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,24 @@ matrix:
include:
- os: osx
language: objective-c
osx_image: xcode7.3
osx_image: xcode8
before_install:
- git submodule update --init --recursive
script:
- pod lib lint
# Restore pod build before shipping for 3.0
# - pod lib lint
- carthage build --no-skip-current
- os: osx
language: objective-c
osx_image: xcode7.3
osx_image: xcode8
before_install:
- git submodule update --init --recursive
script:
- set -o pipefail
- xcodebuild test -scheme Swiftz | xcpretty -c
# !!!: Make sure desired device name & OS version are suitable for the Xcode version installed on osx_image
- iOS_DEVICE_NAME="iPad Pro"
- iOS_RUNTIME_VERSION="9.3"
- iOS_DEVICE_NAME="iPad Pro (12.9 inch)"
- iOS_RUNTIME_VERSION="10.0"
# Get simulator identifier for desired device/runtime pair
- SIMULATOR_ID=$(xcrun instruments -s | grep -o "${iOS_DEVICE_NAME} (${iOS_RUNTIME_VERSION}) \[.*\]" | grep -o "\[.*\]" | sed "s/^\[\(.*\)\]$/\1/")
- echo $SIMULATOR_ID
Expand All @@ -36,12 +37,11 @@ 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-2.2.1-release/ubuntu1404/swift-2.2.1-RELEASE/swift-2.2.1-RELEASE-ubuntu14.04.tar.gz
- tar xzf swift-2.2.1-RELEASE-ubuntu14.04.tar.gz
- export PATH=${PWD}/swift-2.2.1-RELEASE-ubuntu14.04/usr/bin:"${PATH}"
- wget https://swift.org/builds/swift-3.0-release/ubuntu1404/swift-3.0-RELEASE/swift-3.0-RELEASE-ubuntu14.04.tar.gz
- tar xzf swift-3.0-RELEASE-ubuntu14.04.tar.gz
- export PATH=${PWD}/swift-3.0-RELEASE-ubuntu14.04/usr/bin:"${PATH}"
script:
# Uncomment when releasing Swift 3.0
# - swift build
- swift build
notifications:
webhooks:
urls:
Expand Down
2 changes: 1 addition & 1 deletion Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github "typelift/Swiftx"
github "typelift/Swiftx"
github "typelift/SwiftCheck"
github "typelift/Operadics"

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.2.0"
github "typelift/SwiftCheck" "v0.6.2"
github "typelift/Swiftx" "v0.4.0"
github "typelift/Operadics" "0.2.2"
github "typelift/SwiftCheck" "v0.7.0"
github "typelift/Swiftx" "0.5.0"
2 changes: 1 addition & 1 deletion Carthage/Checkouts/Operadics
Submodule Operadics updated 3 files
+1 −0 .gitignore
+112 −132 Operators.swift
+2 −0 Package.swift
16 changes: 16 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import PackageDescription

let package = Package(
name: "Swiftz",
targets: [
Target(name: "Swiftz")
],
dependencies: [
.Package(url: "https://github.com/typelift/Operadics.git", versions: Version(0,2,2)...Version(0,2,2)),
.Package(url: "https://github.com/typelift/Swiftx.git", versions: Version(0,5,0)...Version(0,5,0)),
]
)

let libSwiftz = Product(name: "Swiftz", type: .Library(.Dynamic), modules: "Swiftz")
products.append(libSwiftz)

40 changes: 40 additions & 0 deletions Sources/Applicative.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// Applicative.swift
// Swiftz
//
// Created by Maxwell Swadling on 15/06/2014.
// Copyright (c) 2014-2016 Maxwell Swadling. All rights reserved.
//

/// Applicative sits in the middle distance between a Functor and a Monad. An
/// Applicative Functor is a Functor equipped with a function (called point or
/// pure) that takes a value to an instance of a functor containing that value.
/// Applicative Functors provide the ability to operate on not just values, but
/// values in a functorial context such as Eithers, Lists, and Optionals without
/// needing to unwrap or map over their contents.
public protocol Applicative : Pointed, Functor {
/// Type of Functors containing morphisms from our objects to a target.
associatedtype FAB = K1<(A) -> B>

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

/// Additional functions to be implemented by those types conforming to the
/// Applicative protocol.
public protocol ApplicativeOps : Applicative {
associatedtype C
associatedtype FC = K1<C>
associatedtype D
associatedtype FD = K1<D>

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

/// Lift a binary function to a Functorial action.
static func liftA2(_ f : @escaping (A) -> (B) -> C) -> (Self) -> (FB) -> FC

/// Lift a ternary function to a Functorial action.
static func liftA3(_ f : @escaping (A) -> (B) -> (C) -> D) -> (Self) -> (FB) -> (FC) -> FD
}
Loading

0 comments on commit afe8639

Please sign in to comment.