How to spec reducible collections

58 views
Skip to first unread message

David Bürgin

unread,
Jan 1, 2018, 12:39:29 PM1/1/18
to Clojure
Suppose I want to spec a function like run!. run! takes an ifn? and a
‘coll’, where the coll argument may be any reducible collection (so
coll? is really not the right choice, nor is seqable?).

I tried to construct a spec for reducible collections but failed. The
protocol used in reduce is extended to java.lang.Object, so
(satisfies? CollReduce coll) will never produce a useful answer.

How does one spec a function like run!?


--
David
Reply all
Reply to author
Forward
0 new messages