Giter VIP home page Giter VIP logo

configfile's People

Contributors

dmwit avatar erikd avatar gwern avatar jgoerzen avatar roelvandijk avatar stepcut avatar sundresh avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

configfile's Issues

Build failures with mtl-2.3

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/.

Build of docs fails

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'

Parser fails on empty section

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

Case-insensitivity not working on Optionnames

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.

Provide additional convenience helper functions

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

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.