-
Notifications
You must be signed in to change notification settings - Fork 63
Description
If I have a module that happen to have the same name as some other module in an unrelated package already installed by mcabal,
then MicroHs silently uses the installed one. I think it should prefer the local one instead.
My use case is the following. I like to support older versions of libraries, and at the same time I don't like to clatter the code
with CPP. So instead I create "shim" modules that export the current version of the API even for older libraries.
For example, in scanner I have a compat folder where I have e.g. Data.Either module. For versions of base older then 4.7.0
it exports isRight and isLeft, which where added later. For newer versions of base it just reexports the original module.
The benefits of such an approach are two fold. First of all, you always write code assuming the most recent version of API
without any inline CPP. At the same time when developing the code locally you don't need the "shim" modules assuming
that you are using the newest libraries, e.g. you can load the code into ghci without shims. Another benefit is that when
you decide to stop supporting the old version of a library, you can just delete the "shim" module without changing the
existing code at all.
Unfortunately it doesn't work with MicroHs. As a result, I have to make the shim module explicit, for example see Yuras/scanner#14 (comment) Is it possible to change the behavior? It will help writing portable code.