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

export HasCompleter from non-internal module #155

Closed
joeyh opened this issue Sep 14, 2015 · 2 comments
Closed

export HasCompleter from non-internal module #155

joeyh opened this issue Sep 14, 2015 · 2 comments

Comments

@joeyh
Copy link

joeyh commented Sep 14, 2015

HasCompleter is in the .Internal module. That makes code like this potentially break when internals change:

completeRemotes :: HasCompleter f => Mod f
completeRemotes = completer $ mkCompleter ..

completeBackends :: HasCompleter f => Mod f a
completeBackends = completeWith (map Backend.name Backend.list)

Since I want these to work for both OptionFields and ArgumentFields, I can't specialize the f, and so need the HasCompletor. Of course, I could instead define these as:

completeRemotes :: Completer
completeRemotes = mkCompleter ..

completeBackends :: [String]
completeBackends = map Backend.name Backend.list

But the different types and different ways to use these two values seem less simple and composable than the first version. Especially because completeBackends's type doesn't tell what it's for at all.

So, could you please have one of the non-Internal modules export HasCompleter?

@HuwCampbell
Copy link
Collaborator

optparse doesn't actually have any internal modules, it's just naming. So there's no more risk than any other part of the API.

@HuwCampbell
Copy link
Collaborator

Done

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