diff options
Diffstat (limited to 'stdlib/source/library/lux/data/collection/stack.lux')
-rw-r--r-- | stdlib/source/library/lux/data/collection/stack.lux | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/stdlib/source/library/lux/data/collection/stack.lux b/stdlib/source/library/lux/data/collection/stack.lux index 5c096b40b..fa7a5c589 100644 --- a/stdlib/source/library/lux/data/collection/stack.lux +++ b/stdlib/source/library/lux/data/collection/stack.lux @@ -1,33 +1,33 @@ (.using - [library - [lux "*" - [abstract - [equivalence {"+" Equivalence}] - [functor {"+" Functor}]] - [data - [collection - ["//" list]]] - [type - abstract]]]) + [library + [lux "*" + [abstract + [equivalence {"+" Equivalence}] + [functor {"+" Functor}]] + [data + [collection + ["//" list]]] + [type + [abstract {"-" pattern}]]]]) (abstract: .public (Stack a) (List a) (def: .public empty Stack - (:abstraction (list))) + (abstraction (list))) (def: .public size (All (_ a) (-> (Stack a) Nat)) - (|>> :representation //.size)) + (|>> representation //.size)) (def: .public empty? (All (_ a) (-> (Stack a) Bit)) - (|>> :representation //.empty?)) + (|>> representation //.empty?)) (def: .public (value stack) (All (_ a) (-> (Stack a) (Maybe a))) - (case (:representation stack) + (case (representation stack) {.#End} {.#None} @@ -36,16 +36,16 @@ (def: .public (next stack) (All (_ a) (-> (Stack a) (Maybe [a (Stack a)]))) - (case (:representation stack) + (case (representation stack) {.#End} {.#None} {.#Item top stack'} - {.#Some [top (:abstraction stack')]})) + {.#Some [top (abstraction stack')]})) (def: .public (top value stack) (All (_ a) (-> a (Stack a) (Stack a))) - (:abstraction {.#Item value (:representation stack)})) + (abstraction {.#Item value (representation stack)})) (implementation: .public (equivalence super) (All (_ a) @@ -53,14 +53,14 @@ (Equivalence (Stack a)))) (def: (= reference subject) - (# (//.equivalence super) = (:representation reference) (:representation subject)))) + (# (//.equivalence super) = (representation reference) (representation subject)))) (implementation: .public functor (Functor Stack) (def: (each f value) (|> value - :representation + representation (# //.functor each f) - :abstraction))) + abstraction))) ) |