aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/meta/type/check.lux
blob: e5a7130cfd241c08b738a77ff487d7ace8933940 (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
(.require
 [library
  [lux (.except and)
   ["$" documentation]
   [data
    ["[0]" text (.only \n)
     ["%" \\format (.only format)]]]
   [macro
    ["[0]" template]]]]
 [\\library
  ["[0]" /]])

(.def .public documentation
  (.List $.Module)
  ($.module /._
            "Type-checking functionality."
            [($.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)

             ($.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)])]
            []))