aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/data/identity.lux
blob: c15ddf66248fe7a7b3aa4ab21d4710ce14027af4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
(.using
 [library
  [lux "*"
   ["_" test (.only Test)]
   [abstract
    [monad (.only do)]
    [\\specification
     ["$[0]" functor (.only Injection Comparison)]
     ["$[0]" apply]
     ["$[0]" monad]
     ["$[0]" comonad]]]]]
 [\\library
  ["[0]" / (.only Identity)]])

(def: injection
  (Injection Identity)
  (|>>))

(def: comparison
  (Comparison Identity)
  (function (_ ==)
    ==))

(def: .public test
  Test
  (<| (_.covering /._)
      (_.for [/.Identity])
      (all _.and
           (_.for [/.functor]
                  ($functor.spec ..injection ..comparison /.functor))
           (_.for [/.apply]
                  ($apply.spec ..injection ..comparison /.apply))
           (_.for [/.monad]
                  ($monad.spec ..injection ..comparison /.monad))
           (_.for [/.comonad]
                  ($comonad.spec ..injection ..comparison /.comonad))
           )))