diff options
Diffstat (limited to 'stdlib/source/lux/debug.lux')
-rw-r--r-- | stdlib/source/lux/debug.lux | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/stdlib/source/lux/debug.lux b/stdlib/source/lux/debug.lux index 088504f2d..b60d62c11 100644 --- a/stdlib/source/lux/debug.lux +++ b/stdlib/source/lux/debug.lux @@ -22,14 +22,16 @@ [collection ["." array] ["." list ("#\." functor)]]] - [time - [instant (#+ Instant)] - [duration (#+ Duration)] - [date (#+ Date)]] + ["." meta + ["." location]] [macro ["." template] ["." syntax (#+ syntax:)] - ["." code]]]) + ["." code]] + [time + [instant (#+ Instant)] + [duration (#+ Duration)] + [date (#+ Date)]]]) (with_expansions [<jvm> (as_is (import: java/lang/String) @@ -161,7 +163,8 @@ (exception.report ["Type" (%.type type)])) -(type: Representation (-> Any Text)) +(type: Representation + (-> Any Text)) (def: primitive_representation (Parser Representation) @@ -304,3 +307,14 @@ "Useful for debugging.")} (-> Text Any) ("lux io log" message)) + +(exception: #export (type_hole {location Location} {type Type}) + (exception.report + ["Location" (location.format location)] + ["Type" (%.type type)])) + +(syntax: #export (:hole) + (do meta.monad + [location meta.location + expectedT meta.expected_type] + (meta.fail (exception.construct ..type_hole [location expectedT])))) |