aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/type/refinement.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux/type/refinement.lux')
-rw-r--r--stdlib/source/lux/type/refinement.lux15
1 files changed, 9 insertions, 6 deletions
diff --git a/stdlib/source/lux/type/refinement.lux b/stdlib/source/lux/type/refinement.lux
index 1c428fc23..3a9b8cfd2 100644
--- a/stdlib/source/lux/type/refinement.lux
+++ b/stdlib/source/lux/type/refinement.lux
@@ -2,7 +2,9 @@
[lux (#- type)
[abstract
[predicate (#+ Predicate)]]
- [type (#+ :by-example) ("#;." equivalence)
+ ["." macro
+ [syntax (#+ syntax:)]]
+ [type (#+ :by-example)
abstract]])
(abstract: #export (Refined t r)
@@ -77,8 +79,9 @@
[yes
(#.Cons head no)]))))
-(template: #export (type <refiner>)
- (:by-example [t r]
- {(..Refiner t r)
- <refiner>}
- (..Refined t r)))
+(syntax: #export (type refiner)
+ (macro.with-gensyms [g!t g!r]
+ (wrap (list (` ((~! :by-example) [(~ g!t) (~ g!r)]
+ {(..Refiner (~ g!t) (~ g!r))
+ (~ refiner)}
+ (..Refined (~ g!t) (~ g!r))))))))