aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/world/environment.lux
blob: 8a94cc818ec3d8491361a19c45e869b46d1e20bc (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
49
50
51
52
53
54
55
56
57
58
(.require
 [library
  [lux (.except)
   ["$" documentation]
   [data
    ["[0]" text (.only \n)
     ["%" \\format (.only format)]]]]]
 ["[0]" \\parser]
 [\\library
  ["[0]" /]])

(.def \\parser
  (.List $.Module)
  ($.module \\parser._
            ""
            [($.definition \\parser.unknown_property)

             ($.definition \\parser.Property
               "A property in the environment.")

             ($.definition \\parser.Environment
               "An abstraction for environment variables of a program.")

             ($.definition (\\parser.Parser it)
               "A parser of environment variables of a program.")

             ($.definition \\parser.empty
               "An empty environment.")

             ($.definition \\parser.property
               ""
               [(property name)])

             ($.definition \\parser.result
               (format "Executes a parser against the given environment variables."
                       \n "Does not check whether all environment variables were parsed, since they're usually an open set.")
               [(result parser environment)])]
            []))

(.def .public documentation
  (.List $.Module)
  ($.module /._
            ""
            [($.definition /.unknown_environment_variable)
             ($.definition /.async)
             ($.definition /.default)

             ($.definition (/.Environment !)
               "Access to ambient environment data and the capacity to exit the program.")

             ($.definition /.environment
               "Assembles the environment variables available to the program."
               [(environment monad program)])

             ($.definition /.mock
               ""
               [(mock environment home directory)])]
            [..\\parser]))