Re: [Haskell-cafe] module export question

2009-12-01 Thread Ross Paterson
On Tue, Dec 01, 2009 at 05:11:42PM -0500, Sean McLaughlin wrote: > The problem is that I explicitly didn't export 't' as an element of T > (by not writing T(..)). > Am I just misunderstanding how exports work? I couldn't figure out > what the correct behavior should be by looking at the 98 report.

Re: [Haskell-cafe] module export question

2009-12-01 Thread Ross Mellgren
It looks like it is specified and the intended behavior: From the report, section 5.2: An algebraic datatype T declared by a data or newtype declaration may be named in one of three ways: The form T names the type but not the constructors or field names. The ability to export a type without

Re: [Haskell-cafe] module export question

2009-12-01 Thread Luke Palmer
On Tue, Dec 1, 2009 at 3:11 PM, Sean McLaughlin wrote: > Say I have the following module: > > > module A >  ( T(T) >  , t >  , val >  ) > where > > data T = T { t :: Int } > > val :: T > val = T 7 > > > > When I use

[Haskell-cafe] module export question

2009-12-01 Thread Sean McLaughlin
Say I have the following module: module A ( T(T) , t , val ) where data T = T { t :: Int } val :: T val = T 7 When I use A with the following imports, I don't expect this to work, but it does: import qua