https://gist.github.com/joerupen/efb104ea81fce9d3a77d
`
;; core.type的交集在值上不工作吗?
(ns user-types.demo
(:require [clojure.core.typed :as t]))
(t/defalias week-days "mon-fri"
(t/U (t/Val :mon) (t/Val :tue) (t/Val :wed)
(t/Val :thu) (t/Val :fri) ))
(t/defalias party-days "有派对活动的天数"
(t/U (t/Val :fri) (t/Val :sat)))
(t/defalias party-days-of-the-week "一周中举行派对活动的那天"
(t/I week-days party-days))
(t/defn party-during-week [x :- party-days-of-the-week] x)
;; 然后在REPL中
(check-ns 'user-types.demo)
(t/cf (u/party-during-week :wed))
;; 哎呀,没有错误?只有星期五应该被允许
=> [(t/I u/party-days u/week-days) {:then tt, :else ff}]
`