Functions for encoding not empty collections into JSON values
Decode a JSON array into a NotEmpty.Array
Decode a JSON array into a NotEmpty.Set.Set
Decode a JSON object into a NotEmpty.Dict
import Json.Decode as D
import Json.Decode.NotEmpty exposing(dict)
D.decodeString ( dict D.int ) "{ \"alice\": 42, \"bob\": 99 }" == Ok ( NotEmpty.Dict.fromListWithPair "alice" 42 [ ( "bob", 99 ) ] )
D.decodeString ( dict D.int ) "{}" == Err ...
Decode a JSON array into a
NotEmpty.List