Issue 136: Clean up duplicate code Shim/Hsinfo.hs
http://code.google.com/p/yi-editor/issues/detail?id=136

New issue report by gwern0:
Currently the Shim/Hsinfo.hs module includes logic to call and parse the
output of "ghc --print-libdir", since it is necessary to know the GHC
directory in order to use the GHC API. However, this or functionally
identical code is used in several many projects besides Yi (such as Hint
and Metaplug), and recently a small library was released to package this
code: ghc-paths
<http://hackage.haskell.org/cgi-bin/hackage-scripts/package/ghc-paths>.

This obviously wouldn't eliminate all the code, but a good 20 lines could
probably be saved. I've tested out using it in Hint, and it seems to work.

This is potentially a downside: ghc-paths seems to acquire the libdir at
its compile time, so I think if the library directory were to change
between the ghc-paths/yi compilation and runtime, and one were to try to
use the GHC API-related features, the String would be out of date. I don't
know whether this is actually the case, or if this would be a fatal
objection, but it's worth mentioning.

(This change should be fairly easy - a matter of deleting some code, adding
a dep to yi.cabal, and adding an appropriate import and use; but I cannot
currently compile Yi at all so I am uncomfortable making the changes myself.)


Issue attributes:
        Status: Accepted
        Owner: gwern0
        Labels: Type-Cleanup-Refactor Priority-Medium

-- 
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
Yi development mailing list
[email protected]
http://groups.google.com/group/yi-devel
-~----------~----~----~----~------~----~------~--~---

Reply via email to