[{"name":"MaxPriorityQueue","comment":" The `(a -> Int)` function given to `singleton`, `insert`, `enqueue` and `fromList`\nis how you teach the queue to get the priority of an item. `MaxPriorityQueue` will\nprioritize items with larger Ints.\n\n@docs MaxPriorityQueue\n\n**Note:** Some functions in this module return lists of values in perhaps a slightly\nunexpected reversed order (`toSortedList`, `dequeueMany`, `take`). This is done\nin name of efficiency: there's no trick to efficiently return it in the more\nexpected reverse order, so we let the user do the List.reverse themselves if\nneeded and make the cost more apparent.\n\n    toSortedList (fromList identity [ 100, 3, 1, 4, 1, 5, 9, 200 ])\n        --> [ 1, 1, 3, 4, 5, 9, 100, 200 ]\n\n    List.reverse (toSortedList (fromList identity [ 100, 3, 1, 4, 1, 5, 9, 200 ]))\n        --> [ 200, 100, 9, 5, 4, 3, 1, 1 ]\n\nAnyways, let's continue with the rest of the docs!\n\n@docs empty, singleton, fromList\n@docs toList, toSortedList, fold\n@docs insert, enqueue, filter, dequeue, dequeueMany, largest, head, tail, take, drop\n@docs all, any, isEmpty, length\n\n","unions":[{"name":"MaxPriorityQueue","comment":" A priority queue giving the highest priority to largest Ints given by your\n`(a -> Int)` function.\n\n    MaxPriorityQueue.fromList .age\n        [ { name = \"Martin\", age = 31 }\n        , { name = \"Xavier\", age = 13 }\n        , { name = \"Joanne\", age = 54 }\n        ]\n        |> MaxPriorityQueue.largest\n        --> { name = \"Joanne\", age = 54 }\n\nNote that MaxPriorityQueue is not `(==)`-safe.\n\n","args":["a"],"cases":[]}],"aliases":[],"values":[{"name":"all","comment":" Determine if all elements satisfy the predicate.\n\n    fromList identity [ 1, 2, 3 ]\n        |> all (\\x -> x > 10)\n        == False\n\n    fromList identity [ 9, 11 ]\n        |> all (\\x -> x > 10)\n        == False\n\n    fromList identity [ 15, 16, 17 ]\n        |> all (\\x -> x > 10)\n        == True\n\n    all (\\_ -> True) empty --> True\n\n    all (\\_ -> True) (singleton identity 1) --> True\n\n    all (\\_ -> False) empty --> True\n\n    all (\\_ -> False) (singleton identity 1) --> False\n\n","type":"(a -> Basics.Bool) -> MaxPriorityQueue.MaxPriorityQueue a -> Basics.Bool"},{"name":"any","comment":" Determine if any elements satisfy the predicate.\n\n    fromList identity [ 1, 2, 3 ]\n        |> any (\\x -> x > 10)\n        == False\n\n    fromList identity [ 9, 11 ]\n        |> any (\\x -> x > 10)\n        == True\n\n    fromList identity [ 15, 16, 17 ]\n        |> any (\\x -> x > 10)\n        == True\n\n    any (\\_ -> True) empty --> False\n\n    any (\\_ -> True) (singleton identity 1) --> True\n\n    any (\\_ -> False) empty --> False\n\n    any (\\_ -> False) (singleton identity 1) --> False\n\n","type":"(a -> Basics.Bool) -> MaxPriorityQueue.MaxPriorityQueue a -> Basics.Bool"},{"name":"dequeue","comment":" Remove and return the element with the highest priority from the MaxPriorityQueue,\nalong with the updated queue. Returns Nothing if the queue is empty. O(log n).\n\n    dequeue (fromList identity [ 3, 4, 1 ])\n        --> Just ( 4, fromList identity [ 3, 1 ] )\n\n    dequeue empty\n        --> Nothing\n\n","type":"MaxPriorityQueue.MaxPriorityQueue a -> Maybe.Maybe ( a, MaxPriorityQueue.MaxPriorityQueue a )"},{"name":"dequeueMany","comment":" Retrieve the N items with highest priority, alongside the queue without them.\n\nThe order of items in the resulting list is lowest-priority-first, thus may seem\nreversed from what you want. See note at the top.\n\n    fromList identity [ 3, 1, 5, 2, 4 ]\n        |> dequeueMany 3\n        --> ( [ 3, 4, 5 ], fromList identity [ 1, 2 ] )\n\nIf you take more items than are in the queue, you will get all the items in the\nqueue.\n\n    fromList identity [ 3, 1, 2 ]\n        |> dequeueMany 5\n        --> ( [ 1, 2, 3 ], empty )\n\n","type":"Basics.Int -> MaxPriorityQueue.MaxPriorityQueue a -> ( List.List a, MaxPriorityQueue.MaxPriorityQueue a )"},{"name":"drop","comment":" Drop the N items with highest priority from the queue. O(log n).\n\n    fromList identity [ 3, 1, 5, 2, 4 ]\n        |> drop 3\n        |> toSortedList\n        --> [ 1, 2 ]\n\nIf you drop more items than are in the queue, you will get an empty queue.\n\n    drop 1000 (singleton identity 1)\n        --> empty\n\n","type":"Basics.Int -> MaxPriorityQueue.MaxPriorityQueue a -> MaxPriorityQueue.MaxPriorityQueue a"},{"name":"empty","comment":" Create an empty MaxPriorityQueue.\n","type":"MaxPriorityQueue.MaxPriorityQueue a"},{"name":"enqueue","comment":" Insert an element into a MaxPriorityQueue. O(log n).\n\nThis is an alias for `insert`.\n\n    empty\n        |> enqueue identity 3\n        |> enqueue identity 4\n        |> enqueue identity 1\n        |> largest\n        --> Just 4\n\n","type":"(a -> Basics.Int) -> a -> MaxPriorityQueue.MaxPriorityQueue a -> MaxPriorityQueue.MaxPriorityQueue a"},{"name":"filter","comment":" Keep only the elements that satisfy the predicate.\n\n    fromList identity [ 1, 2, 3, 4, 5 ]\n        |> filter (\\x -> modBy 2 x == 0)\n        |> toSortedList\n        --> [ 2, 4 ]\n\n","type":"(a -> Basics.Bool) -> MaxPriorityQueue.MaxPriorityQueue a -> MaxPriorityQueue.MaxPriorityQueue a"},{"name":"fold","comment":" Fold over the elements in the MaxPriorityQueue, highest priority first.\n\n    fromList identity [ 3, 1, 4 ]\n        |> fold (\\x acc -> x :: acc) []\n        --> [ 1, 3, 4 ]\n\n    fromList identity [ 3, 1, 4 ]\n        |> fold (+) 0\n        --> 8\n\n    fromList Tuple.first [ (10, \"World\"), (1, \"Hello\"), (5, \"Elm\") ]\n        |> fold (\\(_, word) acc -> acc ++ \" \" ++ word) \"\"\n        --> \" World Elm Hello\"\n\n","type":"(a -> b -> b) -> b -> MaxPriorityQueue.MaxPriorityQueue a -> b"},{"name":"fromList","comment":" Create a MaxPriorityQueue from a list of elements.\n\n    fromList identity [ 3, 1, 4, 1, 5, 9 ]\n        |> toSortedList\n        --> [ 1, 1, 3, 4, 5, 9 ]\n\n","type":"(a -> Basics.Int) -> List.List a -> MaxPriorityQueue.MaxPriorityQueue a"},{"name":"head","comment":" Get the item with the highest priority without removing it from the queue.\nReturns Nothing if the queue is empty. O(1).\n\n    head (fromList identity [ 3, 4, 1 ])\n        --> Just 4\n\n    head empty\n        --> Nothing\n\n","type":"MaxPriorityQueue.MaxPriorityQueue a -> Maybe.Maybe a"},{"name":"insert","comment":" Insert an element into a MaxPriorityQueue. O(log n).\n\n    empty\n        |> insert identity 3\n        |> insert identity 4\n        |> insert identity 1\n        |> largest\n        --> Just 4\n\n","type":"(a -> Basics.Int) -> a -> MaxPriorityQueue.MaxPriorityQueue a -> MaxPriorityQueue.MaxPriorityQueue a"},{"name":"isEmpty","comment":" Check if a MaxPriorityQueue is empty.\n\n    isEmpty empty\n        --> True\n\n    isEmpty (singleton identity 1)\n        --> False\n\n","type":"MaxPriorityQueue.MaxPriorityQueue a -> Basics.Bool"},{"name":"largest","comment":" Get the item with the highest priority without removing it from the queue.\nReturns Nothing if the queue is empty. O(1).\n\nThis is an alias for `head`.\n\n    largest (fromList identity [ 3, 4, 1 ])\n        --> Just 4\n\n    largest empty\n        --> Nothing\n\n","type":"MaxPriorityQueue.MaxPriorityQueue a -> Maybe.Maybe a"},{"name":"length","comment":" Get the number of elements in the queue. O(1).\n\n    length (fromList identity [ 1, 2, 3 ])\n        --> 3\n\n    length empty\n        --> 0\n\n","type":"MaxPriorityQueue.MaxPriorityQueue a -> Basics.Int"},{"name":"singleton","comment":" Create a MaxPriorityQueue with a single element.\n\n    singleton identity 5\n        |> toList\n        --> [ 5 ]\n\n","type":"(a -> Basics.Int) -> a -> MaxPriorityQueue.MaxPriorityQueue a"},{"name":"tail","comment":" Get a new queue with the highest priority item removed.\nReturns Nothing if the queue is empty. O(log n).\n\n    tail (fromList identity [ 3, 4, 1 ])\n        |> Maybe.map toSortedList\n        --> Just [ 1, 3 ]\n\n    tail empty\n        --> Nothing\n\n","type":"MaxPriorityQueue.MaxPriorityQueue a -> Maybe.Maybe (MaxPriorityQueue.MaxPriorityQueue a)"},{"name":"take","comment":" Retrieve the N items with highest priority. O(log n).\n\nThe order of items in the resulting list is lowest-priority-first, thus may seem\nreversed from what you want. See note at the top.\n\n    fromList identity [ 3, 1, 5, 2, 4 ]\n        |> take 3\n        --> [ 3, 4, 5 ]\n\nIf you take more items than are in the queue, you will get all the items in the\nqueue.\n\n    take 1000 (singleton identity 1)\n        --> [ 1 ]\n\n","type":"Basics.Int -> MaxPriorityQueue.MaxPriorityQueue a -> List.List a"},{"name":"toList","comment":" Convert a MaxPriorityQueue to a list.\n\nThe order of items in the resulting list is unspecified.\nIf you need a sorted list, use `toSortedList`.\n\n    toList (fromList identity [ 100, 3, 1, 4, 1, 5, 9, 200 ])\n        --> [ 200, 100, 4, 1, 1, 9, 5, 3]\n\n","type":"MaxPriorityQueue.MaxPriorityQueue a -> List.List a"},{"name":"toSortedList","comment":" Convert a MaxPriorityQueue to a sorted list.\n\nThe order of items in the resulting list is lowest-priority-first, thus may seem\nreversed from what you want. See note at the top.\n\n    toSortedList (fromList identity [ 100, 3, 1, 4, 1, 5, 9, 200 ])\n        --> [ 1, 1, 3, 4, 5, 9, 100, 200 ]\n\n","type":"MaxPriorityQueue.MaxPriorityQueue a -> List.List a"}],"binops":[]},{"name":"MinPriorityQueue","comment":" The `(a -> Int)` function given to `singleton`, `insert`, `enqueue` and `fromList`\nis how you teach the queue to get the priority of an item. `MinPriorityQueue` will\nprioritize items with smaller Ints.\n\n@docs MinPriorityQueue\n\n**Note:** Some functions in this module return lists of values in perhaps a slightly\nunexpected reversed order (`toSortedList`, `dequeueMany`, `take`). This is done\nin name of efficiency: there's no trick to efficiently return it in the more\nexpected reverse order, so we let the user do the List.reverse themselves if\nneeded and make the cost more apparent.\n\n    toSortedList (fromList identity [ 100, 3, 1, 4, 1, 5, 9, 200 ])\n        --> [ 200, 100, 9, 5, 4, 3, 1, 1 ]\n\n    List.reverse (toSortedList (fromList identity [ 100, 3, 1, 4, 1, 5, 9, 200 ]))\n        --> [ 1, 1, 3, 4, 5, 9, 100, 200 ]\n\nAnyways, let's continue with the rest of the docs!\n\n@docs empty, singleton, fromList\n@docs toList, toSortedList, fold\n@docs insert, enqueue, filter, dequeue, dequeueMany, smallest, head, tail, take, drop\n@docs all, any, isEmpty, length\n\n","unions":[{"name":"MinPriorityQueue","comment":" A priority queue giving the highest priority to smallest Ints given by your\n`(a -> Int)` function.\n\n    MinPriorityQueue.fromList .age\n        [ { name = \"Martin\", age = 31 }\n        , { name = \"Xavier\", age = 13 }\n        , { name = \"Joanne\", age = 54 }\n        ]\n        |> MinPriorityQueue.smallest\n        --> { name = \"Xavier\", age = 13 }\n\nNote that MinPriorityQueue is not `(==)`-safe.\n\n","args":["a"],"cases":[]}],"aliases":[],"values":[{"name":"all","comment":" Determine if all elements satisfy the predicate.\n\n    fromList identity [ 1, 2, 3 ]\n        |> all (\\x -> x > 10)\n        == False\n\n    fromList identity [ 9, 11 ]\n        |> all (\\x -> x > 10)\n        == False\n\n    fromList identity [ 15, 16, 17 ]\n        |> all (\\x -> x > 10)\n        == True\n\n    all (\\_ -> True) empty --> True\n\n    all (\\_ -> True) (singleton identity 1) --> True\n\n    all (\\_ -> False) empty --> True\n\n    all (\\_ -> False) (singleton identity 1) --> False\n\n","type":"(a -> Basics.Bool) -> MinPriorityQueue.MinPriorityQueue a -> Basics.Bool"},{"name":"any","comment":" Determine if any elements satisfy the predicate.\n\n    fromList identity [ 1, 2, 3 ]\n        |> any (\\x -> x > 10)\n        == False\n\n    fromList identity [ 9, 11 ]\n        |> any (\\x -> x > 10)\n        == True\n\n    fromList identity [ 15, 16, 17 ]\n        |> any (\\x -> x > 10)\n        == True\n\n    any (\\_ -> True) empty --> False\n\n    any (\\_ -> True) (singleton identity 1) --> True\n\n    any (\\_ -> False) empty --> False\n\n    any (\\_ -> False) (singleton identity 1) --> False\n\n","type":"(a -> Basics.Bool) -> MinPriorityQueue.MinPriorityQueue a -> Basics.Bool"},{"name":"dequeue","comment":" Remove and return the element with the highest priority from the MinPriorityQueue,\nalong with the updated queue. Returns Nothing if the queue is empty. O(log n).\n\n    dequeue (fromList identity [ 3, 1, 4 ])\n        --> Just ( 1, fromList identity [ 3, 4 ] )\n\n    dequeue empty\n        --> Nothing\n\n","type":"MinPriorityQueue.MinPriorityQueue a -> Maybe.Maybe ( a, MinPriorityQueue.MinPriorityQueue a )"},{"name":"dequeueMany","comment":" Retrieve the N items with highest priority, alongside the queue without them.\n\nThe order of items in the resulting list is lowest-priority-first, thus may seem\nreversed from what you want. See note at the top.\n\n    fromList identity [ 3, 1, 5, 2, 4 ]\n        |> dequeueMany 3\n        --> ( [ 3, 2, 1 ], fromList identity [ 5, 4 ] )\n\nIf you take more items than are in the queue, you will get all the items in the\nqueue.\n\n    fromList identity [ 3, 1, 2 ]\n        |> dequeueMany 5\n        --> ( [ 3, 2, 1 ], empty )\n\n","type":"Basics.Int -> MinPriorityQueue.MinPriorityQueue a -> ( List.List a, MinPriorityQueue.MinPriorityQueue a )"},{"name":"drop","comment":" Drop the N items with highest priority from the queue. O(log n).\n\n    fromList identity [ 3, 1, 5, 2, 4 ]\n        |> drop 3\n        |> toSortedList\n        --> [ 5, 4 ]\n\nIf you drop more items than are in the queue, you will get an empty queue.\n\n    drop 1000 (singleton identity 1)\n        --> empty\n\n","type":"Basics.Int -> MinPriorityQueue.MinPriorityQueue a -> MinPriorityQueue.MinPriorityQueue a"},{"name":"empty","comment":" Create an empty MinPriorityQueue.\n","type":"MinPriorityQueue.MinPriorityQueue a"},{"name":"enqueue","comment":" Insert an element into a MinPriorityQueue. O(log n).\n\nThis is an alias for `insert`.\n\n    empty\n        |> enqueue identity 3\n        |> enqueue identity 1\n        |> enqueue identity 4\n        |> smallest\n        --> Just 1\n\n","type":"(a -> Basics.Int) -> a -> MinPriorityQueue.MinPriorityQueue a -> MinPriorityQueue.MinPriorityQueue a"},{"name":"filter","comment":" Keep only the elements that satisfy the predicate.\n\n    fromList identity [ 1, 2, 3, 4, 5 ]\n        |> filter (\\x -> modBy 2 x == 0)\n        |> toSortedList\n        --> [ 4, 2 ]\n\n","type":"(a -> Basics.Bool) -> MinPriorityQueue.MinPriorityQueue a -> MinPriorityQueue.MinPriorityQueue a"},{"name":"fold","comment":" Fold over the elements in the MinPriorityQueue, highest priority first.\n\n    fromList identity [ 3, 1, 4 ]\n        |> fold (\\x acc -> x :: acc) []\n        --> [ 4, 3, 1 ]\n\n    fromList identity [ 3, 1, 4 ]\n        |> fold (+) 0\n        --> 8\n\n    fromList Tuple.first [ (10, \"World\"), (1, \"Hello\"), (5, \"Elm\") ]\n        |> fold (\\(_, word) acc -> acc ++ \" \" ++ word) \"\"\n        --> \" Hello Elm World\"\n\n","type":"(a -> b -> b) -> b -> MinPriorityQueue.MinPriorityQueue a -> b"},{"name":"fromList","comment":" Create a MinPriorityQueue from a list of elements.\n\n    fromList identity [ 3, 1, 4, 1, 5, 9 ]\n        |> toSortedList\n        --> [ 1, 1, 3, 4, 5, 9 ]\n\n","type":"(a -> Basics.Int) -> List.List a -> MinPriorityQueue.MinPriorityQueue a"},{"name":"head","comment":" Get the item with the highest priority without removing it from the queue.\nReturns Nothing if the queue is empty. O(1).\n\n    head (fromList identity [ 3, 1, 4 ])\n        --> Just 1\n\n    head empty\n        --> Nothing\n\n","type":"MinPriorityQueue.MinPriorityQueue a -> Maybe.Maybe a"},{"name":"insert","comment":" Insert an element into a MinPriorityQueue. O(log n).\n\n    empty\n        |> insert identity 3\n        |> insert identity 1\n        |> insert identity 4\n        |> smallest\n        --> Just 1\n\n","type":"(a -> Basics.Int) -> a -> MinPriorityQueue.MinPriorityQueue a -> MinPriorityQueue.MinPriorityQueue a"},{"name":"isEmpty","comment":" Check if a MinPriorityQueue is empty.\n\n    isEmpty empty\n        --> True\n\n    isEmpty (singleton identity 1)\n        --> False\n\n","type":"MinPriorityQueue.MinPriorityQueue a -> Basics.Bool"},{"name":"length","comment":" Get the number of elements in the queue. O(1).\n\n    length (fromList identity [ 1, 2, 3 ])\n        --> 3\n\n    length empty\n        --> 0\n\n","type":"MinPriorityQueue.MinPriorityQueue a -> Basics.Int"},{"name":"singleton","comment":" Create a MinPriorityQueue with a single element.\n\n    singleton identity 5\n        |> toList\n        --> [ 5 ]\n\n","type":"(a -> Basics.Int) -> a -> MinPriorityQueue.MinPriorityQueue a"},{"name":"smallest","comment":" Get the item with the highest priority without removing it from the queue.\nReturns Nothing if the queue is empty. O(1).\n\nThis is an alias for `head`.\n\n    smallest (fromList identity [ 3, 1, 4 ])\n        --> Just 1\n\n    smallest empty\n        --> Nothing\n\n","type":"MinPriorityQueue.MinPriorityQueue a -> Maybe.Maybe a"},{"name":"tail","comment":" Get a new queue with the highest priority item removed.\nReturns Nothing if the queue is empty. O(log n).\n\n    tail (fromList identity [ 3, 1, 4 ])\n        |> Maybe.map toSortedList\n        --> Just [ 4, 3 ]\n\n    tail empty\n        --> Nothing\n\n","type":"MinPriorityQueue.MinPriorityQueue a -> Maybe.Maybe (MinPriorityQueue.MinPriorityQueue a)"},{"name":"take","comment":" Retrieve the N items with highest priority. O(log n).\n\nThe order of items in the resulting list is lowest-priority-first, thus may seem\nreversed from what you want. See note at the top.\n\n    fromList identity [ 3, 1, 5, 2, 4 ]\n        |> take 3\n        --> [ 3, 2, 1 ]\n\nIf you take more items than are in the queue, you will get all the items in the\nqueue.\n\n    take 1000 (singleton identity 1)\n        --> [ 1 ]\n\n","type":"Basics.Int -> MinPriorityQueue.MinPriorityQueue a -> List.List a"},{"name":"toList","comment":" Convert a MinPriorityQueue to a list.\n\nThe order of items in the resulting list is unspecified.\nIf you need a sorted list, use `toSortedList`.\n\n    toList (fromList identity [ 100, 3, 1, 4, 1, 5, 9, 200 ])\n        --> [ 1, 1, 3, 100, 4, 5, 9, 200 ]\n\n","type":"MinPriorityQueue.MinPriorityQueue a -> List.List a"},{"name":"toSortedList","comment":" Convert a MinPriorityQueue to a sorted list.\n\nThe order of items in the resulting list is lowest-priority-first, thus may seem\nreversed from what you want. See note at the top.\n\n    toSortedList (fromList identity [ 100, 3, 1, 4, 1, 5, 9, 200 ])\n        --> [ 200, 100, 9, 5, 4, 3, 1, 1 ]\n\n","type":"MinPriorityQueue.MinPriorityQueue a -> List.List a"}],"binops":[]}]