Cindiary/elm-id/1.0.0

NOTE: the latest version is 7.1.0

ID.Dict

type alias Dict id value =
Dict id value

A Dict for IDs

empty : Dict (ID a) value

Same as Dict.empty

fromList : List ( ID a, value ) -> Dict (ID a) value
toList : Dict (ID a) value -> List ( ID a, value )

Same as Dict.toList

isEmpty : Dict (ID a) value -> Bool

Same as Dict.isEmpty

size : Dict (ID a) value -> Int

Same as Dict.size

member : ID a -> Dict (ID a) value -> Bool

Same as Dict.member

get : ID a -> Dict (ID a) value -> Maybe value

Same as Dict.get

getFrom : Dict (ID a) value -> ID a -> Maybe value

Same as get but with the arguments swapped, useful for pipelines

insert : ID a -> value -> Dict (ID a) value -> Dict (ID a) value

Same as Dict.insert

remove : ID a -> Dict (ID a) value -> Dict (ID a) value

Same as Dict.remove

update : ID a -> (value -> value) -> Dict (ID a) value -> Dict (ID a) value

Same as Dict.update but does not operate on Maybe values

map : (ID a -> b -> c) -> Dict (ID a) b -> Dict (ID a) c

Same as Dict.map

filterMap : (ID a -> b -> Maybe c) -> Dict (ID a) b -> Dict (ID a) c

Same as List.filterMap but for Dicts

fold : (ID a -> value -> c -> c) -> c -> Dict (ID a) value -> c

Same as Dict.foldl

ids : Dict (ID a) value -> List (ID a)

Same as Dict.keys

values : Dict (ID a) value -> List value

Same as Dict.values

(ID a -> value -> Bool)
-> Dict (ID a) value
-> ( Dict (ID a) value, Dict (ID a) value )
diff : Dict (ID a) b -> Dict (ID a) c -> Dict (ID a) b

Same as Dict.diff

intersect : Dict (ID a) b -> Dict (ID a) c -> Dict (ID a) b

Same as Dict.intersect, but can accept dictionaries with different value types

union : Dict (ID a) value -> Dict (ID a) value -> Dict (ID a) value

Same as Dict.union

#Json

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

Encode a Dict to a JSON value

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

JSON Decoder for Dict