hawk
hawk copied to clipboard
Support fancy import statements
Such as
import Prelude hiding (lines, unlines)
for example.
While reading the documentation for hint
, I stumbled upon a function which lists all the bindings exported by a module. If we need any hacks in order to support fancy import statements, that function will probably be help to implement them.
I have an idea: for selective and hiding imports we can just populate the user prelude.hs
with exports. So a Prelude.hs
like:
import Data.List (length)
will be converted to
module Hawk.M12345678 (length) where
import Data.List (length)
same for hiding, we can take everything exported by the module and remove what has been hidden. I think hint
has something to get what is exported by a module. This will require a bit of work, but it can be done and it is invisible to the user
This is exactly the kind of magic I like :)