Giter Club home page Giter Club logo

yaml's People

Contributors

devvypaws avatar terezka avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

yaml's Issues

Contribution guidelines

I came across this package because I need to parse and generate YAML in Elm. I want to ask about contribution guidelines, mainly:

  1. Is it intentional that the package doesn't have package.json with dev deps to run tests?
  2. Is it intentional that elm.json doesn't have test deps either?
  3. When I set up testing I found several failing tests - is it just me or is it failing in general?
  4. What version of elm-format is used?

Case insensitive parsing of string

I tried to parse the following YAML:

  - name: GARLIC
    units: 
      - clove
      - grams
  - name: "GARLIC POWDER"
    units: 
      - grams

For some reasons GARLIC is parsed as garlic (lowercase) while GARLIC POWDER is parsed in uppercase.

As a fix, I used the following parser:

(Decode.field "name"
    (Decode.string
        |> Decode.andThen (String.toUpper >> Decode.succeed)
    )
)

Err (Parsing "TODO deadEndsToString")

Hi, I've run into an error I can't seem to get around -- could just be me, but here is a stripped down version. The problem arises with code like

decodeItem : Decoder ( String, Int )
decodeItem =
    Decode.string
        |> Decode.andThen baz

I've reduced baz to a bare minimum, so that it always succeeds, always returning the same thing:

baz : String -> Decoder ( String, number )
baz =
    \s -> Decode.succeed ( "Test", 88 )

Here is the error:

↓ VerifyExamples.Yaml.DecodeItem0
✗ #decodeItem:

    Decode.fromString decodeItem "(Test:88)"
    --> Ok ("Test", 88)

    Ok ("Test",88)
    ╷
    │ Expect.equal
    ╵
    Err (Parsing "TODO deadEndsToString")

And here is the test code:

{-|

    import Yaml.Decode as Decode exposing (Decoder)

    Decode.fromString decodeItem "(Test:88)"
    --> Ok ("Test", 88)

-}
decodeItem : Decoder ( String, Int )
decodeItem =
    Decode.string
        |> Decode.andThen baz

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.