Skip to content
This repository has been archived by the owner on May 15, 2021. It is now read-only.

wittjosiah/elm-ordered-dict

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEPRECATED this package was merged with y0hy0h/ordered-containers. For latest updates, please use that package instead.

elm-ordered-dict

A dictionary mapping unique keys to values preserving insert order

import OrderedDict exposing (OrderedDict, empty, insert, insertAt)

example : OrderedDict Int String 
example = empty
   |> insert 1 "one"
   |> insert 3 "three"
   |> insert 4 "four"
   |> insertAt 1 2 "two"
   
{-
   { order = [ 1, 2, 3, 4 ]
    , dict =
        Dict.fromList
            [ ( 1, "one" )
            , ( 2, "two" )
            , ( 3, "three" )
            , ( 4, "four" )
            ]
    }
-}