Additions:
fromMaybe
: LikefromResult
but forMaybe a
Additions:
optionalNullableField
: PuttingoptionalField
andnullable
together
Additions:
url
: Decode JSON strings toelm/url#Url
s
Removals:
dict
:elm/json
already comes with adict
encoder
Additions:
datetime
: Re-introduce decoding a date+time, toPosix
Changes:
- doc tests are re-enabled
- docs are fixed
Removals
date
: Initial 0.19 compatibility means (temporarily) removing the `date** decoder
Other stuff:
- Elm 0.19 support!
- doc tests are disabled for now
Additions:
keys
allows extracting only the keys from a JSON object
Additions:
dict
helps encodingDict
Additions:
collection
helps with decoding array-like JavaScript structures such asHTMLCollection
combine
helps combining aList
of decoders into a singleDecoder
for aList
of such things
Additions:
indexedList
to get access to the current js array index while decoding
Other Stuff:
elm-doc-test
is nowelm-verify-examples
!
Additions:
parseInt
andparseFloat
for weird api's that return numbers as stringsdoubleEncoded
for a more generic json as a string in json issues
Fixes:
optionalField
decodes the field, rather than the surrounding object now.
Other Stuff:
- Code Style conforms to elm-format@exp
- Doc tests!
- Travis integration
Additions:
optionalField : String -> Json.Decode.Decoder a -> Json.Decode.Decoder (Maybe.Maybe a)
- Decode an optional field, succeeding withNothing
if it is missing, but still giving an error if it is malformed.
Breaking Changes:
- Upgrade for Elm 0.18
- Removed
maybeNull
in favor ofJson.Decode.nullable
- Removed
lazy
in favor ofJson.Decode.lazy
- Renamed
apply
toandMap
and reversed arguments toDecoder a -> Decoder (a -> b) -> Decoder b
to make it work nicely with(|>)
Additions:
fromResult : Result String a -> Decoder a
- convert aResult
to aDecoder
, helpful inandThen
callbacks following the removal ofJson.Decode.customDecoder
Json.Encode.Extra.maybe : (a -> Value) -> Maybe a -> Value
- encode aMaybe a
given an encoder fora
. Thanks to @hendore for this addition.
Other Stuff:
- Code style conforms to elm-format
Additions:
Json.Decode.Extra.sequence
- lets you generate a list ofDecoder a
and attempt to apply them to a JSON list. Authored by @cobalamin
Breaking Changes:
- Upgrade for Elm 0.17