Elm-deque 1.2.0 released!

Just released version 1.2.0 of elm-deque.

Deque (double-ended queue) is a data structure which promises the same speed of operation wether you’re modifying or reading from the front or back of the deque. This in comparison with the builtin List, which is only fast if reading/modifiying from the start of the list.

In this version I’ve added initialize, repeat and range to make it easier and faster to construct a deque.

In addition, the performance of the structure is now more stable than before, and the performance of left, right, dropLeft and dropRight has increased by 4-5x.

Do check it out: https://package.elm-lang.org/packages/Skinney/elm-deque/latest/


elm-dique seems very useful. good job

1 Like

I wonder what might be a use case for this… I miss some examples in the source code…

You’d use this instead of a list if:

  1. You need to add/remove/read things to the end of the list
  2. You need to append two lists
  3. List is not fast enough for (1) and (2) for your usecase.

Array could work but:

  1. Arrays has slow appends
  2. Arrays are slow when removing things from the beginning.

Another use case for Dequeue might be if you want a FIFO (first-in first-out) data structure in order to implement a breadth-first search. Same as (1) above really.

Use a List for LIFO (last-in first-out) for a depth first search.


This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.