This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-02
Channels
- # announcements (37)
- # babashka (9)
- # beginners (172)
- # calva (7)
- # cestmeetup (28)
- # chlorine-clover (27)
- # clj-kondo (2)
- # cljs-dev (45)
- # cljsrn (8)
- # clojure (185)
- # clojure-dev (27)
- # clojure-europe (6)
- # clojure-finland (3)
- # clojure-nl (5)
- # clojure-uk (13)
- # clojuredesign-podcast (4)
- # clojurescript (54)
- # conjure (19)
- # core-typed (1)
- # cursive (40)
- # datomic (9)
- # emacs (5)
- # figwheel-main (34)
- # fulcro (238)
- # graphql (14)
- # hugsql (3)
- # leiningen (4)
- # malli (6)
- # off-topic (12)
- # pedestal (5)
- # portkey (19)
- # protorepl (8)
- # rdf (2)
- # re-frame (23)
- # reagent (3)
- # reitit (16)
- # shadow-cljs (29)
- # spacemacs (12)
- # sql (1)
- # xtdb (15)
Hi, out of curiosity, how you would express the following in Typed Clojure?
data T
= A Float
| B String
| C Int Int
deriving (Eq)
So far I've come up with:
(ann-datatype A [f :- Float])
(deftype A [f])
(ann-datatype B [s :- String])
(deftype B [s])
(ann-datatype C [x :- Int, y :- Int])
(deftype C [x y])
(defalias T (U A B C))