Skip to content

Commit

Permalink
Remove return from single-expression closure
Browse files Browse the repository at this point in the history
  • Loading branch information
alskipp authored and Tony DiPasquale committed May 26, 2015
1 parent bd4d4a5 commit 82696d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Argo/Functions/sequence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import Runes

func sequence<T>(xs: [Decoded<T>]) -> Decoded<[T]> {
return reduce(xs, pure([])) { accum, elem in
return curry(+) <^> accum <*> (pure <^> elem)
curry(+) <^> accum <*> (pure <^> elem)
}
}

func sequence<T>(xs: [String: Decoded<T>]) -> Decoded<[String: T]> {
return reduce(xs, pure([:])) { accum, elem in
return curry(+) <^> accum <*> ({ [elem.0: $0] } <^> elem.1)
curry(+) <^> accum <*> ({ [elem.0: $0] } <^> elem.1)
}
}

0 comments on commit 82696d9

Please sign in to comment.