aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/type/check.lux
blob: 4cf4e2e69ffa482e35c804cbcd8735fd521de309 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
(.using
 [library
  [lux {"-" and}
   ["$" documentation (.only documentation:)]
   [control
    ["<>" parser
     ["<[0]>" code]]]
   [data
    ["[0]" text (.only \n)
     ["%" format (.only format)]]]
   [macro
    ["[0]" template]]]]
 [\\library
  ["[0]" /]])

(documentation: /.Var
  "The ID for a type-variable in a type-checking context.")

(documentation: (/.Check it)
  "A type-checking computation which may fail or yield a value.")

(documentation: /.result
  ""
  [(result context proc)])

(documentation: /.failure
  ""
  [(failure message)])

(documentation: /.assertion
  ""
  [(assertion message test)])

(documentation: /.except
  ""
  [(except exception message)])

(documentation: /.existential
  "A brand-new existential type.")

(documentation: /.bind
  (format "Attemmpts to buy a type-variable."
          \n "Fails if the variable has been bound already.")
  [(bind type id)])

(documentation: /.var
  "A brand-new (unbound) type-variable.")

(documentation: /.fresh_context
  "An empty/un-used type-checking context.")

(documentation: /.check
  "Type-check to ensure that the 'expected' type subsumes the 'actual' type."
  [(check expected actual)])

(documentation: /.subsumes?
  "A simple type-checking function that just returns a yes/no answer."
  [(subsumes? expected actual)])

(documentation: /.context
  "The current state of the type-checking context.")

(documentation: /.clean
  "Resolves every bound type-variable to yield a new type that is as resolved as possible."
  [(clean inputT)])

(.def: .public documentation
  (.List $.Module)
  ($.module /._
            "Type-checking functionality."
            [..Var
             ..Check
             ..result
             ..failure
             ..assertion
             ..except
             ..existential
             ..bind
             ..var
             ..fresh_context
             ..check
             ..subsumes?
             ..context
             ..clean
             ($.default /.unknown_type_var)
             ($.default /.unbound_type_var)
             ($.default /.invalid_type_application)
             ($.default /.cannot_rebind_var)
             ($.default /.type_check_failed)
             ($.default /.functor)
             ($.default /.apply)
             ($.default /.monad)
             ($.default /.bound?)
             ($.default /.peek)
             ($.default /.read)]
            []))