aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/meta/compiler/language/lux/synthesis/access.lux
blob: fc1d14e8f80e34783b9aebdff4f5897571ded469 (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
(.require
 [library
  [lux (.except)
   [abstract
    [equivalence (.only Equivalence)]
    [hash (.only Hash)]]
   [data
    ["[0]" sum]
    [text
     ["%" \\format (.only Format)]]]]]
 ["[0]" /
  ["[1][0]" side (.only Side)]
  ["[1][0]" member (.only Member)]])

(type .public Access
  (Variant
   {#Side Side}
   {#Member Member}))

(def .public (format it)
  (Format Access)
  (when it
    {#Side it}
    (/side.format it)
    
    {#Member it}
    (/member.format it)))

(def .public hash
  (Hash Access)
  (all sum.hash
       /side.hash
       /member.hash
       ))

(def .public equivalence
  (Equivalence Access)
  (at ..hash equivalence))