[feat] allow passing list literals to mod builders
I have found myself writing things like strOption $ mconcat [... quite often and upon discussion, @Qqwy suggested just using list literals, this PR implements this idea, it works like a charm. the IsList instance even respects its laws!
It allows writings things like
... prefs [shoHelpOnEmpty, showHelpOnError]
... strOption [long "bla", short 'b']
etc
That's an interesting approach.
I try to keep optparse-applicative very conservative with regards to its extensions (we're just Haskell 98 + Existential Types at the moment), so I don't think it's very likely this will be merged as is.
But I'll keep this open now so it can be discussed further.
well the extension is required to write the instance, it’s not that I’m making excessive use of TypeFamilies, unfortunately there’s no other good place for this to go, orphan instances are sad :(
Alright, let’s see :)
@HuwCampbell would you be happy to exclude the change from older GHC by the use of CPP or would that be too much of a complexity increase?
@HuwCampbell what kind of improvements could I do to this PR such that it can be merged?
Look, I'm not sure right now. While it's a minor inconvenience to add mconcat, and I do think that it's probably a better API to accept a list.
But unfortunately I don't think I can't make breaking changes like that in the next release.