Skip to content

Instantly share code, notes, and snippets.

@c-spencer
Created September 21, 2013 00:18
Show Gist options
  • Save c-spencer/6645616 to your computer and use it in GitHub Desktop.
Save c-spencer/6645616 to your computer and use it in GitHub Desktop.
(cf (fn [m] (conj [0] (if m 1 2))))
; [(Fn [Any -> [(Value 0) (U (Value 1) (Value 2))]]) {:then tt, :else ff}]
(cf (fn [{:keys [a] :as m} c]
(merge m {:b (+ a c) :c c}))
['{:a Number} Number -> '{:a Number :b Number :c Number}])
; (Fn [(HMap :mandatory {:a Number}) Number -> (HMap :mandatory {:a Number, :b Number, :c Number})])
(cf (fn [m] (dissoc {:a 1 :b 2} (if m :a :b))))
; [(Fn [Any -> (U (HMap :mandatory {:a (Value 1)} :complete? true)
; (HMap :mandatory {:b (Value 2)} :complete? true))]) {:then tt, :else ff}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment