Last active
August 29, 2015 14:05
-
-
Save Janiczek/e9c74130f18dd17c6d11 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns untitled.core | |
(:require [schema.core :as s] | |
[schema.macros :as sm])) | |
(def Length s/Int) | |
(def Count s/Int) | |
(sm/defn add-lengths :- Length | |
[a :- Length | |
b :- Length] | |
(+ a b)) | |
(sm/def a-length :- Length 1) | |
(sm/def a-count :- Count 2) | |
(sm/with-fn-validation | |
(add-lengths a-length a-length) ;; okay | |
(add-lengths a-length a-count) ;; <---------- I want this to crash | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment