aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/specification/lux/abstract/functor.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/specification/lux/abstract/functor.lux59
1 files changed, 0 insertions, 59 deletions
diff --git a/stdlib/source/specification/lux/abstract/functor.lux b/stdlib/source/specification/lux/abstract/functor.lux
deleted file mode 100644
index c64be9401..000000000
--- a/stdlib/source/specification/lux/abstract/functor.lux
+++ /dev/null
@@ -1,59 +0,0 @@
-(.require
- [library
- [lux (.except)
- [abstract
- [equivalence (.only Equivalence)]
- [monad (.only do)]]
- [control
- ["[0]" function]]
- [math
- ["[0]" random]
- [number
- ["n" nat]]]
- [test
- ["_" property (.only Test)]]]]
- [\\library
- ["[0]" / (.only Functor)]])
-
-(type .public (Injection !)
- (All (_ of)
- (-> of
- (! of))))
-
-(type .public (Comparison !)
- (All (_ of)
- (-> (Equivalence of)
- (Equivalence (! of)))))
-
-(def .public (spec injection comparison functor)
- (All (_ !)
- (-> (Injection !) (Comparison !) (Functor !)
- Test))
- (<| (do [! random.monad]
- [sample random.nat
- increase (of ! each n.+ random.nat)
- decrease (of ! each n.- random.nat)])
- (_.for [/.Functor])
- (_.coverage [/.each]
- (let [(open "/#[0]") functor
-
- identity!
- ((comparison n.=)
- (/#each function.identity (injection sample))
- (injection sample))
-
- homomorphism!
- ((comparison n.=)
- (/#each increase (injection sample))
- (injection (increase sample)))
-
- composition!
- ((comparison n.=)
- (|> (injection sample)
- (/#each increase)
- (/#each decrease))
- (|> (injection sample)
- (/#each (|>> increase decrease))))]
- (and identity!
- homomorphism!
- composition!)))))