aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/data/collection/stack.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/data/collection/stack.lux')
-rw-r--r--stdlib/source/library/lux/data/collection/stack.lux84
1 files changed, 42 insertions, 42 deletions
diff --git a/stdlib/source/library/lux/data/collection/stack.lux b/stdlib/source/library/lux/data/collection/stack.lux
index 87925a89a..e90d53f84 100644
--- a/stdlib/source/library/lux/data/collection/stack.lux
+++ b/stdlib/source/library/lux/data/collection/stack.lux
@@ -13,54 +13,54 @@
(abstract: .public (Stack a)
(List a)
- [(def: .public empty
- Stack
- (:abstraction (list)))
+ (def: .public empty
+ Stack
+ (:abstraction (list)))
- (def: .public size
- (All (_ a) (-> (Stack a) Nat))
- (|>> :representation //.size))
+ (def: .public size
+ (All (_ a) (-> (Stack a) Nat))
+ (|>> :representation //.size))
- (def: .public empty?
- (All (_ a) (-> (Stack a) Bit))
- (|>> :representation //.empty?))
+ (def: .public empty?
+ (All (_ a) (-> (Stack a) Bit))
+ (|>> :representation //.empty?))
- (def: .public (value stack)
- (All (_ a) (-> (Stack a) (Maybe a)))
- (case (:representation stack)
- #.End
- #.None
-
- {#.Item value _}
- {#.Some value}))
+ (def: .public (value stack)
+ (All (_ a) (-> (Stack a) (Maybe a)))
+ (case (:representation stack)
+ #.End
+ #.None
+
+ {#.Item value _}
+ {#.Some value}))
- (def: .public (next stack)
- (All (_ a) (-> (Stack a) (Maybe [a (Stack a)])))
- (case (:representation stack)
- #.End
- #.None
-
- {#.Item top stack'}
- {#.Some [top (:abstraction stack')]}))
+ (def: .public (next stack)
+ (All (_ a) (-> (Stack a) (Maybe [a (Stack a)])))
+ (case (:representation stack)
+ #.End
+ #.None
+
+ {#.Item top stack'}
+ {#.Some [top (:abstraction stack')]}))
- (def: .public (top value stack)
- (All (_ a) (-> a (Stack a) (Stack a)))
- (:abstraction {#.Item value (:representation stack)}))
+ (def: .public (top value stack)
+ (All (_ a) (-> a (Stack a) (Stack a)))
+ (:abstraction {#.Item value (:representation stack)}))
- (implementation: .public (equivalence super)
- (All (_ a)
- (-> (Equivalence a)
- (Equivalence (Stack a))))
+ (implementation: .public (equivalence super)
+ (All (_ a)
+ (-> (Equivalence a)
+ (Equivalence (Stack a))))
- (def: (= reference subject)
- (\ (//.equivalence super) = (:representation reference) (:representation subject))))
+ (def: (= reference subject)
+ (\ (//.equivalence super) = (:representation reference) (:representation subject))))
- (implementation: .public functor
- (Functor Stack)
-
- (def: (each f value)
- (|> value
- :representation
- (\ //.functor each f)
- :abstraction)))]
+ (implementation: .public functor
+ (Functor Stack)
+
+ (def: (each f value)
+ (|> value
+ :representation
+ (\ //.functor each f)
+ :abstraction)))
)