Log in
Sign up
See new Tweets

Conversation

Andy Matuschak
@andy_matuschak
·
Oct 15, 2014
Had fun making a type-safe value-oriented collection view data source in Swift today.
gist.github.com
Type-safe value-oriented collection view data source
Type-safe value-oriented collection view data source - CollectionViewDataSource.swift
4
2
48
Andy Matuschak
@andy_matuschak
Replying to
@indragie
@indragie
Yeah. That's kinda nicer.
3:00 AM · Oct 15, 2014·Twitter for Mac
Andy Matuschak
@andy_matuschak
·
Oct 15, 2014
Replying to
@andy_matuschak
@indragie
Although in practice, the CollectionType I'm passing to these things will probably be lazy, which would want ref semantics.
1
2
Andy Matuschak
@andy_matuschak
·
Oct 15, 2014
@indragie
Probably worth noting that you can implement value-ish lazy things, but there are extra considerations…
intersections.tumblr.com
Unobservable effects with value types
Value types (struct, enum, and tuples) in Swift have some key advantages over reference types (primarily class) when it comes to expressiveness—which we’ll define for the purposes of this discussio...
1