diff options
author | Eduardo Julian | 2021-06-30 23:24:55 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-06-30 23:24:55 -0400 |
commit | 744ee69630de59ca3ba660b0aab6361cd17ce1b4 (patch) | |
tree | 329c11b8c3522c319c99ebd4d7c51ee0e7464bae /stdlib/source/lux/abstract/interval.lux | |
parent | 6633cd42f2892ea71530ddeeb93a7e7c0b59faa3 (diff) |
"signature:" -> "interface:" & "structure:" -> "implementation:"
"signature" & "structure" feel like very ML-specific terminology and might not be easy on programmers unfamiliar with it.
Diffstat (limited to 'stdlib/source/lux/abstract/interval.lux')
-rw-r--r-- | stdlib/source/lux/abstract/interval.lux | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/stdlib/source/lux/abstract/interval.lux b/stdlib/source/lux/abstract/interval.lux index fbe3a4c8a..e43529890 100644 --- a/stdlib/source/lux/abstract/interval.lux +++ b/stdlib/source/lux/abstract/interval.lux @@ -6,7 +6,7 @@ ["." order] [enum (#+ Enum)]]) -(signature: #export (Interval a) +(interface: #export (Interval a) {#.doc "A representation of top and bottom boundaries for an ordered type."} (: (Enum a) &enum) @@ -19,14 +19,14 @@ (def: #export (between enum bottom top) (All [a] (-> (Enum a) a a (Interval a))) - (structure + (implementation (def: &enum enum) (def: bottom bottom) (def: top top))) (def: #export (singleton enum elem) (All [a] (-> (Enum a) a (Interval a))) - (structure + (implementation (def: &enum enum) (def: bottom elem) (def: top elem))) @@ -74,22 +74,25 @@ (def: #export (union left right) (All [a] (-> (Interval a) (Interval a) (Interval a))) - (structure (def: &enum (get@ #&enum right)) - (def: bottom (order.min (\ right &order) (\ left bottom) (\ right bottom))) - (def: top (order.max (\ right &order) (\ left top) (\ right top))))) + (implementation + (def: &enum (get@ #&enum right)) + (def: bottom (order.min (\ right &order) (\ left bottom) (\ right bottom))) + (def: top (order.max (\ right &order) (\ left top) (\ right top))))) (def: #export (intersection left right) (All [a] (-> (Interval a) (Interval a) (Interval a))) - (structure (def: &enum (get@ #&enum right)) - (def: bottom (order.max (\ right &order) (\ left bottom) (\ right bottom))) - (def: top (order.min (\ right &order) (\ left top) (\ right top))))) + (implementation + (def: &enum (get@ #&enum right)) + (def: bottom (order.max (\ right &order) (\ left bottom) (\ right bottom))) + (def: top (order.min (\ right &order) (\ left top) (\ right top))))) (def: #export (complement interval) (All [a] (-> (Interval a) (Interval a))) (let [(^open ".") interval] - (structure (def: &enum (get@ #&enum interval)) - (def: bottom (succ top)) - (def: top (pred bottom))))) + (implementation + (def: &enum (get@ #&enum interval)) + (def: bottom (succ top)) + (def: top (pred bottom))))) (def: #export (precedes? reference sample) (All [a] (-> (Interval a) (Interval a) Bit)) @@ -139,7 +142,7 @@ [finishes? ,\top order.>= ,\bottom] ) -(structure: #export equivalence (All [a] (Equivalence (Interval a))) +(implementation: #export equivalence (All [a] (Equivalence (Interval a))) (def: (= reference sample) (let [(^open ",\.") reference] (and (,\= ,\bottom (\ sample bottom)) |