Created
November 30, 2015 23:02
-
-
Save neonichu/adab929fdc48d745cf9d to your computer and use it in GitHub Desktop.
Slowly approaching significant Swift hipster status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func signalify<T, U, V>(p: T, _ c: (T, (Result<U>) -> ()) -> V) -> (V, Signal<U>) { | |
let s = Signal<U>() | |
let v = c(p) { s.update($0) } | |
return (v, s) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
neat!