From d6c48ae6a8b58f5974133170863a31c70f0123d1 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 14 Jul 2021 13:59:02 -0400 Subject: Normalized the hierarchy of the standard library modules. --- stdlib/source/lux/data/collection/stack.lux | 65 ----------------------------- 1 file changed, 65 deletions(-) delete mode 100644 stdlib/source/lux/data/collection/stack.lux (limited to 'stdlib/source/lux/data/collection/stack.lux') diff --git a/stdlib/source/lux/data/collection/stack.lux b/stdlib/source/lux/data/collection/stack.lux deleted file mode 100644 index 68d514331..000000000 --- a/stdlib/source/lux/data/collection/stack.lux +++ /dev/null @@ -1,65 +0,0 @@ -(.module: - [lux #* - [abstract - [equivalence (#+ Equivalence)] - [functor (#+ Functor)]] - [data - [collection - ["//" list]]] - [type - abstract]]) - -(abstract: #export (Stack a) - (List a) - - (def: #export empty - Stack - (:abstraction (list))) - - (def: #export size - (All [a] (-> (Stack a) Nat)) - (|>> :representation //.size)) - - (def: #export empty? - (All [a] (-> (Stack a) Bit)) - (|>> :representation //.empty?)) - - (def: #export (peek stack) - (All [a] (-> (Stack a) (Maybe a))) - (case (:representation stack) - #.Nil - #.None - - (#.Cons value _) - (#.Some value))) - - (def: #export (pop stack) - (All [a] (-> (Stack a) (Maybe [a (Stack a)]))) - (case (:representation stack) - #.Nil - #.None - - (#.Cons top stack') - (#.Some [top (:abstraction stack')]))) - - (def: #export (push value stack) - (All [a] (-> a (Stack a) (Stack a))) - (:abstraction (#.Cons value (:representation stack)))) - - (implementation: #export (equivalence super) - (All [a] - (-> (Equivalence a) - (Equivalence (Stack a)))) - - (def: (= reference subject) - (\ (//.equivalence super) = (:representation reference) (:representation subject)))) - - (implementation: #export functor - (Functor Stack) - - (def: (map f value) - (|> value - :representation - (\ //.functor map f) - :abstraction))) - ) -- cgit v1.2.3