aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/tool/compiler/meta/archive/descriptor.lux
blob: 2ae89cf4e0e520cdecedec374aca5d9dc215ef10 (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
40
41
42
43
44
45
46
47
48
(.module:
  [lux (#- Module)
   [control
    ["<>" parser
     ["<b>" binary (#+ Parser)]]]
   [data
    ["." text]
    [collection
     [set (#+ Set)]]
    [format
     ["." binary (#+ Writer)]]]
   [world
    [file (#+ Path)]]]
  [//
   ["." artifact (#+ Registry)]])

(type: #export Module
  Text)

(type: #export Descriptor
  {#name Module
   #file Path
   #hash Nat
   #state Module-State
   #references (Set Module)
   #registry Registry})

(def: #export writer
  (Writer Descriptor)
  ($_ binary.and
      binary.text
      binary.text
      binary.nat
      binary.any
      (binary.set binary.text)
      artifact.writer
      ))

(def: #export parser
  (Parser Descriptor)
  ($_ <>.and
      <b>.text
      <b>.text
      <b>.nat
      (\ <>.monad wrap #.Cached)
      (<b>.set text.hash <b>.text)
      artifact.parser
      ))