aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/data/identity.lux
blob: f37f94b99470d2306ef679e82d06565bb75aabc7 (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
39
(.module:
  [library
   [lux "*"
    [abstract
     [functor {"+" [Functor]}]
     [apply {"+" [Apply]}]
     [monad {"+" [Monad]}]
     [comonad {"+" [CoMonad]}]]
    [control
     ["[0]" function]]]])

(type: .public (Identity a)
  a)

(implementation: .public functor
  (Functor Identity)

  (def: each function.identity))

(implementation: .public apply
  (Apply Identity)

  (def: &functor ..functor)
  (def: (on fa ff)
    (ff fa)))

(implementation: .public monad
  (Monad Identity)
  
  (def: &functor ..functor)
  (def: in function.identity)
  (def: conjoint function.identity))

(implementation: .public comonad
  (CoMonad Identity)
  
  (def: &functor ..functor)
  (def: out function.identity)
  (def: disjoint function.identity))