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}]
`