Re: Prismatic Schema -- Type signature of reducing functions

2016-04-02 Thread Jason Wolfe
Simplest would be to do something like this: (def Schema (s/cond-pre s/Int (s/constrained clojure.lang.Reduced #(integer? @% although this doesn't allow you to use the schema in both places. The right way would be to make a new `Reduced` schema: (defrecord Reduced [schema]

Prismatic Schema -- Type signature of reducing functions

2016-03-31 Thread JvJ
When using functions with schema type signatures for reduce, I run into output schema errors whenever I try to short-circuit the reducing operation by wrapping the return value in reduced. How can I modify the type signature so that it accepts output values of types A and (reduced A)? --