Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 924
user3279394 Avatar asked Apr 14 '14 09:04

user3279394


1 Answers

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

like image 180
kosmikus Avatar answered Sep 20 '22 06:09

kosmikus