core-typed

escherize 2025-07-14T23:13:00.490449Z

is https://typedclojure.org/guides/getting_started still the best place to start learning about typed clojure?

2025-09-03T16:40:49.973859Z

unfortunately yes. I'm drafting a new documentation site which I haven't released.

❤️ 1
escherize 2025-09-03T16:48:28.862549Z

Thank you. I have been noodling over how to reimplement this style in clojure: https://tour.gleam.run/data-types/record-pattern-matching/

escherize 2025-09-03T16:48:42.258949Z

(Basically, exhaustive tagged unions)

escherize 2025-09-03T16:50:27.700589Z

aside: I think that's the best onboarding ive ever seen for a language. maybe i had just the right priors to understand it, but it is a super slick site

1
2025-09-03T16:52:08.867659Z

(t/defalias Starfish '{:tag ':Starfish :name t/Str, :favourite_colour t/Str})
(t/defalias Jellyfish '{:tag ':Jellyfish :name t/Str, :jiggly t/Bool})

(t/defalias Fish (t/U Starfish JellyFish))

❤️ 1
🤩 1
2025-09-03T16:53:58.485079Z

(t/ann handle_fish [Fish :-> nil])
(defn handle_fish [fish]
  (case (:tag fish)
    :Starfish (println (:favourite_colour fish))
    :Jellyfish (println (:name fish)))

2025-09-03T16:54:12.086569Z

that should work