Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7845301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:10:45+00:00 2026-06-02T17:10:45+00:00

suppose I have two modules NecessaryModule1 & NecessaryModule2 (as outlined in the post Haskell

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T17:10:46+00:00Added an answer on June 2, 2026 at 5:10 pm

    Ok, there are two things to consider : what “:module” know to find, and what is actually in context at a given prompt.

    :module always know how to find modules in installed packages (that are not hidden) and by default that’s all that it has access to. But you can use :load to make it aware of some other modules in specific files. Each call of :load reset the set of additional modules (and :reload keep the same set of loaded module but refresh their content). Also :load put you into the context of the first module you specify.

    In other word, if you want to get into a context where both modules are imported, you need to do :

    > :load Module1 Module2
    > :module Module1 Module2
    

    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?

    In other words : yes ! (but that doesn’t seem to be a problem except that you need to repeat modules you loaded in the past if you still want to use them in the new context)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have two XML files. First XML File: <?xml version=1.0?> <AccessRequest xml:lang=en-US> <AccessLicenseNumber>Your_License</AccessLicenseNumber>
Suppose I have two scripts. The first one puts (with mv command) some files
Suppose we have two modules with cyclic dependencies: # a.py import b def f():
suppose you have two modules like module Foo.A where foo = 42 and module
Suppose I have two text files. The first one, called reference.txt has the following
Suppose I have two modules: a.py: import b print __name__, __file__ b.py: print __name__,
Suppose I have a dataset with those two immortal tables: Employee & Order Emp
Suppose I have two database files a.sqlite and other one is b.sqlite. suppose table1
Suppose I have two applications written in C#. The first is a third party
Suppose you have two models, User and City, joined by a third model CityPermission:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.