Skip to content

Remove haskell-doc-prelude-types from haskell-doc.el #1179

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

Closed
geraldus opened this issue Feb 22, 2016 · 6 comments
Closed

Remove haskell-doc-prelude-types from haskell-doc.el #1179

geraldus opened this issue Feb 22, 2016 · 6 comments

Comments

@geraldus
Copy link
Contributor

Since we already rely on GHC output for supported language extensions and pragmas why not to drop haskell-doc-prelude-types from haskell-doc.el? This could be done parsing output of ghc -e ':bro Prelude'.

One caveat: now stack allows multiple GHC versions without any global GHC compiler in PATH, I think we should add these variables to session when starting new interactive process and populate them running stack exec -- ghc … because different versions of GHC possibly could have different Preludes and options/extensions. Then in case of presence interactive session associated to current buffer completion and doc-string providers should use session variables instead of global ones.

@gracjan
Copy link
Contributor

gracjan commented Feb 23, 2016

Actually I was about to propose exactly opposite direction: that is NOT populating pragmas and extenstions dynamically from the ghc available in PATH, instead prepopulate both in the source code as a set union of all options available on all compilers from 7.2 to 8.0.

It is just me who is bothered that the ghc that happens to be found in the PATH is some dysfunctional random installation that I forgot to remove?

@geraldus
Copy link
Contributor Author

prepopulate both in the source code as a set union of all options available on all compilers from 7.2 to 8.0

It's tedious but pretty simple. Can we even further and populate this things using Travis automatically when merging stuff in master branch? For example create some template files, and make Travis generate required lists running same command for custom set of compilers then run normal build and test routine and finally somehow commit these files to master?
Or maybe to have some submodule git repository containing these variables which is updated once when new GHC version is added? (So, all this paragraph can be re-worded to "can we automate this?")

On other hand, how haskell-mode will choose what list to use for arbitrary source file?

It is just me who is bothered that the ghc that happens to be found in the PATH is some dysfunctional random installation that I forgot to remove?

I don't bothered with this, however I always keep this possibility in mind.

@gracjan
Copy link
Contributor

gracjan commented Feb 23, 2016

Yes, automation is king.

I think we should have a script that adds items to lists. So when a new compiler version is released all the missing flags or extensions are added to the list. Each item on the list could have attached a version of the compiler when it was seen first time.

The lists should just accumulate stuff, so that completion can propose any of the options of any of the versions of a compiler.

@geraldus
Copy link
Contributor Author

One last caveat how to generate keyword list or just leave it hard-coded?

@gracjan
Copy link
Contributor

gracjan commented Feb 23, 2016

Hard coded. This does not change that often :)

@gracjan gracjan changed the title Cut haskell-doc-prelude-types from haskell-doc.el Remove haskell-doc-prelude-types from haskell-doc.el Feb 23, 2016
@geraldus
Copy link
Contributor Author

geraldus commented Mar 6, 2016

Related #1194
Closing this one

@geraldus geraldus closed this as completed Mar 6, 2016
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