Skip to content

Instantly share code, notes, and snippets.

View PasiHeikkinen's full-sized avatar

Pasi Heikkinen PasiHeikkinen

View GitHub Profile
func lift<A1, A2, R>(_ f: @escaping (A1, A2) -> R) -> ((Observable<A1>, Observable<A2>) -> Observable<R>) {
return { (a1: Observable<A1>, a2: Observable<A2>) -> Observable<R> in
return Observable.combineLatest(a1, a2).map(f)
}
}
func lift<A, R>(_ f: @escaping (A) -> Observable<R>) -> ((Observable<A>) -> Observable<R>) {
return { (a: Observable<A>) -> Observable<R> in
a.flatMap(f)
}

Keybase proof

I hereby claim:

  • I am pasiheikkinen on github.
  • I am pasiheikkinen (https://keybase.io/pasiheikkinen) on keybase.
  • I have a public key ASAlUd53VqSJNvDcZ11Rs0LsT8z3AQoqu-vWoeiqQe3O4wo

To claim this, I am signing this object:

(defmacro my-route
[method path handler]
`(~method ~path {cookies# :cookies params# :params} (~handler cookies# params#)))
(defmacro def-my-routes
[name & body]
(let [stuff (map (fn [route] `(my-route ~@route)) body)]
`(defroutes ~name
~@stuff)))
(defmacro my-GET
[path handler]
`(GET ~path {cookies# :cookies params# :params} (~handler cookies# params#)))