core-typed

Corneliu Hoffman 2023-10-20T16:46:14.558649Z

another question:

=> (t/cf (update-vals {:a 1 :b 2} inc))
(t/Map (t/U (typed.clojure/Val :a) (typed.clojure/Val :b)) Long)
Huh? should this not be (t/HMap :mandatory {:a long :b long})?

2023-10-20T17:33:36.552899Z

If the annotation has t/Map in it, then t/HMap will lose information.

2023-10-20T17:38:00.050409Z

I haven't figured out a way to encode update-vals in a type for HMap's yet.

2023-10-20T17:45:55.252059Z

It needs more work on internal intersection simplification, but I'm brainstorming a type like this:

update-vals : (t/All [[x :< (Map Any Any)] vs vs'] [(I x (Map Any vs)) [vs :-> vs'] :-> (I x (Map Any vs')])

2023-10-20T17:59:07.698359Z

It's not quite right since a new hash-map is returned. e.g., it loses sortedness etc