-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #314 from typelift/swift-develop
Merge Swift 3.0 Support into Master
- Loading branch information
Showing
92 changed files
with
4,546 additions
and
4,603 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# Xcode | ||
.DS_Store | ||
build/ | ||
.build/* | ||
Packages/* | ||
*.pbxuser | ||
!default.pbxuser | ||
*.mode1v3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
Submodule SwiftCheck
updated
42 files
Submodule Swiftx
updated
32 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
Oops, something went wrong.