aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/type/check.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/documentation/lux/type/check.lux')
-rw-r--r--stdlib/source/documentation/lux/type/check.lux96
1 files changed, 96 insertions, 0 deletions
diff --git a/stdlib/source/documentation/lux/type/check.lux b/stdlib/source/documentation/lux/type/check.lux
new file mode 100644
index 000000000..3264a87a3
--- /dev/null
+++ b/stdlib/source/documentation/lux/type/check.lux
@@ -0,0 +1,96 @@
+(.module:
+ [library
+ [lux (#- and)
+ ["$" documentation (#+ documentation:)]
+ [control
+ ["<>" parser
+ ["<.>" code]]]
+ [data
+ ["." text (#+ \n)
+ ["%" format (#+ format)]]]
+ [macro
+ ["." template]]]]
+ [\\library
+ ["." /]])
+
+(documentation: /.Var
+ "The ID for a type-variable in a type-checking context.")
+
+(documentation: /.Check
+ "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 /.read')
+ ($.default /.read)]
+ []))