Allow both relative and absolute module paths.#1
Allow both relative and absolute module paths.#1Fuuzetsu wants to merge 1 commit intoNorfairKing:masterfrom
Conversation
This allows for the following to work: ``` [nix-shell:~/programming/easyspec]$ stack build --nix easyspec && stack exec --nix -- easyspec discover ../../../../tmp/MySort.hs MySort.mySort mySort xs <= xs = y <= y mySort (mySort xs) = mySort xs [nix-shell:~/programming/easyspec]$ stack build --nix easyspec && stack exec --nix -- easyspec discover /tmp/MySort.hs MySort.mySort mySort xs <= xs = y <= y mySort (mySort xs) = mySort xs ``` I may or may not have broken stuff in `easyspec-evaluate`: I mostly just changed the types to line up there. If there's a good way to test that, I can do it. Not only can we use absolute paths now, relative paths of the `src/Foo/Bar.hs` sort are fixed: we ask GHC to give us the module name instead of trying to guess it. In general it's not possible to guess a module name from the file path with any accuracy.
|
Also this is without zifter; I tried to run it but So I just gave up. |
|
Blocked on #2 I guess. |
|
You could already specify paths from any directiry with |
|
I have not tried with imports nor didn't try running the tests. I will try in coming days. I don't see why imports should become broken as far as GHC is concerned at least: it should be able to find modules just by walking the hierarchy fine. |
Okay, but how do you know the difference between |
|
GHC tells us the module name. It's either in the file or Main. |
Genius! I'll take a closer look at this PR when we've chosen a license (and only if you're okay with it) and try to fix this. |
This allows for the following to work:
I may or may not have broken stuff in
easyspec-evaluate: I mostlyjust changed the types to line up there. If there's a good way to test
that, I can do it.
Not only can we use absolute paths now, relative paths of the
src/Foo/Bar.hssort are fixed: we ask GHC to give us the module nameinstead of trying to guess it. In general it's not possible to guess a
module name from the file path with any accuracy.