Create a gist now

Instantly share code, notes, and snippets.

(deftyped
addInteger
[Integer :> [Integer :> Integer]]
[x y]
(+ x y))
(deftyped
addDouble
[Double :> [Double :> Double]]
[x y]
(+ x y))
(deftyped
maxDouble
[Double :> [Double :> Double]]
[x y]
(max x y))
(type-check-form
'(maxDouble (addDouble 1.0 2.0)
(addDouble 2.0 3.0)))
;=> (true)
(type-check-form
'(maxDouble (addDouble 1 2.0)
(addDouble 2.0 3.0)))
;=> ()
(type-check-form
'(addDouble 1.1 2.1))
;=>(true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment