Export functions to Haskell

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

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 shouldn't prelude them after that, right? But I can contact them. I'm not sure what to do. How can I solve this problem?

Thanks in advance.

+4
source share
1 answer

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

+7
source

Source: https://habr.com/ru/post/1536420/


All Articles