GithubHelp home page GithubHelp logo

Concept: JSON Decoders about elm HOT 6 OPEN

jiegillet avatar jiegillet commented on August 23, 2024
Concept: JSON Decoders

from elm.

Comments (6)

mpizenberg avatar mpizenberg commented on August 23, 2024 2

Maybe encoding a request to the github api (which is well known), and decoding a response?

Good idea to work on a concrete real-life thing. We'd have to rebuild the JS Value ourselves directly in the test though as obviously there is no outside world access in tests file.

from elm.

jiegillet avatar jiegillet commented on August 23, 2024 1

Oh I still intend to keep rest-api, and I don't think having a difficult exercise is inherently a problem (I love those as a student), I'm just looking for another one that could help practicing decoders.
I don't think that rest-api is THAT complicated to understand if you read the description and the tests carefully though (I'll still try to make it clearer).

from elm.

jiegillet avatar jiegillet commented on August 23, 2024 1

Creating a proper new practice exercise is way more work than I'm willing to do!
I guess we'll need a really good concept exercise :)

from elm.

jiegillet avatar jiegillet commented on August 23, 2024

@ceddlyburge related to our discussion on #621, I went through the exercises that we don't have implemented yet (bin/configlet info) to look for other exercises that we could use to practice JSON decoding, but hopefully a bit simpler than rest-api.

Basically no other is meant to practice JSON, so we would have to stretch some scopes.

I found two that may be interesting: pov and zipper. Those two exercises involve trees, pov is bout rerooting trees and zipper traversing trees. I say that they are interesting because parsing trees is fun, all the other exercises have very standard, predictable inputs.
Unfortunately, these 2 are not really easy, so it doesn't help us that much.

If we are OK with very simple decoding, maybe we could use affine-cipher.

Best for last: bank-account could work as well, transforming the string instructions into meaningful types.

What do you think?

from elm.

ceddlyburge avatar ceddlyburge commented on August 23, 2024

I think the api concept is still good, its just that it is complicated, and the instructions are not as clear as they might be (especially for Elm I think).

Maybe we could jump on a call sometime and discuss how to make it clear what the student is supposed to do?

from elm.

ceddlyburge avatar ceddlyburge commented on August 23, 2024

Hmmm, none of those look that good. Maybe we could create a new exercise. Json encoding / decoding is something that people do find confusing when starting Elm, so it is a good idea. Maybe encoding a request to the github api (which is well known), and decoding a response?

from elm.

Related Issues (20)

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.