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

  • Home
  • SEARCH
  • 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 7849133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:26:16+00:00 2026-06-02T18:26:16+00:00

suppose I have a file NecessaryModule.hs, which has the following internals : module NecessaryModule

  • 0

suppose I have a file NecessaryModule.hs, which has the following internals :

module NecessaryModule where

addNumber1 :: Int -> Int -> Int
addNumber1 a b = a + b

addNumber2 :: Int -> Int -> Int
addNumber2 a b = a + b

When I do :

:load NecessaryModule

both addNumber1 and addNumber2 are available in the current scope. Is there a way to hide the function addNumber2 so that it is available to other functions in the same module but does not load up when I load the module in the manner above? Thanks

—————————————————————————————-

[Response to nanothief]

I tried your suggestion in the following way but it did not work for me. I had a file called test2.hs as follows :

--test2.hs
module Test2 (addNumber1) where

addNumber1 :: Int -> Int -> Int
addNumber1 a b = a + b

addNumber2 :: Int -> Int -> Int
addNumber2 a b = a + b

But then when I do

:load test2 

then I am able to invoke both addNumber1 and addNumber2. Have I done something wrong? 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-02T18:26:17+00:00Added an answer on June 2, 2026 at 6:26 pm

    You just specify the methods you do want to export on the module line:

    module NecessaryModule (addNumber1) where
    ....
    

    If you don’t specify that line, it includes everything by default.

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

Sidebar

Related Questions

in python , suppose i have file data.txt . which has 6 lines of
Suppose i have a xml file which has several nodes & children. I am
Suppose I have a file X.h which defines a class X, whose methods are
Suppose I have a file insert.c in which two functions are defined: 1.insert_after 2.insert_before
Suppose I have a text file that says: This file has plain text Now,
Suppose i have a php file named main.php It Contains following code include 'config.php';
Suppose I have a file similar to the following: 123 123 234 234 123
Suppose I have a custom file format, which can be analogous to N tables.
Suppose I have a file named abhishek.txt and that contains the following line I
Suppose I have the following file. John=good Tom = ok Tim = excellent I

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.