Seems the Clojure compiler doesn't do this by default : Does the Clojure compiler check if records and types implement protocols?
Any, say, Lein plugins that do this?
Seems the Clojure compiler doesn't do this by default : Does the Clojure compiler check if records and types implement protocols?
Any, say, Lein plugins that do this?
The amazing
core.typed
introduces "an optional type system for Clojure", as you can see on their official website.Specifically you may want to use their own
defprotocol
macro (from core.typed wiki) :Once installed, you run it via leiningen with
lein typed check
. The obvious downside is that you have to annotate your code. This is the cost to pay to increase the safety of your code by using static type checking.You may also be interested by the functions
satisfies?
, andinstance?
.