[Haskell-cafe] Re: Unexported functions are evil
Peter Simons
simons at cryp.to
Tue May 17 20:30:19 EDT 2005
Iavor Diatchki writes:
>> Do you have an concrete example which illustrates this
>> point?
> [...] consider a file A.hs that defines some data type T
> and exports a function "f" that is defined in terms of a
> private function "g". Now if we place "g" in a file
> called "Private.hs" then A needs to import Private, but
> also "Private" needs to import "A" for the definition of
> "T".
Ah, now it see it! Great example.
But couldn't you just put T in "Foo/Base.hs", g in
"Foo/Private.hs", then create "Foo/API.hs" which imports
"Foo/Base.hs" and "Foo/Private.hs", and leave f in "A.hs"
and import "Foo/API.hs"?
Peter
More information about the Haskell-Cafe
mailing list