Created
November 23, 2020 00:14
-
-
Save drewverlee/61c4f27804c48a19b209232febd8443c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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