Skip to content

Commit

Permalink
Merge pull request #28 from facile-it/ToTheSwiftResult
Browse files Browse the repository at this point in the history
To the swift result
  • Loading branch information
AndreaRR18 authored Jul 26, 2019
2 parents fffdd25 + 4d3a6cb commit 2835692
Show file tree
Hide file tree
Showing 19 changed files with 730 additions and 4,503 deletions.
4 changes: 2 additions & 2 deletions Sources/FunctionalKit/Adapter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public extension Writer {

public extension Result {
enum iso {
public static var coproduct: Iso<Result,Coproduct<Failure,Parameter>> {
return Iso<Result,Coproduct<Failure,Parameter>>.init(
public static var coproduct: Iso<Result,Coproduct<Failure,Success>> {
return Iso<Result,Coproduct<Failure,Success>>.init(
from: {
switch $0 {
case let .success(value):
Expand Down
2 changes: 1 addition & 1 deletion Sources/FunctionalKit/Array.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public extension Array {
}
}

func traverse <A,F> (_ transform: (ParameterType) -> Result<F,A>) -> Result<F,Array<A>> {
func traverse <A,F> (_ transform: (ParameterType) -> Result<A,F>) -> Result<Array<A>,F> {
return reduce(Result.pure([])) { previous, element in
Result.pure(f.curry(++)) <*> previous <*> transform(element)
}
Expand Down
Loading

0 comments on commit 2835692

Please sign in to comment.