Deprecate `auto`?

Open
#304 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
haskell
Domain
cli

Research direction

Start by reviewing the existing auto reader and the proposed integralOption and fractionalOption alternatives. Consider how maybeReader and eitherReader would support custom parsers, then clarify the deprecation scope and migration path before defining what implementation and documentation would be complete.

Written by the indexing model from the issue text.

Description

Haven't really thought this through for more than a minute, but wondering if there's any interest in eventually deprecating auto in favour of more concrete readers.

It's been a reliable source of bugs for me / teams I've worked on, since someone inevitably ends up using auto for a string type or a newtyped string/integral. These tend to appear both when writing initial parsers and when changing code a module or two away, in the same way show tends to create subtle non-local bugs when refactoring.

Would involve adding integralOption / fractionalOption for the cases where you might actually want Read, then deprecating auto. Users who want to keep using custom parsers can use maybeReader / eitherReader so their intent is made clear in the code.

Dominant language
Haskell
Stars
957
Forks
124
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pcapriotti/optparse-applicative

All issues in pcapriotti/optparse-applicative

Similar issues

More Haskell issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.