Cindiary/elm-id/3.1.1

NOTE: the latest version is 7.1.0

ID.CounterDict

type alias CounterDict id value =
Dict (Counter id) id value

A dictionary with counter

empty : a -> CounterDict (ID a) value

Create a empty CounterDict

fromList : a -> List value -> CounterDict (ID a) value

Create a new CounterDict from a list of values and assign an ID to every value

value
-> CounterDict (ID a) value
-> ( ID a, CounterDict (ID a) value )

Insert a value with a new ID into the Dictionary

Json

encode : (value -> Value) -> CounterDict id value -> Value

Encode CounterDict to a JSON value

decoder : Decoder value -> Decoder (CounterDict id value)

JSON Decoder for `SetCounterDict