core-typed

2023-08-23T15:37:01.125519Z

Just merged a start at adding regex types, for now they are just syntactic sugar. Planning to hone in on the hard parts gradually.

[(t/alt (t/cat (t/? java.io.Reader))
        (t/cat java.io.Reader t/Bool)
        (t/cat java.io.Reader t/Bool t/Any (t/? t/Bool)))
 :-> t/Any]
;sugar for =>
(t/IFn [:-> t/Any]
       [java.io.Reader :-> t/Any]
       [java.io.Reader t/Bool :-> t/Any]
       [java.io.Reader t/Bool t/Any :-> t/Any]
       [java.io.Reader t/Bool t/Any t/Bool :-> t/Any])

❤️ 5
2023-08-23T15:38:16.864169Z

They make the "flat pairs" function types a little easier to read:

cc/hash-map (t/All [x y] [(t/cat x y) :* :-> (t/Map x y)])
cc/array-map (t/All [x y] [(t/cat x y) :* :-> (t/Map x y)])
cc/sorted-map (t/All [x y] [t/cat x y) :* :-> (t/Map x y)])
cc/sorted-map-by (t/All [x y] [[x x :-> t/Int] (t/cat x y) :* :-> (t/Map x y)])

2023-08-23T15:38:55.498459Z

Assuming that everyone who uses Clojure is fluent in some spec-like system.