aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/type/poly/functor.lux
blob: 4aec871cfcb7589fb466bd1ff309864dfd68135e (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
38
(.module:
  [library
   [lux "*"
    ["@" target]
    [abstract
     [monad {"+" [do]}]
     [functor {"+" [Functor]}
      [\\poly
       ["[0]" /]]]]
    ["r" math/random {"+" [Random]}]
    ["_" test {"+" [Test]}]
    [control
     ["[0]" state]]
    [data
     ["[0]" identity]]]])

(for [@.old (as_is)]
     (as_is (def: maybe_functor
              (Functor .Maybe)
              (/.functor .Maybe))

            (def: list_functor
              (Functor .List)
              (/.functor .List))

            (def: state_functor
              (All (_ s) (Functor (state.State s)))
              (/.functor state.State))

            (def: identity_functor
              (Functor identity.Identity)
              (/.functor identity.Identity))))

(def: .public test
  Test
  (<| (_.covering /._)
      (_.cover [/.functor]
               true)))