suppose I have two modules NecessaryModule1 & NecessaryModule2 (as outlined in the post Haskell : loading ALL files in current directory path. Then I have noticed in both WinGHCi and GHCi that if I do :
> :load NecessaryModule1
[1 of 1] Compiling NecessaryModule1 ( NecessaryModule1.hs, interpreted )
Ok, modules loaded: NecessaryModule1.
> addNumber1 2 3
5
> :load NecessaryModule2
[1 of 1] Compiling NecessaryModule2 ( NecessaryModule2.hs, interpreted )
Ok, modules loaded: NecessaryModule2.
> addNumber1 2 3
<interactive>:1:1: Not in scope: `addNumber1'
i.e. loading NecessaryModule2 eliminates all the functions from NecessaryModule1.
So does that mean that the only way I can simultaneously load NecessaryModule1 & NecessaryModule2 is to use a third file (which imports both NecessaryModule1 & NecessaryModule2) and then load that third file? (e.g. see test.hs in Haskell : loading ALL files in current directory path) Thanks.
---------------------------------------------------------------------------------------
[RESPONSE TO geekosaur]
Hi, so if I have done :load NecessaryModule1
and then I want to load the module in MyMod.hs :
--MyMod.hs
module MyMod where
import Data.List
f x = sort x
then how would I do this? In Haskell : unload module in WinGHCi Riccardo explains that :module
assumes that the modules have already been loaded. So does this mean that the only way to achieve the loading of multiple custom modules is to load them with a single call of the :load
function? Thanks.