aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/tool/compiler/meta/archive/artifact/category.lux
blob: 8286af9a8e2dd2645b4fdeb7643a4a9e79dd5809 (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
(.using
 [library
  [lux "*"
   [abstract
    [equivalence {"+" Equivalence}]]
   [data
    ["[0]" text ("[1]#[0]" equivalence)]]]])

(type: .public Category
  (Variant
   {#Anonymous}
   {#Definition Text}
   {#Analyser Text}
   {#Synthesizer Text}
   {#Generator Text}
   {#Directive Text}
   {#Custom Text}))

(implementation: .public equivalence
  (Equivalence Category)
  
  (def: (= left right)
    (case [left right]
      [{#Anonymous} {#Anonymous}]
      true
      
      (^template [<tag>]
        [[{<tag> left} {<tag> right}]
         (text#= left right)])
      ([#Definition]
       [#Analyser]
       [#Synthesizer]
       [#Generator]
       [#Directive]
       [#Custom])

      _
      false)))