krisajenkins / elm-exts / Exts.Delta

A system for tracking players that enter and leave a stage, a-la D3.

Implementation detail: This code is hampered by the lack of Elm's type classes. Note the following:

  1. Performance may degrade badly as the number of elements increases.
  2. It is up to you to ensure (a) implments Eq correctly.


type alias Delta a =
{ entering : List a
, continuing : List a
, leaving : List a 
}

A data-structure that maintains the difference list of entering, continuing and leaving players.

empty : Delta a

A default starting state for Deltas.

generation : List a -> Delta a -> Delta a

Update the delta by inspecting a list of players.