Hello, I've just started to study the Haskell module system, and I find that export lists for modules in Hugs do not seem to work. For example, if I write module Foo (a) where a = 0 b = 1 and then load Foo, both a and b are visible. What am I doing wrong? Any help will be appreciated. Michael
At 8:16 PM -0500 6/27/01, Michael Ackerman wrote:
Hello, I've just started to study the Haskell module system, and I find that export lists for modules in Hugs do not seem to work. For example, if I write
module Foo (a) where a = 0 b = 1
and then load Foo, both a and b are visible. What am I doing wrong? Any help will be appreciated.
Both a and b are visible on the command line, but b will not be visible in any module that imports Foo. --Ham ------------------------------------------------------------------ Hamilton Richards, PhD Department of Computer Sciences Senior Lecturer Mail Code C0500 512-471-9525 The University of Texas at Austin Taylor Hall 5.138 Austin, Texas 78712-1188 ham@cs.utexas.edu hrichrds@swbell.net ------------------------------------------------------------------
Hamilton Richards wrote:
Michael Ackerman wrote:
module Foo (a) where a = 0 b = 1
and then load Foo, both a and b are visible. What am I doing wrong? Any help will be appreciated.
Both a and b are visible on the command line, but b will not be visible in any module that imports Foo.
To elaborate: after loading module Foo into Hugs, you are "inside" the
module Foo (as the prompt "Foo>" indicates). This means you can see
everything in scope in that module. If you then load another module,
say Main, that imports Foo, you will only be able to see Foo's
exports, not its internal functions.
--KW 8-)
--
Keith Wansbrough
participants (3)
-
Hamilton Richards -
Keith Wansbrough -
Michael Ackerman