Giter Club home page Giter Club logo

Comments (5)

pcapriotti avatar pcapriotti commented on July 18, 2024

It is possible, but you can't repeat an option with a default value, because in that case you get an infinite list as a result, and that makes the parser diverge. Just remove value "" from your parser and it will work. It doesn't make sense to have a default there, anyway.

from optparse-applicative.

wdanilo avatar wdanilo commented on July 18, 2024

Thank you very much! I'm sorry for posting an incorrect bug report.

2013/11/19 Paolo Capriotti [email protected]

It is possible, but you can't repeat an option with a default value,
because in that case you get an infinite list as a result, and that makes
the parser diverge. Just remove value "" from your parser and it will
work. It doesn't make sense to have a default there, anyway.


Reply to this email directly or view it on GitHubhttps://github.com//issues/58#issuecomment-28778138
.

from optparse-applicative.

danse avatar danse commented on July 18, 2024

i stumbled upon this same problem today. i tried a clumsy option (many str) and got a scary runtime loop. this seems like a noob trap, i propose to improve the README with this example, i'll put a quick patch together

from optparse-applicative.

danse avatar danse commented on July 18, 2024

actually the best solution would probably be a function like manyStrOption = many strOption, where the haddock can explain that this is a simple alias. to me this seems the more findable way to avoid similar error to new users of the library, and make adoption easier ... i see that you kept the interface very dry and orthogonal though so you probably want to keep it so

from optparse-applicative.

danse avatar danse commented on July 18, 2024

it could be modified as in #295 but it's not very visible, maybe we could have some examples of this usage elsewhere, or point to a guide which goes through applicative parsing?

from optparse-applicative.

Related Issues (20)

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.