Changes between Version 23 and Version 24 of Commentary/Packages/GhcPackagesProposal
- Timestamp:
- 07/06/06 15:49:00 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Commentary/Packages/GhcPackagesProposal
v23 v24 153 153 }}} 154 154 155 It is clear from the above examples that the y keyword {{{from}}} is redundant - the presence of a string literalafter the keyword {{{import}}} is sufficient to distinguish per-package imports from the ordinary shared-namespace imports, so the above could instead be written as155 It is clear from the above examples that the keyword {{{from}}} is redundant - the presence of a string literal (or special keyword to denote the home package) after the keyword {{{import}}} is sufficient to distinguish per-package imports from the ordinary shared-namespace imports, so the above could instead be written as 156 156 {{{ 157 157 import "base" … … 167 167 }}} 168 168 169 === Syntax formalised and summarised === 169 170 171 A possible syntax which covers everything in this proposal is therefore: 172 173 '''import''' [''package-name''] '''{''' ''import-specifier'' [''';''' ''import-specifier''] '''}''' 174 175 where ''package-name'' is a string literal or the keyword {{{home}}}, the ''import-specifier'' corresponds to everything that is currently allowed after the keyword {{{import}}}, and the braces and semicolons would be added by the layout rule. 176 {{{ 177 import "base" -- searches in "base" package only 178 Prelude hiding (length) 179 Control.Exception 180 qualified Data.List as List 181 182 import "" -- searches in home package only 183 A.B.C 184 185 import P.Q.R -- searches in home + exposed packages 186 }}}
