Fork me on GitHub
#clojure-spec
<
2017-07-09
>
mathpunk00:07:53

This didn't seem fancy, but it gave me a stack overflow: (s/coll-of map? :kind seqable?)

mathpunk00:07:03

what am I failing to understand here?

mathpunk00:07:42

In case it's not clear, I'm attempting to express, "This here data is a sequence of maps"

mathpunk00:07:30

Since another way to express that is, (s/* map?), I'm using that. But what a strange error that was. (SOLVED)

gfredericks00:07:57

is seqable? a valid :kind?

mathpunk00:07:55

"`:kind` - a predicate or spec that the incoming collection must satisfy, such as vector?"

mathpunk00:07:12

mind you, I'm getting seqable? out of clojure.future.spec

mathpunk00:07:39

maybe i'm holding it wrong somehow

mpenet14:07:43

Couldn't it be made more efficient by conforming 1 arg at a time instead of creating a s/cat at invoke time? That would also allow to avoid & args?

mpenet14:07:39

Ah but you do this to pattern match depending on arg type for same arg length. Nevermind

mpenet14:07:53

Cool stuff

Oliver George23:07:25

hey wow. that goes beyond typing the defns. interesting stuff.

Oliver George23:07:07

I've been looking at porting some ocaml code. they rely heavily on functions with match statements which looks a lot like this. (I've been using core.match)

Oliver George23:07:28

That's pretty much sugar for the match statement

gfredericks20:07:33

okay, I released defn+spec in case you like that sort of thing https://github.com/gfredericks/schpec#comgfredericksschpecdefnspecdefn