-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Currently Hawk exposes some modules independently by what the user set on its configuration file (Prelude.hs). This is due to the fact that I considered those modules essential for any Haskell application. What do you think, we should keep them always loaded? The list of modules is in Config.hs, I report it here
"System.Console.Hawk.Representable"
"GHC.Num"
"GHC.Real"
"GHC.Types"
"Data.ByteString.Lazy.Char8"
"Data.Bool"
"Data.Char"
"Data.Either"
"Data.Eq"
"Data.Function"
"Data.Int"
"Data.Maybe"
"Data.Ord"
note that currently Hawk exposes Prelude with the qualification P, so if we want to have True instead of P.True we must import Data.Bool. Same for almost all the others modules. That's why I think we should keep them automatically imported. Maybe we could, in future, give an option to the user to avoid automatic loading of default modules.
The exceptions are System.Console.Hawk.Representable, that is automatically imported because Hawk cannot work without it, and Data.ByteString.Lazy.Char8 that is imported because Hawk works on (lazy) ByteStrings. Now, for the first module we can't do much, it must be loaded by default. For ByteString I don't know, if we load it in this way then many functions that are usually related to lists will be for the ByteString type. This can be misleading:
hawk -e "take 2 [1,2]"
Won't compile:
Couldn't match expected type `Data.ByteString.Lazy.Internal.ByteString'
with actual type `[t0]'
For me:
- keep
Preludewith qualificationP. If the user wants it exposed without qualification he can set it inPrelude.hs System.Console.Hawk.Representable,GHC.Num,GHC.Real,GHC.Types,Data.Bool,Data.Char,Data.Either,Data.Eq,Data.Function,Data.Int,Data.MaybeandData.Ordshould be imported by default, not matter whatPrelude.hscontains. I don't know if this list of modules is enough or I missed something.Data.ByteString.Lazy.Char8should not be imported by default. The user must import it inPrelude.hs. In this way if he wantsListexposed without qualification he can do that. The defaultPrelude.hsshould import it with qualificationBS