user3279394
user3279394

Reputation: 151

Exporting Functions In Haskell

I have an haskell file named A.hs. I have many helper functions, but I only want to export two of them, for example foo1 and foo2. Is this syntax corect?

module A (foo1,foo2) where

foo1 a b = a * b
foo2 a b = a + b

Since there are other helper functions in my file, I'm not supposed to reach them from prelude after doing this, right? But I can reach them. I'm not sure what to do. How can I solve this problem?

Thanks in advance.

Upvotes: 8

Views: 2963

Answers (1)

kosmikus
kosmikus

Reputation: 19637

The syntax is correct. However, for interpreted files, GHCi always makes all toplevel functions available.

Upvotes: 11

Related Questions