Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for different help messages for same argument in different constructors #60

Open
GregorySchwartz opened this issue May 1, 2020 · 1 comment

Comments

@GregorySchwartz
Copy link

GregorySchwartz commented May 1, 2020

I don't know if it's possible, but something like:

data Example1 =
  Example1
    { foo :: Int    <?> "Documentation for the foo flag in Example1"
    , bar :: Double <?> "Documentation for the bar flag in Example1"
    }
  | Example2
    { foo :: Int    <?> "Documentation for the foo flag in Example2"
    , bar :: Double <?> "Documentation for the bar flag in Example2"
    }

    deriving (Generic, Show)

Probably requiring some type of record fields. This feature would be quite useful in that you could have a program with multiple entry points with the same arguments, such as input but take in different formats.

@Gabriella439
Copy link
Owner

@GregorySchwartz: I don't think it's possible, mainly due to a Haskell restriction requiring fields of the same name to have the same type for different constructors and the help text is part of the field type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants