diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/data/collection/stack.lux | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/stdlib/source/lux/data/collection/stack.lux b/stdlib/source/lux/data/collection/stack.lux index 2f822ecb1..d3a937cb4 100644 --- a/stdlib/source/lux/data/collection/stack.lux +++ b/stdlib/source/lux/data/collection/stack.lux @@ -1,8 +1,11 @@ (.module: [lux #* + [control + [equivalence (#+ Equivalence)] + [functor (#+ Functor)]] [data [collection - ["." list]]]]) + ["//" list]]]]) (type: #export (Stack a) (List a)) @@ -11,13 +14,13 @@ Stack (list)) -(def: #export (size stack) +(def: #export size (All [a] (-> (Stack a) Nat)) - (list.size stack)) + //.size) -(def: #export (empty? stack) +(def: #export empty? (All [a] (-> (Stack a) Bit)) - (list.empty? stack)) + //.empty?) (def: #export (peek stack) (All [a] (-> (Stack a) (Maybe a))) @@ -40,3 +43,13 @@ (def: #export (push value stack) (All [a] (-> a (Stack a) (Stack a))) (#.Cons value stack)) + +(def: #export equivalence + (All [a] + (-> (Equivalence a) + (Equivalence (Stack a)))) + //.equivalence) + +(def: #export functor + (Functor Stack) + //.functor) |