lovasoa/elm-rolling-list/1.1.2

NOTE: the latest version is 1.1.4

lovasoa/elm-rolling-list

Circular buffer

A Rolling List is a list with a finite number of elements that can be inifintely iterated over.

import RollingList

let
    rl = RollingList.fromList [1,2]
in
    RollingList.current rl
--> Just 1
let
    rl = RollingList.fromList [1,2]
    rolled = RollingList.roll rl
in
    RollingList.current rolled
--> Just 2
let
    rl = RollingList.fromList [1,2]
    rolled = RollingList.roll rl
    rolledTwice = RollingList.roll rolled
in
    RollingList.current rolledTwice
--> Just 1

test

Just run npm install && npm test