Skip to content

Support per-arity :args and :fn specs #14

Open
@alexandergunnarson

Description

First of all, Orchestra is great! It's extremely useful, and employs some ideas that are similar to what I'm currently pursuing in one of my libraries.

One feature set I would love to see is to be able to add :args and :fn validation on a per-arity basis:

(defn-spec sym whole-fn-ret-spec
  ([a arg-spec-a, b arg-spec-b]
    {:pre  (s/and a b) ; to be `s/and`ed to the other arity-specific `:args` specs
     :post ((if a number? string?) %)} ; arity-specific `:fn` spec
    ...))

What do you think about this?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions