diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/data/collection/stack.lux | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/stdlib/source/library/lux/data/collection/stack.lux b/stdlib/source/library/lux/data/collection/stack.lux index 3f720d9ac..d34fe97ac 100644 --- a/stdlib/source/library/lux/data/collection/stack.lux +++ b/stdlib/source/library/lux/data/collection/stack.lux @@ -10,24 +10,24 @@ [type abstract]]]) -(abstract: #export (Stack a) - (List a) - +(abstract: .public (Stack a) {#.doc (doc "A first-in, last-out sequential data-structure.")} - (def: #export empty + (List a) + + (def: .public empty Stack (:abstraction (list))) - (def: #export size + (def: .public size (All [a] (-> (Stack a) Nat)) (|>> :representation //.size)) - (def: #export empty? + (def: .public empty? (All [a] (-> (Stack a) Bit)) (|>> :representation //.empty?)) - (def: #export (peek stack) + (def: .public (peek stack) {#.doc (doc "Yields the top value in the stack, if any.")} (All [a] (-> (Stack a) (Maybe a))) (case (:representation stack) @@ -37,7 +37,7 @@ (#.Item value _) (#.Some value))) - (def: #export (pop stack) + (def: .public (pop stack) (All [a] (-> (Stack a) (Maybe [a (Stack a)]))) (case (:representation stack) #.End @@ -46,11 +46,11 @@ (#.Item top stack') (#.Some [top (:abstraction stack')]))) - (def: #export (push value stack) + (def: .public (push value stack) (All [a] (-> a (Stack a) (Stack a))) (:abstraction (#.Item value (:representation stack)))) - (implementation: #export (equivalence super) + (implementation: .public (equivalence super) (All [a] (-> (Equivalence a) (Equivalence (Stack a)))) @@ -58,7 +58,7 @@ (def: (= reference subject) (\ (//.equivalence super) = (:representation reference) (:representation subject)))) - (implementation: #export functor + (implementation: .public functor (Functor Stack) (def: (map f value) |