This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-15
Channels
- # announcements (11)
- # aws (5)
- # babashka (69)
- # beginners (138)
- # calva (5)
- # cider (11)
- # cljsrn (3)
- # clojure (86)
- # clojure-europe (8)
- # clojure-italy (2)
- # clojure-nl (5)
- # clojure-norway (13)
- # clojure-uk (21)
- # clojurescript (13)
- # conjure (58)
- # core-typed (2)
- # data-science (2)
- # datomic (5)
- # degree9 (4)
- # emotion-cljs (4)
- # figwheel-main (8)
- # fulcro (29)
- # graalvm (70)
- # interop (2)
- # joker (1)
- # lein-figwheel (2)
- # leiningen (13)
- # liberator (4)
- # off-topic (21)
- # pedestal (2)
- # re-frame (10)
- # shadow-cljs (42)
- # spacemacs (29)
- # spire (1)
- # tools-deps (11)
- # vim (26)
- # xtdb (5)
just wrote a typing rule for async/go
(defmethod -unanalyzed-special 'clojure.core.async/go
[{:keys [form env] :as expr} expected]
(let [;; type check the go body
cbody (-> `(do ~@(rest form))
(ana2/unanalyzed env)
check-expr)]
(-> expr
;; put expanded body back into go call
(update :form (fn [form]
(with-meta (list `async/go (emit-form/emit-form cbody))
(meta form))))
;; evaluate partially expanded go call if top-level
ana2/eval-top-level
;; use checked body to populate return type and check against expected
(assoc
u/expr-type (below/maybe-check-below
(r/ret (c/-name `tasync/Chan (-> cbody u/expr-type :t))
(fo/-true-filter))
expected)
:tag nil))))
News update: "Performance improvements (25%), async type rules" https://www.patreon.com/posts/38246734