Skip to content

Instantly share code, notes, and snippets.

@drewverlee
Created November 23, 2020 00:14
Show Gist options
  • Save drewverlee/61c4f27804c48a19b209232febd8443c to your computer and use it in GitHub Desktop.
Save drewverlee/61c4f27804c48a19b209232febd8443c to your computer and use it in GitHub Desktop.
(def my-inc inc)
(def my-dec dec)
(s/fdef my-inc
:args (s/cat :x int?)
:fn #(= (inc (-> % :args :x ))
(-> % :ret))
:ret int?)
(s/fdef my-dec
:args (s/cat :x int?)
:fn #(= (dec (-> % :args :x ))
(-> % :ret))
:ret int?)
(s/fdef monoid
:args (and
(s/cat :some-fn my-inc :some-other-fn my-dec)
(= (s/args my-inc) (s/args my-dec))
(= (s/ret my-inc) (s/ret my-dec)))
:ret (s/comp s/comp my-inc my-dec))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment