GithubHelp home page GithubHelp logo

elm-json's People

Contributors

lambdatoast avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jonathanfrawley

elm-json's Issues

Compilation fails with Elm 0.13

After doing elm-get install lambdatoast/elm-json 0.3.4 an elm --make --only-json Main.elm fails when compiling Json.Decoder. The specific output is as follows:

$ elm --make --only-js Main.elm 
[1 of 12] Compiling Json.Output         ( elm_dependencies/lambdatoast-elm-json/0.3.4/Json/Output.elm )
[2 of 12] Compiling Json.Process        ( elm_dependencies/lambdatoast-elm-json/0.3.4/Json/Process.elm )
[3 of 12] Compiling Json.Accessor       ( elm_dependencies/lambdatoast-elm-json/0.3.4/Json/Accessor.elm )
[4 of 12] Compiling Json.Decoder        ( elm_dependencies/lambdatoast-elm-json/0.3.4/Json/Decoder.elm )
Import Error: Could not import value 'Json.Output.Error'.
    It is not exported by module Json.Output

I took a look at the failing files, it doesn't look like anything's wrong with it to me. I'm wondering if elm is getting confused about the modules it's importing.

Support for decode4, decode5, etc.

Hi,

I'm wondering how difficult it would be to add support for greater than 3 fields to decode? I could have a go at doing this myself if you could give me some guidance on how you think it should work.

Thanks,
df3n5.

Can't decode into Json.Value

Hiya, we spoke yesterday on IRC. I am trying to write a JsonRpc2 decoder. There clearly isn't a built-in decoder, so I tried to create one:

json_value : Decoder Json.Value
json_value v = case v of
              Json.Value x -> output x
              _ -> Error <| decoderErrorMsg "{json_value}"

type JsonRpcRequest = { method: String, id: String, params: Json.Value }

jsonRpcDecoder1 : Decoder JsonRpcRequest
jsonRpcDecoder1 = decode3 ("method" := string) ("id" := string) ("params" := json_value) JsonRpcRequest

jsonRpcDecoderCombined : Decoder JsonRpcRequest
jsonRpcDecoderCombined = jsonRpcDecoder1 {-`or` jsonRpcDecoder2-}

testdata1 = "{\"method\":\"setHost\",\"id\":\"foo\", \"params\":{123, \"Hello\"}}"

However, this gives me the following error:

Could not find type constructor 'Json.Value' while checking types.

I'm a newbie to Elm so would appreciate some guidance :) Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.