Giter Site home page Giter Site logo

yaml-combinators's Introduction

yaml-combinators's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

yaml-combinators's Issues

object parser with additional fields

Would you accept a PR for a object' function which would not validate that all fields are consumed like in the current object function? Or maybe am I missing a good way to deal with this use case?

Remove generics-sop dependency

Hi Roman, thank you for the fantastic library!

Would you accept a patch to remove generics-sop as a dependency? I'd prefer not to pull in the orphan Generic instance of Value.

The value 0 cannot be a string

This is the simplest yaml file:
maxOutputSQLFileSize : 0

and I parse it with
field "maxOutputSQLFileSize" string
I get: Expected String instead of: 0

Problem is that the value 0 in the yaml file could also be the string 10Kb or the string 6Gb....
So the type of the field has to be string.
Because there is no field name in the error message is not very helpfull.

Kees

Shortcut to (Parse Value)?

Is there a simplified way to create a Parse Value without having to <|> each type? In situations where it can except any valid expression such as
(,) <$> field "name" string <*> field "value" parseValue
:: Parse (Text, Value)

Build error on ghc-8.4.3

I'm not sure whose issue it is, because I tried to compile on a freshly installed GHC 8.4.3 on Windows. I used cabal-install and it successfully built all of the long chain of dependecies. But on the yaml-combinators it throwed this error:

src\Data\Yaml\Combinators.hs:210:10: error:
    * No instance for (Semigroup (ParserComponent a fs))
        arising from the superclasses of an instance declaration
    * In the instance declaration for `Monoid (ParserComponent a fs)'
    |
210 | instance Monoid (ParserComponent a fs) where
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src\Data\Yaml\Combinators.hs:223:10: error:
    * No instance for (Semigroup (Parser a))
        arising from the superclasses of an instance declaration
      There are instances for similar types:
        instance Semigroup
                   (attoparsec-0.13.2.2:Data.Attoparsec.Internal.Types.Parser i a)
          -- Defined in `attoparsec-0.13.2.2:Data.Attoparsec.Internal.Types'
        instance Semigroup
                   (aeson-1.3.1.1:Data.Aeson.Types.Internal.Parser a)
          -- Defined in `aeson-1.3.1.1:Data.Aeson.Types.Internal'
    * In the instance declaration for `Monoid (Parser a)'
    |
223 | instance Monoid (Parser a) where
    |          ^^^^^^^^^^^^^^^^^

Installation fails

cabal install yaml-combinators

leads to:

Resolving dependencies...
Build profile: -w ghc-8.6.5 -O1
In order, the following will be built (use -v for more details):
 - yaml-combinators-1.1.1.1 (lib) (requires build)
Starting     yaml-combinators-1.1.1.1 (lib)
Building     yaml-combinators-1.1.1.1 (lib)

Failed to build yaml-combinators-1.1.1.1.
Build log (
/Users/oleroel/.cabal/logs/ghc-8.6.5/yml-cmbntrs-1.1.1.1-4cc40a52.log ):
Configuring library for yaml-combinators-1.1.1.1..
Preprocessing library for yaml-combinators-1.1.1.1..
Building library for yaml-combinators-1.1.1.1..
[1 of 1] Compiling Data.Yaml.Combinators ( src/Data/Yaml/Combinators.hs, dist/build/Data/Yaml/Combinators.o )

src/Data/Yaml/Combinators.hs:255:5: error:
    • The constructor ‘ADT’ should have 4 arguments, but has been given 3
    • In the pattern: ADT _ _ cons
      In a pattern binding:
        ADT _ _ cons = datatypeInfo (Proxy :: Proxy Value)
      In the expression:
        let ADT _ _ cons = datatypeInfo (Proxy :: Proxy Value)
        in hliftA (\ (Constructor name) -> K name) cons
    |
255 |     ADT _ _ cons = datatypeInfo (Proxy :: Proxy Value)
    |     ^^^^^^^^^^^^
cabal: Failed to build yaml-combinators-1.1.1.1. See the build log above for
details.

I guess this is an easy to fix bug, but I am new to Haskell. A bug fix attempt from my side would be more like monkey typing than profound knowledge based work (like: adding just another "_" ?).

The culprit in the code is to be found here

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.