This file contains hidden or 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
| diff --git a/Source/CarthageKit/Cartfile.swift b/Source/CarthageKit/Cartfile.swift | |
| index b1b1b46..172b3c2 100644 | |
| --- a/Source/CarthageKit/Cartfile.swift | |
| +++ b/Source/CarthageKit/Cartfile.swift | |
| @@ -274,11 +274,14 @@ public struct Dependency<V: VersionType>: Equatable { | |
| /// The project corresponding to this dependency. | |
| public let project: ProjectIdentifier | |
| + public let dependencyOf: ProjectIdentifier? | |
| + |
This file contains hidden or 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
| public func toScopedDisposable(disposable: Disposable) -> ScopedDisposable { | |
| return ScopedDisposable(disposable) | |
| } |
This file contains hidden or 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
| let values = [ "1", "foo", "3" ] | |
| // Swift 1.2 | |
| extension Array { | |
| func filterMap(@noescape transform: T -> U?) -> [U] { | |
| var results = [U]() | |
| for x in self { | |
| if let mapped = transform(x) { | |
| results.append(mapped) |
This file contains hidden or 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
| import Himotoki | |
| struct User: Decodable { ... } | |
| struct Foo: Decodable { | |
| let name: String | |
| let users: [User] | |
| static func decode(e: Extractor) -> Foo? { | |
| let create = { Foo($0) } |
This file contains hidden or 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
| func curry<A, B, C, Result>(f: (A, B, C) -> Result) -> A -> B -> C -> Result { | |
| return { a in { b in { c in f(a, b, c) } } } | |
| } | |
| struct Hoge { | |
| let a: String | |
| let b: Int | |
| let c: Bool? | |
| } |
This file contains hidden or 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
| // https://twitter.com/akisutesama/status/596501848313372672 | |
| // https://twitter.com/_ishkawa/status/596504826655088640 | |
| var god: String? = "god" | |
| func makeItFuck(x: String) -> String { | |
| return x + " fuck" | |
| } | |
| var godfuck1 = god.map { $0 + " fuck" } // String? |
This file contains hidden or 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
| import Foundation | |
| class ABC {} | |
| let abc = ABC() | |
| // in-out expression can be used for CConstVoidPointer parameter. | |
| var key: Void? | |
| objc_setAssociatedObject(abc, &key, "value", UInt(OBJC_ASSOCIATION_RETAIN_NONATOMIC)) |
This file contains hidden or 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
| protocol Num { | |
| typealias N | |
| class func zero() -> N | |
| func succ() -> N | |
| func add(other: N) -> N | |
| func multiply(other: N) -> N | |
| } | |
| extension Int8: Num { | |
| typealias N = Int8 |
This file contains hidden or 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
| RACSignal *numberSignal = @[ @1, @2, @3 ].rac_sequence.signal; | |
| // signal of @2, @4, @6 | |
| [numberSignal map:^ id (NSNumber number) { | |
| return @(number.integerValue * 2); | |
| }]; | |
| // signal of something like | |
| // @{ @"id": @1, @"name": @"Name 1" }, | |
| // @{ @"id": @2, @"name": @"Name 2" }, |
This file contains hidden or 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
| Pod::Spec.new do |s| | |
| s.name = "ReactiveCocoa" | |
| s.version = "2.1" | |
| s.summary = "A framework for composing and transforming streams of values." | |
| s.homepage = "https://github.com/blog/1107-reactivecocoa-is-now-open-source" | |
| s.author = { "Josh Abernathy" => "josh@github.com" } | |
| s.source = { :git => "https://github.com/ReactiveCocoa/ReactiveCocoa.git", :tag => "v#{s.version}" } | |
| s.license = 'MIT' | |
| s.description = "ReactiveCocoa (RAC) is an Objective-C framework for Functional Reactive Programming. It provides APIs for composing and transforming streams of values." | |