diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/data/collection/queue.lux | 24 | ||||
-rw-r--r-- | stdlib/source/library/lux/data/collection/queue/priority.lux | 4 |
2 files changed, 14 insertions, 14 deletions
diff --git a/stdlib/source/library/lux/data/collection/queue.lux b/stdlib/source/library/lux/data/collection/queue.lux index 0fa870a0c..0c6a24f88 100644 --- a/stdlib/source/library/lux/data/collection/queue.lux +++ b/stdlib/source/library/lux/data/collection/queue.lux @@ -1,6 +1,6 @@ (.module: [library - [lux #* + [lux (#- list) [abstract [equivalence (#+ Equivalence)] [functor (#+ Functor)]] @@ -18,15 +18,15 @@ (def: #export empty Queue - {#front (list) - #rear (list)}) + {#front (.list) + #rear (.list)}) (def: #export (of_list entries) (All [a] (-> (List a) (Queue a))) {#front entries - #rear (list)}) + #rear (.list)}) -(def: #export (to_list queue) +(def: #export (list queue) (All [a] (-> (Queue a) (List a))) (let [(^slots [#front #rear]) queue] (list\compose front (list.reversed rear)))) @@ -56,17 +56,17 @@ (All [a] (-> (Queue a) (Queue a))) (case (get@ #front queue) ## Empty... - (^ (list)) + (^ (.list)) queue ## Front has dried up... - (^ (list _)) + (^ (.list _)) (|> queue (set@ #front (list.reversed (get@ #rear queue))) - (set@ #rear (list))) + (set@ #rear (.list))) ## Consume front! - (^ (list& _ front')) + (^ (.list& _ front')) (|> queue (set@ #front front')))) @@ -74,7 +74,7 @@ (All [a] (-> a (Queue a) (Queue a))) (case (get@ #front queue) #.End - (set@ #front (list val) queue) + (set@ #front (.list val) queue) _ (update@ #rear (|>> (#.Item val)) queue))) @@ -84,8 +84,8 @@ (def: (= reference subject) (\ (list.equivalence super) = - (..to_list reference) - (..to_list subject)))) + (..list reference) + (..list subject)))) (implementation: #export functor (Functor Queue) diff --git a/stdlib/source/library/lux/data/collection/queue/priority.lux b/stdlib/source/library/lux/data/collection/queue/priority.lux index 8f0a788fc..698bb57ac 100644 --- a/stdlib/source/library/lux/data/collection/queue/priority.lux +++ b/stdlib/source/library/lux/data/collection/queue/priority.lux @@ -3,7 +3,7 @@ [lux #* [abstract [equivalence (#+ Equivalence)] - [monad (#+ do Monad)]] + [monad (#+ do)]] [data ["." maybe] [collection @@ -86,7 +86,7 @@ (:abstraction (do maybe.monad [tree (:representation queue) - #let [highest_priority (tree.tag tree)]] + .let [highest_priority (tree.tag tree)]] (loop [node tree] (case (tree.root node) (0 #0 reference) |