<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">It looks like it is specified and the intended behavior:<div><br></div><div>From the report, section 5.2:</div><div><br></div><div><span class="Apple-style-span" style="font-family: Times; ">An algebraic datatype&nbsp;<i>T&nbsp;</i>declared by a&nbsp;<tt>data</tt>&nbsp;or&nbsp;<tt>newtype</tt>&nbsp;declaration may be named in one of three ways:<ul><li>The form&nbsp;<i>T</i>&nbsp;names the type&nbsp;<i>but not the constructors or field names</i>. The ability to export a type without its constructors allows the construction of abstract datatypes (see Section&nbsp;<a href="http://haskell.org/onlinereport/modules.html#abstract-types">5.8</a>).</li><li>The form T<tt>(</tt>c<sub>1</sub><tt>,</tt>...<tt>,</tt>c<sub>n</sub><tt>)</tt>, names the type and some or all of its constructors and field names.</li><li>The abbreviated form&nbsp;<i>T</i><tt>(..)</tt>&nbsp;names the type and all its constructors and field names that are currently in scope (whether qualified or not).</li></ul></span><div><br></div><div>And then later similarly for imports from 5.3.1:</div><div><br></div><div><span class="Apple-style-span" style="font-family: Times; "><p>Exactly which entities are to be imported can be specified in one of the following three ways:</p><ol><li>The imported entities can be specified explicitly by listing them in parentheses. Items in the list have the same form as those in export lists, except qualifiers are not permitted and the `<tt>module</tt>&nbsp;<i>modid</i>' entity is not permitted. When the<tt>(..)</tt>&nbsp;form of import is used for a type or class, the&nbsp;<tt>(..)</tt>&nbsp;refers to all of the constructors, methods, or field names exported from the module.<p>The list must name only entities exported by the imported module. The list may be empty, in which case nothing except the instances is imported.</p></li></ol></span><div><br></div><div><br></div><div>-Ross</div><div><br></div></div><div><div>On Dec 1, 2009, at 5:18 PM, Luke Palmer wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Tue, Dec 1, 2009 at 3:11 PM, Sean McLaughlin &lt;<a href="mailto:seanmcl@gmail.com">seanmcl@gmail.com</a>&gt; wrote:<br><blockquote type="cite">Say I have the following module:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">----------------------------------------<br></blockquote><blockquote type="cite">module A<br></blockquote><blockquote type="cite">&nbsp;( T(T)<br></blockquote><blockquote type="cite">&nbsp;, t<br></blockquote><blockquote type="cite">&nbsp;, val<br></blockquote><blockquote type="cite">&nbsp;)<br></blockquote><blockquote type="cite">where<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">data T = T { t :: Int }<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">val :: T<br></blockquote><blockquote type="cite">val = T 7<br></blockquote><blockquote type="cite">----------------------------------------<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">When I use A with the following imports, I don't expect this to work,<br></blockquote><blockquote type="cite">but it does:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">import qualified A<br></blockquote><blockquote type="cite">import A(T(..))<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">main = putStrLn $ show $ t A.val<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">The problem is that I explicitly didn't export 't' as an element of T<br></blockquote><blockquote type="cite">(by not writing T(..)).<br></blockquote><blockquote type="cite">Am I just misunderstanding how exports work? &nbsp;I couldn't figure out<br></blockquote><blockquote type="cite">what the correct<br></blockquote><blockquote type="cite">behavior should be by looking at the 98 report.<br></blockquote><br>Oh interesting. &nbsp;What a crazy corner case. &nbsp;I also feel like your<br>program shouldn't be valid. &nbsp;Maybe it's a bug?<br>_______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>http://www.haskell.org/mailman/listinfo/haskell-cafe<br></div></blockquote></div><br></div></body></html>