Commit f08a901d authored by Simon Marlow's avatar Simon Marlow
Browse files

use hierarchical module names

parent 9564ad3b
......@@ -46,7 +46,7 @@ import UnicodePrims( primUnicodeMaxChar ) -- Unicode primitives
import PreludeList
import PreludeText
import PreludeIO
import Ratio( Rational )
import Data.Ratio( Rational )
infixr 9 .
infixr 8 ^, ^^, **
......
......@@ -12,7 +12,7 @@ module PreludeList (
zip, zip3, zipWith, zipWith3, unzip, unzip3)
where
import qualified Char(isSpace)
import qualified Data.Char(isSpace)
infixl 9 !!
infixr 5 ++
......
......@@ -9,8 +9,8 @@ module PreludeText (
-- Bool, Maybe, Either, Ordering
-- are done via "deriving" clauses in Prelude.hs
import Char(isSpace, isAlpha, isDigit, isAlphaNum,
showLitChar, readLitChar, lexLitChar)
import Data.Char(isSpace, isAlpha, isDigit, isAlphaNum,
showLitChar, readLitChar, lexLitChar)
import Numeric(showSigned, showInt, readSigned, readDec, showFloat,
readFloat, lexDigits)
......
......@@ -975,13 +975,13 @@ which it is in scope is immaterial; in particular, it may be a qualified
name. (This rule is identical to that used for subordinate names in
export lists --- Section~\ref{export}.)
For example, this is legal, even though @range@ is in scope only
with the qualified name @Ix.range@.
with the qualified name @Data.Ix.range@.
\bprog
@
module A where
import qualified Ix
import qualified Data.Ix
instance Ix.Ix T where
instance Data.Ix.Ix T where
range = ...
@
\eprog
......@@ -1985,7 +1985,7 @@ Rule 1 is required for two reasons, both of which are fairly subtle.
\begin{itemize}
\item
{\em Rule 1 prevents computations from being unexpectedly repeated.}
For example, @genericLength@ is a standard function (in library @List@) whose
For example, @genericLength@ is a standard function (in library @Data.List@) whose
type is given by
\bprog
@
......
......@@ -194,7 +194,7 @@ legal
\bprog
@
module A( Mb.Maybe( Nothing, Just ) ) where
import qualified Maybe as Mb
import qualified Data.Maybe as Mb
@
\eprog
Data constructors cannot be named in export lists except as subordinate names, because
......@@ -403,7 +403,7 @@ name as a qualified import:
@
module Ring where
import qualified Prelude -- All Prelude names must be qualified
import List( nub )
import Data.List( nub )
l1 + l2 = l1 Prelude.++ l2 -- This + differs from the one in the Prelude
l1 * l2 = nub (l1 + l2) -- This * differs from the one in the Prelude
......
......@@ -27,7 +27,7 @@ this organisation for the Prelude,
nor are these three modules available for import separately.
Only the exports of module @Prelude@ are significant.
Some of these modules import Library modules, such as @Char@, @Monad@, @IO@,
Some of these modules import Library modules, such as @Data.Char@, @Control.Monad@, @System.IO@,
and @Numeric@. These modules are described fully in Part~\ref{libraries}.
These imports are not, of course, part of the specification
of the @Prelude@. That is, an implementation is free to import more, or less,
......@@ -50,7 +50,7 @@ improve efficiency, a number of commonly-used functions over lists use
the @Int@ type rather than using a more general numeric type, such as
@Integral a@ or @Num a@. These functions are: @take@, @drop@,
@!!@, @length@, @splitAt@, and @replicate@. The more general
versions are given in the @List@ library, with the prefix
versions are given in the @Data.List@ library, with the prefix
``@generic@''; for example @genericLength@.
\clearpage
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment