unkindpartition / yaml-combinators Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
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?
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
.
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
Hi, I noticed yaml-combinators
doesn't currently build against aeson-2.0
. Thanks.
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)
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
| ^^^^^^^^^^^^^^^^^
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.