robertluo / fun-map

a map blurs the line between identity, state and function

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

currying function wrapper

robertluo opened this issue · comments

Funmap is a way for turning functions into associative structure, with the feature to fulfill its arguments within the map.

Maybe we can also turn it automatically currying:

(def fm
  (fun-map
    {:a 1
     :b 3
     :d (fw {:keys [a b] :with [c]} (+ a b c))}))   ;`d` become a virtual map

(get-in fm [:d 5]) ;=> 9, 5 become the argument c