Skip to content

Instantly share code, notes, and snippets.

View alessandro-martin's full-sized avatar

Alessandro Martin alessandro-martin

View GitHub Profile
@alessandro-martin
alessandro-martin / sample.swift
Created July 9, 2017 20:37 — forked from chriseidhof/sample.swift
Observable References
import Foundation
// A lens is a getter and a setter combined
struct Lens<Whole, Part> {
let get: (Whole) -> Part
let set: (inout Whole, Part) -> ()
}
// We can create a lens from a key path
extension Lens {