jgoerzen / configfile Goto Github PK
View Code? Open in Web Editor NEWConfig file parsing/writing [Haskell]
Home Page: http://wiki.github.com/jgoerzen/configfile/
License: Other
Config file parsing/writing [Haskell]
Home Page: http://wiki.github.com/jgoerzen/configfile/
License: Other
src/Data/ConfigFile/Types.hs:39:1: error:
Could not load module ‘Control.Monad.Error’
It is a member of the hidden package ‘mtl-2.2.2’.
Perhaps you need to add ‘mtl’ to the build-depends in your .cabal file.
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
39 | import Control.Monad.Error
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
As a Hackage trustee I have revised the affected versions on Hackage. See e.g. https://hackage.haskell.org/package/ConfigFile-1.1.4/revisions/.
As can be seen on Hackage at the moment:
dist/build/tmp-15743/src/Data/ConfigFile/Monadic.hs:34:1:
parse error on input `import'
If I have got an empty section in file readfile function will fails:
qnikst@qnikst bug % cat test
[secta]
#opt1 = b
[sectb]
opt1 = d
qnikst@qnikst bug % runhaskell configfile.hs
configfile.hs: (ParseError "\"test\" (line 4, column 1):\nunexpected NEWSECTION \"sectb\"","parser")
version: 1.0.6
The standart setup gives me a value for the option-name marginTop
only if the config looks like this:
[notification-center]
margintop: 10
What i want is:
[notification-center]
marginTop: 10
This is not working though. I get the error-message (NoOption "margintop","get (notification-center/margintop)")
. The only difference is the capital T in Top. The documentation states that option-names are case-insensitive though.
To make the libraray even more convenient to use, some helpers similiar to the following would be highly appreciated:
-- ^Retrieve with default value
getDef :: MonadError CPError m => ConfigParser -> SectionSpec -> OptionSpec -> a -> m a
getDef cp s o d = if has_option cp s o then get cp s o else return d
-- ^Retrieve as optional
getOpt :: MonadError CPError m => ConfigParser -> SectionSpec -> OptionSpec -> m (Maybe a)
getOpt cp s o = if has_option cp s o then liftM Just (get cp s o) else return Nothing
The link to the file format in the wiki, which seems pretty crucial, is currently broken.
Thanks!
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.