Changes between Version 9 and Version 10 of Prelude


Ignore:
Timestamp:
Feb 24, 2006 12:04:37 PM (9 years ago)
Author:
malcolm.wallace@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Prelude

    v9 v10  
    9595}}}
    9696
    97 Everything else that is currently in the Haskell'98 Prelude is re-distributed across a variety of small modules. Where a syntactic desugaring rule currently uses an entity from the Prelude, the new interpretation is that it uses whatever binding of that entity is in scope - if there is no such entity in scope, it is an error.  For compatibility, we define a wrapper module called Prelude.Standard which re-exports the original Haskell'98 Prelude:
    98 
    99 {{{
    100 module Prelude.Standard
     97Everything else that is currently in the Haskell'98 Prelude is re-distributed across a variety of small modules. Where a syntactic desugaring rule currently uses an entity from the Prelude, the new interpretation is that it uses whatever binding of that entity is in scope - if there is no such entity in scope, it is an error.  For compatibility, we define a wrapper module called Prelude.Haskell98 which re-exports the original Haskell'98 Prelude:
     98
     99{{{
     100module Prelude.Haskell98
    101101    ( module Prelude
    102102    , module Prelude.Num
     
    112112}}}
    113113
    114 And here are the individual fragments:
     114The rules for implicit import of the Prelude are now as follows.  The new minimal Prelude is imported implicitly unless there is an explicit mention of it in an import decl.  The larger Prelude.Haskell98 is implicitly imported ''only'' when the {{{module Main where}}} header is omitted from a main program module.  This ensures that extremely simple programs continue to work without needing to add a new import, but in all other cases, one must explicitly choose whether to use the Prelude.Haskell98, or something else.  We expect implementations might want to provide a flag like ''-fimplicit-prelude'' to automatically add an import of Prelude.Haskell98 to legacy modules.
     115
     116Here are the individual fragments of the re-organised Prelude:
    115117
    116118{{{
    117119module Prelude.Num
    118     ( data Natural(..)
    119     , data Int(..)
    120     , data Int8(..)
    121     , data Int16(..)
    122     , data Int32(..)
    123     , data Int64(..)
    124     , data Word8(..)
    125     , data Word16(..)
    126     , data Word32(..)
    127     , data Word64(..)
    128     , data Integer(..)
    129     , data Float(..)
    130     , data Double(..)
    131     , type Rational
     120    ( Natural(..)  -- new in h-prime?
     121    , Int(..)
     122    , Int8(..)     -- previously in Data.Int
     123    , Int16(..)
     124    , Int32(..)
     125    , Int64(..)
     126    , Word8(..)    -- previously in Data.Word
     127    , Word16(..)
     128    , Word32(..)
     129    , Word64(..)
     130    , Integer(..)
     131    , Float(..)
     132    , Double(..)
     133    , Rational
    132134    , class Integral(..)
    133135    , class Num(..)
     
    146148
    147149module Prelude.Comparison
    148     ( data Bool(..)
    149     , data Ordering(..)
     150    ( Bool(..)
     151    , Ordering(..)
    150152    , class Eq(..)
    151153    , class Ord(..)
     
    163165
    164166module Prelude.List
    165     ( data [](..)
     167    ( [](..)
    166168    , all, and, any, (++), break, concat, concatMap, cycle, drop, dropWhile
    167169    , elem, filter, foldl, foldl1, foldr, foldr1, head, (!!), init, iterate
     
    172174
    173175module Prelude.Maybe
    174     ( data Maybe(..)
     176    ( Maybe(..)
    175177    , maybe
    176178    )
    177179
    178180module Prelude.Either
    179     ( data Either(..)
     181    ( Either(..)
    180182    , either
    181183    )
    182184
    183185module Prelude.Tuple
    184     ( data ()(..)
    185     , data (,)(..)
    186     , data (,,)(..)
    187     , data (,,,)(..)
    188     , data (,,,,)(..)
    189     , data (,,,,,)(..)
    190     , data (,,,,,,)(..)
    191     , data (,,,,,,,)(..)
    192     , data (,,,,,,,,)(..)
    193     , data (,,,,,,,,,)(..)
    194     , data (,,,,,,,,,,)(..)
    195     , data (,,,,,,,,,,,)(..)
    196     , data (,,,,,,,,,,,,)(..)
    197     , data (,,,,,,,,,,,,,)(..)
    198     , data (,,,,,,,,,,,,,,)(..)
     186    ( ()(..)
     187    , (,)(..)
     188    , (,,)(..)
     189    , (,,,)(..)
     190    , (,,,,)(..)
     191    , (,,,,,)(..)
     192    , (,,,,,,)(..)
     193    , (,,,,,,,)(..)
     194    , (,,,,,,,,)(..)
     195    , (,,,,,,,,,)(..)
     196    , (,,,,,,,,,,)(..)
     197    , (,,,,,,,,,,,)(..)
     198    , (,,,,,,,,,,,,)(..)
     199    , (,,,,,,,,,,,,,)(..)
     200    , (,,,,,,,,,,,,,,)(..)
    199201    , fst, snd
    200202    , unzip, unzip3, zip, zip3, zipWith, zipWith3
     
    203205
    204206module Prelude.IO
    205     ( data IO
    206     , data IOError(..)
    207     , data FilePath
     207    ( IO
     208    , IOError(..)
     209    , FilePath
    208210    , ioError, userError, catch
    209211    , print
     
    214216
    215217module Prelude.Text
    216     ( data Char(..)
    217     , type String
     218    ( Char(..)
     219    , String
    218220    , class Read(..)
    219221    , class Show(..)
    220     , type ReadS
    221     , type ShowS
     222    , ReadS
     223    , ShowS
    222224    , read, reads, readParen, lex
    223225    , shows, showString, showParen, showChar