diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/type/refinement.lux | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/stdlib/source/lux/type/refinement.lux b/stdlib/source/lux/type/refinement.lux index 3abcf2a1c..2d05d5882 100644 --- a/stdlib/source/lux/type/refinement.lux +++ b/stdlib/source/lux/type/refinement.lux @@ -1,5 +1,5 @@ (.module: - [lux #- Ref type] + [lux #- type] (lux (control [predicate #+ Pred] [monad #+ do] ["p" parser]) @@ -10,14 +10,14 @@ (macro ["s" syntax #+ syntax:] [poly]))) -(abstract: #export (Ref t r) - {#.doc "A refinement 'r' on type 't' based on a predicate."} +(abstract: #export (Refined t r) + {#.doc "A refined type 'r' of base type 't' using a predicate."} {#value t #predicate (Pred t)} (type: #export (Refiner t r) - (-> t (Maybe (Ref t r)))) + (-> t (Maybe (Refined t r)))) (def: #export (refinement predicate) (All [t] @@ -31,7 +31,7 @@ (do-template [<name> <output> <slot>] [(def: #export (<name> refined) - (All [t r] (-> (Ref t r) <output>)) + (All [t r] (-> (Refined t r) <output>)) (|> refined :representation (get@ <slot>)))] [un-refine t #value] @@ -41,7 +41,7 @@ (def: #export (lift transform) (All [t r] (-> (-> t t) - (-> (Ref t r) (Maybe (Ref t r))))) + (-> (Refined t r) (Maybe (Refined t r))))) (function (_ refined) (let [[value predicate] (:representation refined) value' (transform value)] @@ -52,7 +52,7 @@ ) (def: #export (filter refiner values) - (All [t r] (-> (Refiner t r) (List t) (List (Ref t r)))) + (All [t r] (-> (Refiner t r) (List t) (List (Refined t r)))) (case values #.Nil #.Nil @@ -66,7 +66,7 @@ (filter refiner tail)))) (def: #export (partition refiner values) - (All [t r] (-> (Refiner t r) (List t) [(List (Ref t r)) (List t)])) + (All [t r] (-> (Refiner t r) (List t) [(List (Refined t r)) (List t)])) (case values #.Nil [#.Nil #.Nil] @@ -89,10 +89,10 @@ [[un-refinedT outputT] (poly.function poly.any poly.any) refined-ex (<| (poly.local (list outputT)) poly.apply (p.after (poly.this .Maybe)) - poly.apply (p.after (poly.this ..Ref)) + poly.apply (p.after (poly.this ..Refined)) (p.after (poly.this un-refinedT)) poly.existential)] - (wrap (.type (..Ref un-refinedT (#.Ex refined-ex))))))) + (wrap (.type (..Refined un-refinedT (#.Ex refined-ex))))))) (syntax: #export (type {refinement s.symbol}) (do @ |