clojure.spec Questions
2
Solved
After writing this answer, I was inspired to try to specify Clojure's destructuring language using spec:
(require '[clojure.spec :as s])
(s/def ::binding (s/or :sym ::sym :assoc ::assoc :seq ::se...
Roadblock asked 1/7, 2016 at 18:0
1
Solved
Wadler wrote an amazing paper: Propositions as Types - where he talks about the Howard-Curry correspondence, that you can check program behaviour in terms of the types of the program. (For a given ...
Acklin asked 27/5, 2016 at 14:7
2
Solved
I could not understand the intent of clojure.spec
What kind of problems does it solve?
Why should we use it?
Malanie asked 12/6, 2016 at 9:9
1
Solved
If I have defined the following record:
(defrecord Person [name id])
and the following:
(s/def ::name string?)
(s/def ::id int?)
(s/def ::person (s/keys :req-un [::name ::id]))
How can I ensu...
Sanbo asked 22/7, 2016 at 3:47
2
Solved
I am following the clojure.spec guide. I understand it is possible to declare required and optional attributes when using clojure.spec/keys.
I don't understand what is meant by optional. To me :op...
Centavo asked 30/6, 2016 at 18:59
© 2022 - 2024 — McMap. All rights reserved.