Skip to content

Instantly share code, notes, and snippets.

View alessandro-martin's full-sized avatar

Alessandro Martin alessandro-martin

View GitHub Profile

Keybase proof

I hereby claim:

  • I am alessandro-martin on github.
  • I am alessandromartin (https://keybase.io/alessandromartin) on keybase.
  • I have a public key ASBw8TbA9KyorMe8iR06bmLiK5mj3Btabhno_jmZVmt7oQo

To claim this, I am signing this object:

@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 {
@alessandro-martin
alessandro-martin / gist:9fa91e3e7106cc30779a0df682287477
Last active June 6, 2017 21:26
New in Xcode 9,  has fixed this bug I filed last February
// Up until Xcode 8.3.2
// switching over a type's static properties required full namespace qualification
// This wouldn't compile
// Fixed in Xcode 9 :D
extension String {
static let firstSection: String = "firstSection"
static let secondSection: String = "secondSection"
}