992fba5509aefb85de60016ade5088ed487529f5
[ghc-hetmet.git] / ghc / docs / users_guide / 2-04-notes.lit
1 GHC 2.04 is a minor upgrade of GHC 2.02 (and the bugfix release,
2 2.03), representing work done through May '97. This new release
3 adds the following:
4
5 \begin{itemize}
6 \item
7 Data constructors can now have polymorphic fields, and ordinary
8 functions can have polymorphic arguments.  Details on
9
10 \begin{verbatim}
11         http://www.cse.ogi.edu/~simonpj/quantification.html
12 \end{verbatim}
13
14 Existential types coming, but not done yet.
15
16 \item Pattern guards implemented, see
17         
18 \begin{verbatim}
19 http://www.cse.ogi.edu/~simonpj/guards.html
20 \end{verbatim}
21
22 \item Compiler can now compile itself.
23
24 \item \tr{INLINE} pragmas honoured (caveat: not yet
25 working on instance-decl methods) 
26
27 \item Simplifier improvements and better inlining gives
28 better code; not sure how *much* better.
29
30 \item \tr{-dshow-rn-stats} print out amusing statistics about what
31 the renamer does.
32
33 \item
34 When compiling without -O, the renamer (the pass responsible for
35 slurping in interface file and making sure everything is in scope
36 etc.) is now more careful about what it will bring in (especially
37 data constructors and instance declarations). The upshot of this
38 change is that a lot of the (unnecessary) work this pass did in
39 2.02/2.03 is now avoided.
40
41 \tr{-fno-prune-tydecls} and \tr{-fno-prune-instdecls} switch off these
42 renamer optimisations. You can try the effect with the renamer
43 statistics. War stories welcome.
44
45 \item
46     The Heroic Efforts of \tr{Andr\'e Santos <alms@di.ufpe.br>} have
47     been included, AIX/RS6000 is now a supported \tr{ghc}
48     platform! Bug reports concerning this port to (as always)
49     \tr{glasgow-haskell-bugs@dcs.gla.ac.uk}.
50
51 \item
52     A lot of the bugs that were present in versions 2.02/2.03
53     have been fixed (thanks to everyone that reported bugs!).
54     A list of the reported problems with 2.02/2.03 can be found at
55
56 \begin{verbatim}
57     http://www.dcs.gla.ac.uk/fp/software/ghc/ghc-bugs.html
58 \end{verbatim}
59
60     No doubt entries for 2.04 will be added here as well :-)
61
62 \item
63     This release is available in source format only. To build it you'll
64     need to have either a copy of GHC~0.29 or GHC~2.02/3 installed.
65     For people either doing porting work or work on a (supported) 
66     platform for which there is no GHC binary bundles available, the
67     necessary intermediate files are also available (.hc and .hi files).
68
69     Consult the installation guide for more information on how
70     to build or bootstrap. The guide is included in the distribution
71     (in the fptools/docs directory), and an on-line version of the
72     document can be found at
73
74 \begin{verbatim}
75     http://www.dcs.gla.ac.uk/fp/software/ghc/ghc-doc/install-guide.html
76 \end{verbatim}
77 \end{itemize}
78
79 In addition to the above, we've made the following minor changes to
80 the GHC libraries/our implementation of the Haskell standard prelude:
81
82 \begin{itemize}
83 \item
84 \tr{isPrefixOf} and \tr{isSuffixOf} has been added to \tr{List}.
85 \item
86 The empty type \tr{Void} is now exported from the prelude.
87 \item
88 \tr{GlaExts} exports the \tr{Lift} data type:
89
90 \begin{verbatim}
91 data Lift a = Lift a
92 \end{verbatim}
93
94 you might need it someday...
95
96 \item
97 The \tr{Foreign} interface now also exports the representations
98 for \tr{Word} and \tr{Addr}.
99
100 \item The low-level file handle interface in the \tr{POSIX} system
101 library has been reworked a bit, most notably is the renaming of
102 \tr{Channel} to \tr{Fd} and the introduction of operations for converting
103 to and from \tr{Handle} and \tr{Fd} values. The changes are:
104
105 \begin{verbatim}
106 --Renamed functions (old name in square brackets)
107 openFd :: FilePath       
108        -> OpenMode 
109        -> Maybe FileMode 
110        -> OpenFileFlags 
111        -> IO Fd
112  -- [openChannel]
113 fdSeek  :: Fd -> SeekMode -> FileOffset -> IO FileOffset 
114  --[seekChannel]
115 fdRead  :: Fd -> ByteCount -> IO (String, ByteCount)     
116  --[readChannel]
117 fdWrite :: Fd -> String -> IO ByteCount                  
118  --[writeChannel]
119 fdClose :: Fd -> IO ()          
120  --[closeChannel]
121 setFdOption :: Fd -> FdOption -> Bool -> IO ()
122  --[setChannelOption]
123 queryFdOption :: Fd -> FdOption -> IO Bool
124  --[queryChannelOption]
125 dup :: Fd -> IO Fd
126  --[dupChannel]
127 dupTo :: Fd -> Fd -> IO ()
128  --[dupChannelTo]
129
130 data FdOption = AppendOnWrite | CloseOnExec | NonBlockingRead
131  --[ChannelOption]
132 getFdStatus :: Fd -> IO FileStatus
133  --[getChannelStatus]
134
135 -- New data structure collecting together misc flags passed to openFd
136 data OpenFileFlags =
137  OpenFileFlags {
138     append    :: Bool,
139     exclusive :: Bool,
140     noctty    :: Bool,
141     nonBlock  :: Bool,
142     trunc     :: Bool
143  }
144
145 --New ops for converting between Fd and Handle:
146 fdToHandle :: Fd -> IO Handle
147 handleToFd :: Handle -> IO Fd
148 intToFd    :: Int -> Fd -- use with care.
149 \end{verbatim}
150
151 \end{itemize}