haskell / happy

The Happy parser generator for Haskell
Other
273 stars 85 forks source link

Split up CLI into packages #239

Open knothed opened 2 years ago

knothed commented 2 years ago

Currently, CLI handling is done exclusively in Main.

Library authors which depend on happy packages would however benefit from a model where the CLI handling is also distributed to the packages which use the CLI flags.

An option would be to create an additional -cli package for each currently existing happy package. For example, the happy-frontend-cli package would then contain the CLI flags and the CLI handling that is relevant for the happy-frontend package.

All logic which is currently held in Main would be split into these -cli packages, and Main would just stitch these separate CLI stubs together in a sensible way. This would enable library authors to exchange happy package components without having to copy and adapt the whole Main file.

I'd be happy to work on an implementation if desired.