Commit ee13c263 authored by rrt's avatar rrt

[project @ 2000-07-10 16:15:33 by rrt]

Removed carriage returns (\r) from source files. Please don't check in such
things; they can cause problems on Cygwin (funnily enough). I'm looking into
how to avoid commiting carriage returns when working under Windows.
parent caea0cb9
This diff is collapsed.
The Glasgow Haskell Compiler -- version 4.08 The Glasgow Haskell Compiler -- version 4.08
============================================== ==============================================
We are pleased to announce a new release of the Glasgow Haskell We are pleased to announce a new release of the Glasgow Haskell
Compiler (GHC), version 4.08. The source distribution is freely Compiler (GHC), version 4.08. The source distribution is freely
available via the World-Wide Web and through anon. FTP; details below. available via the World-Wide Web and through anon. FTP; details below.
Haskell is "the" standard lazy functional programming language; the Haskell is "the" standard lazy functional programming language; the
current language version is Haskell 98, agreed in December 1998. current language version is Haskell 98, agreed in December 1998.
Haskell related information is available from the Haskell home page at Haskell related information is available from the Haskell home page at
http://www.haskell.org/ http://www.haskell.org/
GHC's Web page lives at GHC's Web page lives at
http://www.haskell.org/ghc/ http://www.haskell.org/ghc/
+ What's new + What's new
============= =============
This should be a stable release. There have been many enhancements This should be a stable release. There have been many enhancements
since 4.06, and shed-loads of bug-fixes (one shed (imperial) ~ one ton since 4.06, and shed-loads of bug-fixes (one shed (imperial) ~ one ton
(US)). (US)).
There are the following changes There are the following changes
- New profiling subsystem, based on cost-centre stacks. - New profiling subsystem, based on cost-centre stacks.
- Working x86 native code generator: now it works properly, runs - Working x86 native code generator: now it works properly, runs
about twice as fast as compiling via C, and is on a par for about twice as fast as compiling via C, and is on a par for
run-time speed (except in FP-intensive programs). run-time speed (except in FP-intensive programs).
- Implicit parameters (i.e. dynamic scoping without the pain). - Implicit parameters (i.e. dynamic scoping without the pain).
- DEPRECATED pragma for marking obsolescent interfaces. - DEPRECATED pragma for marking obsolescent interfaces.
- In the wake of hslibs, a new package system for - In the wake of hslibs, a new package system for
libraries. -package should now be used instead of -syslib. libraries. -package should now be used instead of -syslib.
- Result type signatures work. - Result type signatures work.
- Many tiresome long-standing bugs and problems (e.g. the trace - Many tiresome long-standing bugs and problems (e.g. the trace
problem) have been fixed. problem) have been fixed.
- Many error messages have been made more helpful and/or - Many error messages have been made more helpful and/or
accurate. accurate.
For full details see the release notes: For full details see the release notes:
http://www.haskell.org/ghc/docs/4.08/users_guide/release-4-08.html http://www.haskell.org/ghc/docs/4.08/users_guide/release-4-08.html
+ Mailing lists + Mailing lists
================ ================
We run mailing lists for GHC users and bug reports; to subscribe, send We run mailing lists for GHC users and bug reports; to subscribe, send
mail to majordomo@haskell.org; the msg body should be: mail to majordomo@haskell.org; the msg body should be:
subscribe glasgow-haskell-{users,bugs} Your Name <you@where.soever> subscribe glasgow-haskell-{users,bugs} Your Name <you@where.soever>
or or
subscribe cvs-ghc Your Name <you@where.soever> subscribe cvs-ghc Your Name <you@where.soever>
Please send bug reports about GHC to glasgow-haskell-bugs@haskell.org; Please send bug reports about GHC to glasgow-haskell-bugs@haskell.org;
GHC users hang out on glasgow-haskell-users@haskell.org. Bleeding GHC users hang out on glasgow-haskell-users@haskell.org. Bleeding
edge CVS users party on cvs-ghc@haskell.org. edge CVS users party on cvs-ghc@haskell.org.
+ On-line GHC-related resources + On-line GHC-related resources
================================ ================================
Relevant URLs on the World-Wide Web: Relevant URLs on the World-Wide Web:
GHC home page http://www.haskell.org/ghc/ GHC home page http://www.haskell.org/ghc/
Haskell home page http://www.haskell.org/ Haskell home page http://www.haskell.org/
comp.lang.functional FAQ http://www.cs.nott.ac.uk/~gmh/faq.html comp.lang.functional FAQ http://www.cs.nott.ac.uk/~gmh/faq.html
+ How to get it + How to get it
================ ================
The easy way is to go to the WWW page, which should be The easy way is to go to the WWW page, which should be
self-explanatory: self-explanatory:
http://www.haskell.org/ghc/ http://www.haskell.org/ghc/
Once you have the distribution, please follow the pointers in the Once you have the distribution, please follow the pointers in the
README file to find all of the documentation about this release. NB: README file to find all of the documentation about this release. NB:
preserve modification times when un-tarring the files (no `m' option preserve modification times when un-tarring the files (no `m' option
for tar, please)! for tar, please)!
+ System requirements + System requirements
====================== ======================
To compile the sources, you need a machine with 32+MB memory, GNU C To compile the sources, you need a machine with 32+MB memory, GNU C
(`gcc'), `perl' plus a version of GHC installed (3.02 at least). This (`gcc'), `perl' plus a version of GHC installed (3.02 at least). This
release is known to work on the following platforms: release is known to work on the following platforms:
* i386-unknown-{linux,freebsd,netbsd,cygwin32,mingw32} * i386-unknown-{linux,freebsd,netbsd,cygwin32,mingw32}
* sparc-sun-{sunos4,solaris2} * sparc-sun-{sunos4,solaris2}
* hppa1.1-hp-hpux{9,10} * hppa1.1-hp-hpux{9,10}
Ports to the following platforms should be relatively easy (for a Ports to the following platforms should be relatively easy (for a
wunderhacker), but haven't been tested due to lack of time/hardware: wunderhacker), but haven't been tested due to lack of time/hardware:
* i386-unknown-solaris2 * i386-unknown-solaris2
* alpha-dec-osf{2,3} * alpha-dec-osf{2,3}
* mips-sgi-irix{5,6} * mips-sgi-irix{5,6}
* {rs6000,powerpc}-ibm-aix * {rs6000,powerpc}-ibm-aix
The builder's guide included in distribution gives a complete The builder's guide included in distribution gives a complete
run-down of what ports work; an on-line version can be found at run-down of what ports work; an on-line version can be found at
http://www.haskell.org/ghc/docs/4.08/building/building-guide.html http://www.haskell.org/ghc/docs/4.08/building/building-guide.html
--!!! Testing export of unknown name --!!! Testing export of unknown name
module Bar(bar) where module Bar(bar) where
foo = foo foo = foo
\ No newline at end of file
{-# OPTIONS -fglasgow-exts #-} {-# OPTIONS -fglasgow-exts #-}
-- !!! Scoped type variables in result signatures -- !!! Scoped type variables in result signatures
module ShouldCompile where module ShouldCompile where
import PrelST import PrelST
import PrelArr import PrelArr
f:: ST s Int f:: ST s Int
f:: ST s Int = do f:: ST s Int = do
v <- newSTRef 5 v <- newSTRef 5
let g :: ST s Int let g :: ST s Int
-- ^ should be in scope -- ^ should be in scope
g = readSTRef v g = readSTRef v
g g
TOP=.. TOP=..
include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/boilerplate.mk
SUBDIRS = db2dvi.dir db2html.dir db2pdf.dir db2ps.dir db2rtf.dir SUBDIRS = db2dvi.dir db2html.dir db2pdf.dir db2ps.dir db2rtf.dir \
dbindex.dir
include $(TOP)/mk/target.mk include $(TOP)/mk/target.mk
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- TableClass : Class for combinators used in building 2D tables. -- TableClass : Class for combinators used in building 2D tables.
-- --
-- Copyright (c) 1999 Andy Gill -- Copyright (c) 1999 Andy Gill
-- --
-- This module is distributed as Open Source software under the -- This module is distributed as Open Source software under the
-- Artistic License; see the file "Artistic" that is included -- Artistic License; see the file "Artistic" that is included
-- in the distribution for details. -- in the distribution for details.
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
module ClassTable ( module ClassTable (
Table(..), Table(..),
showsTable, showsTable,
showTable, showTable,
) where ) where
infixr 4 `beside` infixr 4 `beside`
infixr 3 `above` infixr 3 `above`
{---------------------------------------------------------------------------- {----------------------------------------------------------------------------
These combinators can be used to build formated 2D tables. These combinators can be used to build formated 2D tables.
The specific target useage is for HTML table generation. The specific target useage is for HTML table generation.
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
Examples of use: Examples of use:
> table1 :: (Table t) => t String > table1 :: (Table t) => t String
> table1 = single "Hello" +-----+ > table1 = single "Hello" +-----+
|Hello| |Hello|
This is a 1x1 cell +-----+ This is a 1x1 cell +-----+
Note: single has type Note: single has type
single :: (Table t) => a -> t a single :: (Table t) => a -> t a
So the cells can contain anything. So the cells can contain anything.
> table2 :: (Table t) => t String > table2 :: (Table t) => t String
> table2 = single "World" +-----+ > table2 = single "World" +-----+
|World| |World|
+-----+ +-----+
> table3 :: (Table t) => t String > table3 :: (Table t) => t String
> table3 = table1 %-% table2 +-----%-----+ > table3 = table1 %-% table2 +-----%-----+
|Hello%World| |Hello%World|
% is used to indicate +-----%-----+ % is used to indicate +-----%-----+
the join edge between the join edge between
the two Tables. the two Tables.
> table4 :: (Table t) => t String > table4 :: (Table t) => t String
> table4 = table3 %/% table2 +-----+-----+ > table4 = table3 %/% table2 +-----+-----+
|Hello|World| |Hello|World|
Notice the padding on the %%%%%%%%%%%%% Notice the padding on the %%%%%%%%%%%%%
smaller (bottom) cell to |World | smaller (bottom) cell to |World |
force the table to be a +-----------+ force the table to be a +-----------+
rectangle. rectangle.
> table5 :: (Table t) => t String > table5 :: (Table t) => t String
> table5 = table1 %-% table4 +-----%-----+-----+ > table5 = table1 %-% table4 +-----%-----+-----+
|Hello%Hello|World| |Hello%Hello|World|
Notice the padding on the | %-----+-----+ Notice the padding on the | %-----+-----+
leftmost cell, again to | %World | leftmost cell, again to | %World |
force the table to be a +-----%-----------+ force the table to be a +-----%-----------+
rectangle. rectangle.
Now the table can be rendered with processTable, for example: Now the table can be rendered with processTable, for example:
Main> processTable table5 Main> processTable table5
[[("Hello",(1,2)), [[("Hello",(1,2)),
("Hello",(1,1)), ("Hello",(1,1)),
("World",(1,1))], ("World",(1,1))],
[("World",(2,1))]] :: [[([Char],(Int,Int))]] [("World",(2,1))]] :: [[([Char],(Int,Int))]]
Main> Main>
----------------------------------------------------------------------------} ----------------------------------------------------------------------------}
class Table t where class Table t where
-- There are no empty tables -- There are no empty tables
--Single element table --Single element table
single :: a -> t a single :: a -> t a
-- horizontal composition -- horizontal composition
beside :: t a -> t a -> t a beside :: t a -> t a -> t a
-- vertical composition -- vertical composition
above :: t a -> t a -> t a above :: t a -> t a -> t a
-- generation of raw table matrix -- generation of raw table matrix
getMatrix :: t a -> [[(a,(Int,Int))]] getMatrix :: t a -> [[(a,(Int,Int))]]
showsTable :: (Show a,Table t) => t a -> ShowS showsTable :: (Show a,Table t) => t a -> ShowS
showsTable table = shows (getMatrix table) showsTable table = shows (getMatrix table)
showTable :: (Show a,Table t) => t a -> String showTable :: (Show a,Table t) => t a -> String
showTable table = showsTable table "" showTable table = showsTable table ""
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
-- $Id: DataHtml.hs,v 1.1 1999/11/12 11:54:17 simonmar Exp $ -- $Id: DataHtml.hs,v 1.2 2000/07/10 16:15:34 rrt Exp $
-- --
-- Copyright (c) 1999 Andy Gill -- Copyright (c) 1999 Andy Gill
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
module DataHtml ( module DataHtml (
Html, HtmlName, HtmlAttr, HtmlTable, Html, HtmlName, HtmlAttr, HtmlTable,
(+++), verbatim, {- tag, atag, -} noHtml, primHtml, (+++), verbatim, {- tag, atag, -} noHtml, primHtml,
concatHtml, htmlStr, htmlLine, concatHtml, htmlStr, htmlLine,
h1,h2,h3,h4,h5,h6, h1,h2,h3,h4,h5,h6,
font, bold, anchor, header, body, theTitle, paragraph, italics, font, bold, anchor, header, body, theTitle, paragraph, italics,
ul, tt, ul, tt,
bar, meta, li, bar, meta, li,
{- tr, int, percent -} {- tr, int, percent -}
color, bgcolor, href, name, title, height, width, align, valign, color, bgcolor, href, name, title, height, width, align, valign,
border, size, cellpadding, cellspacing, border, size, cellpadding, cellspacing,
p, hr, copyright, spaceHtml, p, hr, copyright, spaceHtml,
renderHtml, renderHtml,
cellHtml, (+/+), above, (+-+), beside, aboves, besides, cellHtml, (+/+), above, (+-+), beside, aboves, besides,
renderTable, simpleTable, renderTable, simpleTable,
) where ) where
import qualified OptTable as OT import qualified OptTable as OT
infixr 5 +++ -- appending Html infixr 5 +++ -- appending Html
infixr 3 +/+ -- combining HtmlTable infixr 3 +/+ -- combining HtmlTable
infixr 4 +-+ -- combining HtmlTable infixr 4 +-+ -- combining HtmlTable
data Html data Html
= HtmlAppend Html Html -- Some Html, followed by more text = HtmlAppend Html Html -- Some Html, followed by more text
| HtmlVerbatim Html -- Turn on or off smart formating | HtmlVerbatim Html -- Turn on or off smart formating
| HtmlEmpty -- Nothing! | HtmlEmpty -- Nothing!
| HtmlNestingTag HtmlName [HtmlAttr] Html | HtmlNestingTag HtmlName [HtmlAttr] Html
| HtmlSimpleTag HtmlName [HtmlAttr] | HtmlSimpleTag HtmlName [HtmlAttr]
| HtmlString String | HtmlString String
deriving (Show) deriving (Show)
{- {-
- A important property of Html is all strings inside the - A important property of Html is all strings inside the
- structure are already in Html friendly format. - structure are already in Html friendly format.
- For example, use of &gt;,etc. - For example, use of &gt;,etc.
-} -}
type HtmlName = String type HtmlName = String
type HtmlAttr = (HtmlName,Either Int String) type HtmlAttr = (HtmlName,Either Int String)
type HtmlTable = OT.OptTable (Int -> Int -> Html) type HtmlTable = OT.OptTable (Int -> Int -> Html)
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- Interface -- Interface
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- primitive combinators -- primitive combinators
(+++) :: Html -> Html -> Html (+++) :: Html -> Html -> Html
verbatim :: Html -> Html verbatim :: Html -> Html
tag :: String -> [HtmlAttr] -> Html -> Html tag :: String -> [HtmlAttr] -> Html -> Html
atag :: String -> [HtmlAttr] -> Html atag :: String -> [HtmlAttr] -> Html
noHtml :: Html noHtml :: Html
primHtml :: String -> Html primHtml :: String -> Html
-- useful combinators -- useful combinators
concatHtml :: [Html] -> Html concatHtml :: [Html] -> Html
htmlStr, htmlLine :: String -> Html htmlStr, htmlLine :: String -> Html
-- html constructors -- html constructors
h1,h2,h3,h4,h5,h6 :: [HtmlAttr] -> Html -> Html h1,h2,h3,h4,h5,h6 :: [HtmlAttr] -> Html -> Html
font, bold, anchor, font, bold, anchor,
header, body, header, body,
theTitle, paragraph, theTitle, paragraph,
italics, ul, tt :: [HtmlAttr] -> Html -> Html italics, ul, tt :: [HtmlAttr] -> Html -> Html
bar, meta, li :: [HtmlAttr] -> Html bar, meta, li :: [HtmlAttr] -> Html
-- html attributes -- html attributes
str :: String -> String -> HtmlAttr str :: String -> String -> HtmlAttr
int :: String -> Int -> HtmlAttr int :: String -> Int -> HtmlAttr
percent :: String -> Int -> HtmlAttr percent :: String -> Int -> HtmlAttr
color, bgcolor, href, color, bgcolor, href,
name, title, height, name, title, height,
width, align, valign :: String -> HtmlAttr width, align, valign :: String -> HtmlAttr
border, size, border, size,
cellpadding, cellpadding,
cellspacing :: Int -> HtmlAttr cellspacing :: Int -> HtmlAttr
-- abbriviations -- abbriviations
p :: Html -> Html p :: Html -> Html
hr :: Html hr :: Html
copyright :: Html copyright :: Html
spaceHtml :: Html spaceHtml :: Html
-- rendering -- rendering
renderHtml :: Html -> String renderHtml :: Html -> String
-- html tables -- html tables
cellHtml :: [HtmlAttr] -> Html -> HtmlTable cellHtml :: [HtmlAttr] -> Html -> HtmlTable
(+/+),above, (+/+),above,
(+-+),beside :: HtmlTable -> HtmlTable -> HtmlTable (+-+),beside :: HtmlTable -> HtmlTable -> HtmlTable
aboves, besides :: [HtmlTable] -> HtmlTable aboves, besides :: [HtmlTable] -> HtmlTable
renderTable :: [HtmlAttr] -> HtmlTable -> Html renderTable :: [HtmlAttr] -> HtmlTable -> Html
simpleTable :: [HtmlAttr] -> [HtmlAttr] -> [[Html]] simpleTable :: [HtmlAttr] -> [HtmlAttr] -> [[Html]]
-> Html -> Html
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- Basic, primitive combinators -- Basic, primitive combinators
-- This is intentionally lazy in the second argument. -- This is intentionally lazy in the second argument.
(HtmlAppend x y) +++ z = x +++ (y +++ z) (HtmlAppend x y) +++ z = x +++ (y +++ z)
(HtmlEmpty) +++ z = z (HtmlEmpty) +++ z = z
x +++ z = HtmlAppend x z x +++ z = HtmlAppend x z
verbatim = HtmlVerbatim verbatim = HtmlVerbatim
tag = HtmlNestingTag tag = HtmlNestingTag
atag = HtmlSimpleTag atag = HtmlSimpleTag
noHtml = HtmlEmpty noHtml = HtmlEmpty
-- This is not processed for special chars. -- This is not processed for