-
Notifications
You must be signed in to change notification settings - Fork 227
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 #29 from antitypical/hash-tag-no-dependencies
#nodependencies
- Loading branch information
Showing
11 changed files
with
50 additions
and
88 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Submodule Box
deleted from
18d05a
Submodule Either
deleted from
026d34
Submodule Prelude
deleted from
180e9a
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) 2015 Rob Rix. All rights reserved. | ||
|
||
/// Implementation details of `Result`. | ||
internal enum State<T, Error> { | ||
func analysis<Result>(@noescape #ifSuccess: T -> Result, @noescape ifFailure: Error -> Result) -> Result { | ||
switch self { | ||
case let .Success(value): | ||
return ifSuccess(value.value) | ||
case let .Failure(value): | ||
return ifFailure(value.value) | ||
} | ||
} | ||
|
||
case Success(Box<T>) | ||
case Failure(Box<Error>) | ||
} | ||
|
||
internal final class Box<T> { | ||
init(_ value: T) { | ||
self.value = value | ||
} | ||
|
||
let value: T | ||
} |