Skip to content

Commit

Permalink
Look, grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
CodaFi committed Jul 5, 2015
1 parent 2693eed commit eb16dbb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Focus/Lens.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ public struct Lens<S, T, A, B> {
self.run = run
}

/// Creates a lens from a getter/setter pair.
public init(get : S -> A, set : (S, B) -> T) {
self.init({ v in IxStore(get(v)) { set(v, $0) } })
}

/// Creates a lens that uses a applies a modifier function to any values
/// Creates a lens that transforms set values by a given function before they are returned.
public init(get : S -> A, modify : (S, A -> B) -> T) {
self.init(get: get, set: { v, x in modify(v) { _ in x } })
}
Expand Down

0 comments on commit eb16dbb

Please sign in to comment.