Re: [elm-discuss] Decode fails on empty string

2016-05-17 Thread Richard Osafo
@Janis Thanks. It is the same issue. Not a show stopper though since a simple `if` fixes it. @Fedor Indeed but in that case, don't you think Json.Decode.succeed and Json.Decode.fail must be updated to point that out? When you do `oneOf` with `succeed` in it, you naturally expect it to work as t

Re: [elm-discuss] Decode fails on empty string

2016-05-17 Thread Janis Voigtländer
Add this as a comment on the GitHub issue, then? ​ 2016-05-17 10:54 GMT+02:00 Fedor Nezhivoi : > Empty string isn't valid JSON. Try open Chrome DevTools and write > JSON.parse(""). > > 2016-05-17 14:51 GMT+06:00 Janis Voigtländer >: > >> See https://github.com/elm-lang/core/issues/585. Considere

Re: [elm-discuss] Decode fails on empty string

2016-05-17 Thread Fedor Nezhivoi
Empty string isn't valid JSON. Try open Chrome DevTools and write JSON.parse(""). 2016-05-17 14:51 GMT+06:00 Janis Voigtländer : > See https://github.com/elm-lang/core/issues/585. Considered a bug. > ​ > > 2016-05-17 10:45 GMT+02:00 Richard Osafo : > >> Hi, >> I was decoding an http response (bod

Re: [elm-discuss] Decode fails on empty string

2016-05-17 Thread Janis Voigtländer
See https://github.com/elm-lang/core/issues/585. Considered a bug. ​ 2016-05-17 10:45 GMT+02:00 Richard Osafo : > Hi, > I was decoding an http response (body can be blank) and realized that > Decode fails on empty string. Gives the error "Given an invalid JSON: > Syntax error". Is this by design

[elm-discuss] Decode fails on empty string

2016-05-17 Thread Richard Osafo
Hi, I was decoding an http response (body can be blank) and realized that Decode fails on empty string. Gives the error "Given an invalid JSON: Syntax error". Is this by design or a bug? import Html exposing (text) import Json.Decode as Decode exposing (..) main = text <| toString test te