This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-27
Channels
- # announcements (8)
- # babashka (7)
- # beginners (24)
- # biff (5)
- # calva (17)
- # cider (1)
- # clj-kondo (4)
- # clojure (61)
- # clojure-europe (5)
- # clojure-norway (19)
- # clojurescript (17)
- # conjure (1)
- # core-typed (14)
- # cursive (9)
- # datomic (7)
- # events (2)
- # figwheel (2)
- # helix (1)
- # honeysql (4)
- # jobs (3)
- # lsp (3)
- # malli (2)
- # nrepl (13)
- # off-topic (9)
- # pathom (6)
- # pedestal (3)
- # polylith (3)
- # portal (7)
- # reagent (4)
- # reitit (2)
- # shadow-cljs (49)
- # tools-deps (8)
- # vim (3)
Any chance for a look at https://github.com/metosin/reitit/pull/506? The overhead of keywordizing the keys can be larger than any other component in the server 😿
💯 2
Also found out how to compose binary functions, which would enable compiling the request coercers:
(defn compile-coerce-request [coercers]
(reduce-kv
(fn [f-acc k coercer]
(let [f (fn assoc-coercered [acc request]
(impl/fast-assoc acc k (coercer request)))]
(fn comp-coercsion [acc request]
(let [ret (f-acc acc request)]
(f ret request)))))
(fn [acc _request] {})
coercers))
((compile-coerce-request
{:a #(inc (get % :x))
:b #(dec (get % :y))
:c #(dec (get % :z))
})
{}
{:x 1 :y 2 :z 3})