[[project @ 2000-07-10 16:15:33 by rrt]
rrt**20000710161536
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.
] {
hunk ./docs/cvs-cheat-sheet.html 1
-
-
-
-
-
-
-Access To The GHC CVS Repository
-
-
-
-
-FP Tools CVS Cheat Sheet
-
-We use CVS (Concurrent Version System) to keep track of our sources for various
-software projects. CVS lets several people work on the same software at the same time,
-allowing changes to be checked in incrementally.
-
-Information on using CVS can be obtained from Cyclic
-Software.
-
-This note is supposed to be a set of guidelines for how to use our CVS repository, and
-will probably evolve in time. The main thing to remember is that most mistakes can be
-undone, but if there's anything you're not sure about feel free to bug the local CVS
-meister (namely Jeff Lewis).
-
-Contents
-
-
-
-Remote Read-only CVS Access
-
-Read-only access is available to anyone - there's no need to ask us first. To get
-read-only access to our repository:
-
-
- - set your CVSROOT environment variable to :pserver:anoncvs@glass.cse.ogi.edu:/cvs
- - The first time you access the repository, you'll need to do cvs login.
- The password is simply cvs. This sets up a file in your home directory
- called .cvspass, which squirrels away the dummy password, so you only need to do
- this step one time.
- - Now, you can check out a source tree using normal CVS commands. For example:
-
$ cvs checkout fpconfig
- $ cd fptools
- $ cvs checkout ghc
- gets a brand spanking new set of GHC sources.
-
-
-The layout of our CVS repository is described below, under Using CVS
-for the first time.
-
-With read-only CVS access you can do anything except commit changes to the repository.
-You can make changes to your local tree, and still use CVS's merge facility to keep your
-tree up to date, and you can generate patches using 'cvs diff' in order to send to us for
-inclusion.
-
-Remote Read-Write CVS Access
-
-We generally supply read-write access to folk doing serious development on some part of
-the source tree, when going through us would be a pain. If you're developing some feature,
-or think you have the time and inclination to fix bugs in our sources, feel free to ask
-for read-write access. There is a certain amount of responsibility that goes with commit
-privileges; we are more likely to grant you access if you've demonstrated your competence
-by sending us patches via mail in the past.
-
-To use remote CVS, you need to supply me with a username and
-encrypted password. Once you've done that and the account on
-cvs.haskell.org has been set up, you need to install ssh, which is relatively painless. Log
-in to cvs.haskell.org, and set up your .ssh/authorized_keys
-file to allow logins from your local machine without a password (the
-ssh documentation has details on how to do this). Then, just
-
-
- - set your CVSROOT environment variable to :ext:<username>@cvs.haskell.org:/home/cvs/root.
-
- - set your CVS_RSH environment variable to ssh.
-
-
-The CVSROOT environment variable will be recorded in the checked-out tree, so
-you don't need to set this every time either. Ignore the instructions for setting CVSROOT
-below.
-
-
-Caveats:
-
-
- - Setting your CVS_RSH to ssh assumes that your CVS client understands
- how to execute shell script ("#!"s,really), which is what ssh is. This
- may not be the case on some platforms (read: Win32), so in that case set CVS_RSH
- to ssh1.
-
-
-Using CVS for the First Time
-
-
- - (ok, everybody now...) Firstly, identify which areas of the source tree you'll be
- working on. The directory structure looks like this:
-
-
- fptools/ghc |
- GHC |
-
-
- fptools/happy |
- Happy |
-
-
- fptools/green-card |
- Green Card |
-
-
- fptools/nofib |
- Nofib test suite |
-
-
- fptools/hdirect |
- IDL-to-Haskell compiler |
-
-
- For each directory, there's a mailing list: cvs-ghc, cvs-nofib
- etc. Everyone on the mailing list is sent a message automatically by CVS whenever someone
- checks in a change, this helps to keep track of what's going on when several people are
- working on related stuff. To join any of these mailing lists, mail majordomo@haskell.org.
- - Create a .cvsrc file. Mine looks like this:
-
checkout -P
- release -d
- update -P
- diff -c
- It just gives default flags for some of the CVS commands. For instance, the -P flag to
- 'checkout' says prune empty directories, which is normally what you want.
-
-
-Checking Out a Source Tree
-
-
- - Check out your sources. Make sure you set your CVSROOT environment variable
- according to either of the remote methods above. The Approved Way (at least by me) to
- check out a source tree is as follows:
-
$ cvs checkout fpconfig
- At this point you have a new directory called 'fptools' which contains the basic stuff
- for the fptools suite - including the configuration files and some other junk.
- $ mv fptools <directory>
- You can call the fptools directory whatever you like, CVS won't mind.
- $ cd <directory>
- $ cvs checkout ghc happy
- The second command here checks out the relevant modules you want to work on. For a GHC
- build, for instance, you need at least the ghc module (in fact you can get away
- with just that).
-
-
-Committing Your Changes
-
-This is only if you have read-write access to the repository. For anoncvs users, CVS
-will issue a "read-only repository" error if you try to commit changes.
-
-
$ cd fptools
- $ cvs update
- This pulls in any changes that other people have made, and merges them with yours. If
- there are any conflicts, CVS will tell you, and you'll have to resolve them before you can
- check your changes in. The documentation describes what to do in the event of a conflict.
- It's not always necessary to do a full cvs update before checking in a change, since
- CVS will always tell you if you try to check in a file that someone else has changed.
- However, you should still update at regular intervals to avoid making changes that don't
- work in conjuction with changes that someone else made. Keeping an eye on what goes by on
- the mailing list can help here.
-
-
- When you're happy that your change isn't going to break anything, check it in. For a
- one-file change:
- $ cvs commit <filename>
- CVS will then pop up an editor for you to enter a "commit message", this is
- just a short description of what your change does, and will be kept in the history of the
- file.
- If you're using emacs, simply load up the file into a buffer and type C-x C-q, and
- emacs will prompt for a commit message and then check in the file for you.
- For a multiple-file change, things are a bit trickier. There are several ways to do
- this, but this is the way I find easiest. First type the commit message into a temporary
- file. Then either
- $ cvs commit -F <commit-message> <file_1> .... <file_n>
- or, if nothing else has changed in this part of the source tree,
- $ cvs commit -F <commit-message> <directory>
- where <directory> is a common parent directory for all your changes, and
- <commit-message> is the name of the file containing the commit message.
- Shortly afterwards, you'll get some mail from the relevant mailing list saying which
- files changed, and giving the commit message. For a multiple-file change, you should still
- get only *one* message.
-
-
-Updating Your Source Tree
-
-It can be tempting to cvs update just part of a source tree to bring in some changes
-that someone else has made, or before committing your own changes. This is NOT
-RECOMMENDED! Quite often changes in one part of the tree are dependent on changes in
-another part of the tree (the mk/*.mk files are a good example where problems
-crop up quite often). Having an inconsistent tree is a major cause of headaches.
-
-So, to avoid a lot of hassle, follow this recipe for updating your tree:
-
-$ cd fptools
-$ cvs update -Pd 2>&1 | tee log
-
-Look at the log file, and fix any conflicts (denoted by a 'C' in the first column). If
-you're using multiple build trees, then for every build tree you have pointing at this
-source tree, you need to update the links in case any new files have appeared:
-
-$ cd <build-tree>
-$ lndir <source-tree>
-
-Some files might have been removed, so you need to remove the links pointing to these
-non-existent files:
-
-$ find . -xtype l -exec rm '{}' \;
-
-And finally, re-configure to take into accound any changes in mk/config.mk.in.
-
-$ ./configure
-
-To be *really* safe, you should do
-
-$ gmake boot && gmake all
-
-from the top-level, to update the dependencies and build any changed files.
-
-GHC Tag Policy
-
-If you want to check out a particular version of GHC, you'll need to
-know how we tag versions in the repository. The policy (as of 4.04)
-is:
-
-
- - The tree is branched before every major release. The branch
- tag is ghc-x-xx-branch, where x-xx is the version
- number of the release with the '.' replaced by a
- '-'. For example, the 4.04 release lives on
- ghc-4-04-branch.
-
- - The release itself is tagged with ghc-x-xx (on the
- branch). eg. 4.06 is called ghc-4-06.
-
- - We didn't always follow these guidelines, so to see what tags
- there are for previous versions, do cvs log on a file
- that's been around for a while (like fptools/ghc/README).
-
-
-So, to check out a fresh GHC 4.06 tree you would do:
-
-
- $ cvs co -r ghc-4-06 fpconfig
- $ cd fptools
- $ cvs co -r ghc-4-06 ghc hslibs
-
-
-
-General Hints
-
-
- - As a general rule: commit changes in small units, preferably addressing one issue or
- implementing a single feature. Provide a descriptive log message so that the repository
- records exactly which changes were required to implement a given feature/fix a bug. I've
- found this *very* useful in the past for finding out when a particular bug was introduced:
- you can just wind back the CVS tree until the bug disappears.
- - Keep the sources at least *buildable* at any given time. No doubt bugs will creep in,
- but it's quite easy to ensure that any change made at least leaves the tree in a buildable
- state. We do nightly builds of GHC to keep an eye on what things work/don't work each day
- and how we're doing in relation to previous verions. This idea is truely wrecked if the
- compiler won't build in the first place!
- - To check out extra bits into an already-checked-out tree, use the following procedure.
- Suppose you have a checked-out fptools tree containing just ghc, and you want to add nofib
- to it:
-
cd fptools
- cvs checkout nofib
- or:
- cd fptools
- cvs update -d nofib
- (the -d flag tells update to create a new directory). If you just want part of the
- nofib suite, you can do
- cd fptools
- cvs checkout nofib/spectral
- This works because nofib is a module in its own right, and spectral is a
- subdirectory of the nofib module. The path argument to checkout must always start with a
- module name. There's no equivalent form of this command using update.
-
-
-Reporting Bugs in the CVS sources
-
- If you are reporting a bug or infelicity in the CVS version of
-GHC, please send your message to
-
-
-
-(not to glasgow-haskell-bugs). Two reasons:
-
-
-- Readers of glasgow-haskell-bugs will get less junk mail
-
-- I'm a little worried that ghc-bugs readers are beginning to think
- "is ghc really this unreliable?"! The checked-in-last-night version
- of GHC just isn't going to be solid. No one expects it to be. But
- a casual reader might not distinguish.
-
-
-Please don't stop sending bug reports though. They are really useful.
-
-
-
-Ok, that'll do for now. If there's anything else you'd like to see
-in this file, just let us know.
-
-
-
-
+
+
+
+
+
+
+Access To The GHC CVS Repository
+
+
+
+
+FP Tools CVS Cheat Sheet
+
+We use CVS (Concurrent Version System) to keep track of our sources for various
+software projects. CVS lets several people work on the same software at the same time,
+allowing changes to be checked in incrementally.
+
+Information on using CVS can be obtained from Cyclic
+Software.
+
+This note is supposed to be a set of guidelines for how to use our CVS repository, and
+will probably evolve in time. The main thing to remember is that most mistakes can be
+undone, but if there's anything you're not sure about feel free to bug the local CVS
+meister (namely Jeff Lewis).
+
+Contents
+
+
+
+Remote Read-only CVS Access
+
+Read-only access is available to anyone - there's no need to ask us first. To get
+read-only access to our repository:
+
+
+ - set your CVSROOT environment variable to :pserver:anoncvs@glass.cse.ogi.edu:/cvs
+ - The first time you access the repository, you'll need to do cvs login.
+ The password is simply cvs. This sets up a file in your home directory
+ called .cvspass, which squirrels away the dummy password, so you only need to do
+ this step one time.
+ - Now, you can check out a source tree using normal CVS commands. For example:
+
$ cvs checkout fpconfig
+ $ cd fptools
+ $ cvs checkout ghc
+ gets a brand spanking new set of GHC sources.
+
+
+The layout of our CVS repository is described below, under Using CVS
+for the first time.
+
+With read-only CVS access you can do anything except commit changes to the repository.
+You can make changes to your local tree, and still use CVS's merge facility to keep your
+tree up to date, and you can generate patches using 'cvs diff' in order to send to us for
+inclusion.
+
+Remote Read-Write CVS Access
+
+We generally supply read-write access to folk doing serious development on some part of
+the source tree, when going through us would be a pain. If you're developing some feature,
+or think you have the time and inclination to fix bugs in our sources, feel free to ask
+for read-write access. There is a certain amount of responsibility that goes with commit
+privileges; we are more likely to grant you access if you've demonstrated your competence
+by sending us patches via mail in the past.
+
+To use remote CVS, you need to supply me with a username and
+encrypted password. Once you've done that and the account on
+cvs.haskell.org has been set up, you need to install ssh, which is relatively painless. Log
+in to cvs.haskell.org, and set up your .ssh/authorized_keys
+file to allow logins from your local machine without a password (the
+ssh documentation has details on how to do this). Then, just
+
+
+ - set your CVSROOT environment variable to :ext:<username>@cvs.haskell.org:/home/cvs/root.
+
+ - set your CVS_RSH environment variable to ssh.
+
+
+The CVSROOT environment variable will be recorded in the checked-out tree, so
+you don't need to set this every time either. Ignore the instructions for setting CVSROOT
+below.
+
+
+Caveats:
+
+
+ - Setting your CVS_RSH to ssh assumes that your CVS client understands
+ how to execute shell script ("#!"s,really), which is what ssh is. This
+ may not be the case on some platforms (read: Win32), so in that case set CVS_RSH
+ to ssh1.
+
+
+Using CVS for the First Time
+
+
+ - (ok, everybody now...) Firstly, identify which areas of the source tree you'll be
+ working on. The directory structure looks like this:
+
+
+ fptools/ghc |
+ GHC |
+
+
+ fptools/happy |
+ Happy |
+
+
+ fptools/green-card |
+ Green Card |
+
+
+ fptools/nofib |
+ Nofib test suite |
+
+
+ fptools/hdirect |
+ IDL-to-Haskell compiler |
+
+
+ For each directory, there's a mailing list: cvs-ghc, cvs-nofib
+ etc. Everyone on the mailing list is sent a message automatically by CVS whenever someone
+ checks in a change, this helps to keep track of what's going on when several people are
+ working on related stuff. To join any of these mailing lists, mail majordomo@haskell.org.
+ - Create a .cvsrc file. Mine looks like this:
+
checkout -P
+ release -d
+ update -P
+ diff -c
+ It just gives default flags for some of the CVS commands. For instance, the -P flag to
+ 'checkout' says prune empty directories, which is normally what you want.
+
+
+Checking Out a Source Tree
+
+
+ - Check out your sources. Make sure you set your CVSROOT environment variable
+ according to either of the remote methods above. The Approved Way (at least by me) to
+ check out a source tree is as follows:
+
$ cvs checkout fpconfig
+ At this point you have a new directory called 'fptools' which contains the basic stuff
+ for the fptools suite - including the configuration files and some other junk.
+ $ mv fptools <directory>
+ You can call the fptools directory whatever you like, CVS won't mind.
+ $ cd <directory>
+ $ cvs checkout ghc happy
+ The second command here checks out the relevant modules you want to work on. For a GHC
+ build, for instance, you need at least the ghc module (in fact you can get away
+ with just that).
+
+
+Committing Your Changes
+
+This is only if you have read-write access to the repository. For anoncvs users, CVS
+will issue a "read-only repository" error if you try to commit changes.
+
+
$ cd fptools
+ $ cvs update
+ This pulls in any changes that other people have made, and merges them with yours. If
+ there are any conflicts, CVS will tell you, and you'll have to resolve them before you can
+ check your changes in. The documentation describes what to do in the event of a conflict.
+ It's not always necessary to do a full cvs update before checking in a change, since
+ CVS will always tell you if you try to check in a file that someone else has changed.
+ However, you should still update at regular intervals to avoid making changes that don't
+ work in conjuction with changes that someone else made. Keeping an eye on what goes by on
+ the mailing list can help here.
+
+
+ When you're happy that your change isn't going to break anything, check it in. For a
+ one-file change:
+ $ cvs commit <filename>
+ CVS will then pop up an editor for you to enter a "commit message", this is
+ just a short description of what your change does, and will be kept in the history of the
+ file.
+ If you're using emacs, simply load up the file into a buffer and type C-x C-q, and
+ emacs will prompt for a commit message and then check in the file for you.
+ For a multiple-file change, things are a bit trickier. There are several ways to do
+ this, but this is the way I find easiest. First type the commit message into a temporary
+ file. Then either
+ $ cvs commit -F <commit-message> <file_1> .... <file_n>
+ or, if nothing else has changed in this part of the source tree,
+ $ cvs commit -F <commit-message> <directory>
+ where <directory> is a common parent directory for all your changes, and
+ <commit-message> is the name of the file containing the commit message.
+ Shortly afterwards, you'll get some mail from the relevant mailing list saying which
+ files changed, and giving the commit message. For a multiple-file change, you should still
+ get only *one* message.
+
+
+Updating Your Source Tree
+
+It can be tempting to cvs update just part of a source tree to bring in some changes
+that someone else has made, or before committing your own changes. This is NOT
+RECOMMENDED! Quite often changes in one part of the tree are dependent on changes in
+another part of the tree (the mk/*.mk files are a good example where problems
+crop up quite often). Having an inconsistent tree is a major cause of headaches.
+
+So, to avoid a lot of hassle, follow this recipe for updating your tree:
+
+$ cd fptools
+$ cvs update -Pd 2>&1 | tee log
+
+Look at the log file, and fix any conflicts (denoted by a 'C' in the first column). If
+you're using multiple build trees, then for every build tree you have pointing at this
+source tree, you need to update the links in case any new files have appeared:
+
+$ cd <build-tree>
+$ lndir <source-tree>
+
+Some files might have been removed, so you need to remove the links pointing to these
+non-existent files:
+
+$ find . -xtype l -exec rm '{}' \;
+
+And finally, re-configure to take into accound any changes in mk/config.mk.in.
+
+$ ./configure
+
+To be *really* safe, you should do
+
+$ gmake boot && gmake all
+
+from the top-level, to update the dependencies and build any changed files.
+
+GHC Tag Policy
+
+If you want to check out a particular version of GHC, you'll need to
+know how we tag versions in the repository. The policy (as of 4.04)
+is:
+
+
+ - The tree is branched before every major release. The branch
+ tag is ghc-x-xx-branch, where x-xx is the version
+ number of the release with the '.' replaced by a
+ '-'. For example, the 4.04 release lives on
+ ghc-4-04-branch.
+
+ - The release itself is tagged with ghc-x-xx (on the
+ branch). eg. 4.06 is called ghc-4-06.
+
+ - We didn't always follow these guidelines, so to see what tags
+ there are for previous versions, do cvs log on a file
+ that's been around for a while (like fptools/ghc/README).
+
+
+So, to check out a fresh GHC 4.06 tree you would do:
+
+
+ $ cvs co -r ghc-4-06 fpconfig
+ $ cd fptools
+ $ cvs co -r ghc-4-06 ghc hslibs
+
+
+
+General Hints
+
+
+ - As a general rule: commit changes in small units, preferably addressing one issue or
+ implementing a single feature. Provide a descriptive log message so that the repository
+ records exactly which changes were required to implement a given feature/fix a bug. I've
+ found this *very* useful in the past for finding out when a particular bug was introduced:
+ you can just wind back the CVS tree until the bug disappears.
+ - Keep the sources at least *buildable* at any given time. No doubt bugs will creep in,
+ but it's quite easy to ensure that any change made at least leaves the tree in a buildable
+ state. We do nightly builds of GHC to keep an eye on what things work/don't work each day
+ and how we're doing in relation to previous verions. This idea is truely wrecked if the
+ compiler won't build in the first place!
+ - To check out extra bits into an already-checked-out tree, use the following procedure.
+ Suppose you have a checked-out fptools tree containing just ghc, and you want to add nofib
+ to it:
+
cd fptools
+ cvs checkout nofib
+ or:
+ cd fptools
+ cvs update -d nofib
+ (the -d flag tells update to create a new directory). If you just want part of the
+ nofib suite, you can do
+ cd fptools
+ cvs checkout nofib/spectral
+ This works because nofib is a module in its own right, and spectral is a
+ subdirectory of the nofib module. The path argument to checkout must always start with a
+ module name. There's no equivalent form of this command using update.
+
+
+Reporting Bugs in the CVS sources
+
+ If you are reporting a bug or infelicity in the CVS version of
+GHC, please send your message to
+
+
+
+(not to glasgow-haskell-bugs). Two reasons:
+
+
+- Readers of glasgow-haskell-bugs will get less junk mail
+
+- I'm a little worried that ghc-bugs readers are beginning to think
+ "is ghc really this unreliable?"! The checked-in-last-night version
+ of GHC just isn't going to be solid. No one expects it to be. But
+ a casual reader might not distinguish.
+
+
+Please don't stop sending bug reports though. They are really useful.
+
+
+
+Ok, that'll do for now. If there's anything else you'd like to see
+in this file, just let us know.
+
+
+
+
hunk ./ghc/ANNOUNCE 1
- The Glasgow Haskell Compiler -- version 4.08
- ==============================================
-
-We are pleased to announce a new release of the Glasgow Haskell
-Compiler (GHC), version 4.08. The source distribution is freely
-available via the World-Wide Web and through anon. FTP; details below.
-
-Haskell is "the" standard lazy functional programming language; the
-current language version is Haskell 98, agreed in December 1998.
-Haskell related information is available from the Haskell home page at
-
- http://www.haskell.org/
-
-GHC's Web page lives at
-
- http://www.haskell.org/ghc/
-
-+ What's new
-=============
-
-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
-(US)).
-
-There are the following changes
-
- - New profiling subsystem, based on cost-centre stacks.
-
- - Working x86 native code generator: now it works properly, runs
- about twice as fast as compiling via C, and is on a par for
- run-time speed (except in FP-intensive programs).
-
- - Implicit parameters (i.e. dynamic scoping without the pain).
-
- - DEPRECATED pragma for marking obsolescent interfaces.
-
- - In the wake of hslibs, a new package system for
- libraries. -package should now be used instead of -syslib.
-
- - Result type signatures work.
-
- - Many tiresome long-standing bugs and problems (e.g. the trace
- problem) have been fixed.
-
- - Many error messages have been made more helpful and/or
- accurate.
-
-For full details see the release notes:
-
- http://www.haskell.org/ghc/docs/4.08/users_guide/release-4-08.html
-
-
-+ Mailing lists
-================
-
-We run mailing lists for GHC users and bug reports; to subscribe, send
-mail to majordomo@haskell.org; the msg body should be:
-
- subscribe glasgow-haskell-{users,bugs} Your Name
-
-or
-
- subscribe cvs-ghc Your Name
-
-Please send bug reports about GHC to glasgow-haskell-bugs@haskell.org;
-GHC users hang out on glasgow-haskell-users@haskell.org. Bleeding
-edge CVS users party on cvs-ghc@haskell.org.
-
-
-+ On-line GHC-related resources
-================================
-
-Relevant URLs on the World-Wide Web:
-
-GHC home page http://www.haskell.org/ghc/
-Haskell home page http://www.haskell.org/
-comp.lang.functional FAQ http://www.cs.nott.ac.uk/~gmh/faq.html
-
-
-+ How to get it
-================
-
-The easy way is to go to the WWW page, which should be
-self-explanatory:
-
- http://www.haskell.org/ghc/
-
-Once you have the distribution, please follow the pointers in the
-README file to find all of the documentation about this release. NB:
-preserve modification times when un-tarring the files (no `m' option
-for tar, please)!
-
-
-+ System requirements
-======================
-
-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
-release is known to work on the following platforms:
-
- * i386-unknown-{linux,freebsd,netbsd,cygwin32,mingw32}
- * sparc-sun-{sunos4,solaris2}
- * hppa1.1-hp-hpux{9,10}
-
-Ports to the following platforms should be relatively easy (for a
-wunderhacker), but haven't been tested due to lack of time/hardware:
-
- * i386-unknown-solaris2
- * alpha-dec-osf{2,3}
- * mips-sgi-irix{5,6}
- * {rs6000,powerpc}-ibm-aix
-
-The builder's guide included in distribution gives a complete
-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
+ The Glasgow Haskell Compiler -- version 4.08
+ ==============================================
+
+We are pleased to announce a new release of the Glasgow Haskell
+Compiler (GHC), version 4.08. The source distribution is freely
+available via the World-Wide Web and through anon. FTP; details below.
+
+Haskell is "the" standard lazy functional programming language; the
+current language version is Haskell 98, agreed in December 1998.
+Haskell related information is available from the Haskell home page at
+
+ http://www.haskell.org/
+
+GHC's Web page lives at
+
+ http://www.haskell.org/ghc/
+
++ What's new
+=============
+
+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
+(US)).
+
+There are the following changes
+
+ - New profiling subsystem, based on cost-centre stacks.
+
+ - Working x86 native code generator: now it works properly, runs
+ about twice as fast as compiling via C, and is on a par for
+ run-time speed (except in FP-intensive programs).
+
+ - Implicit parameters (i.e. dynamic scoping without the pain).
+
+ - DEPRECATED pragma for marking obsolescent interfaces.
+
+ - In the wake of hslibs, a new package system for
+ libraries. -package should now be used instead of -syslib.
+
+ - Result type signatures work.
+
+ - Many tiresome long-standing bugs and problems (e.g. the trace
+ problem) have been fixed.
+
+ - Many error messages have been made more helpful and/or
+ accurate.
+
+For full details see the release notes:
+
+ http://www.haskell.org/ghc/docs/4.08/users_guide/release-4-08.html
+
+
++ Mailing lists
+================
+
+We run mailing lists for GHC users and bug reports; to subscribe, send
+mail to majordomo@haskell.org; the msg body should be:
+
+ subscribe glasgow-haskell-{users,bugs} Your Name
+
+or
+
+ subscribe cvs-ghc Your Name
+
+Please send bug reports about GHC to glasgow-haskell-bugs@haskell.org;
+GHC users hang out on glasgow-haskell-users@haskell.org. Bleeding
+edge CVS users party on cvs-ghc@haskell.org.
+
+
++ On-line GHC-related resources
+================================
+
+Relevant URLs on the World-Wide Web:
+
+GHC home page http://www.haskell.org/ghc/
+Haskell home page http://www.haskell.org/
+comp.lang.functional FAQ http://www.cs.nott.ac.uk/~gmh/faq.html
+
+
++ How to get it
+================
+
+The easy way is to go to the WWW page, which should be
+self-explanatory:
+
+ http://www.haskell.org/ghc/
+
+Once you have the distribution, please follow the pointers in the
+README file to find all of the documentation about this release. NB:
+preserve modification times when un-tarring the files (no `m' option
+for tar, please)!
+
+
++ System requirements
+======================
+
+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
+release is known to work on the following platforms:
+
+ * i386-unknown-{linux,freebsd,netbsd,cygwin32,mingw32}
+ * sparc-sun-{sunos4,solaris2}
+ * hppa1.1-hp-hpux{9,10}
+
+Ports to the following platforms should be relatively easy (for a
+wunderhacker), but haven't been tested due to lack of time/hardware:
+
+ * i386-unknown-solaris2
+ * alpha-dec-osf{2,3}
+ * mips-sgi-irix{5,6}
+ * {rs6000,powerpc}-ibm-aix
+
+The builder's guide included in distribution gives a complete
+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
hunk ./ghc/interpreter/test/static/s108.hs 1
---!!! Testing export of unknown name
-module Bar(bar) where
+--!!! Testing export of unknown name
+module Bar(bar) where
hunk ./ghc/tests/typecheck/should_compile/tc105.hs 1
-{-# OPTIONS -fglasgow-exts #-}
-
--- !!! Scoped type variables in result signatures
-module ShouldCompile where
-
-import PrelST
-import PrelArr
-
-f:: ST s Int
-f:: ST s Int = do
- v <- newSTRef 5
- let g :: ST s Int
- -- ^ should be in scope
- g = readSTRef v
- g
+{-# OPTIONS -fglasgow-exts #-}
+
+-- !!! Scoped type variables in result signatures
+module ShouldCompile where
+
+import PrelST
+import PrelArr
+
+f:: ST s Int
+f:: ST s Int = do
+ v <- newSTRef 5
+ let g :: ST s Int
+ -- ^ should be in scope
+ g = readSTRef v
+ g
hunk ./glafp-utils/docbook/Makefile 4
-SUBDIRS = db2dvi.dir db2html.dir db2pdf.dir db2ps.dir db2rtf.dir
+SUBDIRS = db2dvi.dir db2html.dir db2pdf.dir db2ps.dir db2rtf.dir \
+ dbindex.dir
hunk ./glafp-utils/nofib-analyse/ClassTable.hs 1
------------------------------------------------------------------------------
--- TableClass : Class for combinators used in building 2D tables.
---
--- Copyright (c) 1999 Andy Gill
---
--- This module is distributed as Open Source software under the
--- Artistic License; see the file "Artistic" that is included
--- in the distribution for details.
------------------------------------------------------------------------------
-
-module ClassTable (
- Table(..),
- showsTable,
- showTable,
- ) where
-
-infixr 4 `beside`
-infixr 3 `above`
-
-{----------------------------------------------------------------------------
- These combinators can be used to build formated 2D tables.
- The specific target useage is for HTML table generation.
- ----------------------------------------------------------------------------
-
- Examples of use:
-
- > table1 :: (Table t) => t String
- > table1 = single "Hello" +-----+
- |Hello|
- This is a 1x1 cell +-----+
- Note: single has type
-
- single :: (Table t) => a -> t a
-
- So the cells can contain anything.
-
- > table2 :: (Table t) => t String
- > table2 = single "World" +-----+
- |World|
- +-----+
-
-
- > table3 :: (Table t) => t String
- > table3 = table1 %-% table2 +-----%-----+
- |Hello%World|
- % is used to indicate +-----%-----+
- the join edge between
- the two Tables.
-
- > table4 :: (Table t) => t String
- > table4 = table3 %/% table2 +-----+-----+
- |Hello|World|
- Notice the padding on the %%%%%%%%%%%%%
- smaller (bottom) cell to |World |
- force the table to be a +-----------+
- rectangle.
-
- > table5 :: (Table t) => t String
- > table5 = table1 %-% table4 +-----%-----+-----+
- |Hello%Hello|World|
- Notice the padding on the | %-----+-----+
- leftmost cell, again to | %World |
- force the table to be a +-----%-----------+
- rectangle.
-
- Now the table can be rendered with processTable, for example:
- Main> processTable table5
- [[("Hello",(1,2)),
- ("Hello",(1,1)),
- ("World",(1,1))],
- [("World",(2,1))]] :: [[([Char],(Int,Int))]]
- Main>
-
-----------------------------------------------------------------------------}
-
-class Table t where
- -- There are no empty tables
-
- --Single element table
- single :: a -> t a
- -- horizontal composition
- beside :: t a -> t a -> t a
- -- vertical composition
- above :: t a -> t a -> t a
- -- generation of raw table matrix
- getMatrix :: t a -> [[(a,(Int,Int))]]
-
-showsTable :: (Show a,Table t) => t a -> ShowS
-showsTable table = shows (getMatrix table)
-
-showTable :: (Show a,Table t) => t a -> String
-showTable table = showsTable table ""
-
-
+-----------------------------------------------------------------------------
+-- TableClass : Class for combinators used in building 2D tables.
+--
+-- Copyright (c) 1999 Andy Gill
+--
+-- This module is distributed as Open Source software under the
+-- Artistic License; see the file "Artistic" that is included
+-- in the distribution for details.
+-----------------------------------------------------------------------------
+
+module ClassTable (
+ Table(..),
+ showsTable,
+ showTable,
+ ) where
+
+infixr 4 `beside`
+infixr 3 `above`
+
+{----------------------------------------------------------------------------
+ These combinators can be used to build formated 2D tables.
+ The specific target useage is for HTML table generation.
+ ----------------------------------------------------------------------------
+
+ Examples of use:
+
+ > table1 :: (Table t) => t String
+ > table1 = single "Hello" +-----+
+ |Hello|
+ This is a 1x1 cell +-----+
+ Note: single has type
+
+ single :: (Table t) => a -> t a
+
+ So the cells can contain anything.
+
+ > table2 :: (Table t) => t String
+ > table2 = single "World" +-----+
+ |World|
+ +-----+
+
+
+ > table3 :: (Table t) => t String
+ > table3 = table1 %-% table2 +-----%-----+
+ |Hello%World|
+ % is used to indicate +-----%-----+
+ the join edge between
+ the two Tables.
+
+ > table4 :: (Table t) => t String
+ > table4 = table3 %/% table2 +-----+-----+
+ |Hello|World|
+ Notice the padding on the %%%%%%%%%%%%%
+ smaller (bottom) cell to |World |
+ force the table to be a +-----------+
+ rectangle.
+
+ > table5 :: (Table t) => t String
+ > table5 = table1 %-% table4 +-----%-----+-----+
+ |Hello%Hello|World|
+ Notice the padding on the | %-----+-----+
+ leftmost cell, again to | %World |
+ force the table to be a +-----%-----------+
+ rectangle.
+
+ Now the table can be rendered with processTable, for example:
+ Main> processTable table5
+ [[("Hello",(1,2)),
+ ("Hello",(1,1)),
+ ("World",(1,1))],
+ [("World",(2,1))]] :: [[([Char],(Int,Int))]]
+ Main>
+
+----------------------------------------------------------------------------}
+
+class Table t where
+ -- There are no empty tables
+
+ --Single element table
+ single :: a -> t a
+ -- horizontal composition
+ beside :: t a -> t a -> t a
+ -- vertical composition
+ above :: t a -> t a -> t a
+ -- generation of raw table matrix
+ getMatrix :: t a -> [[(a,(Int,Int))]]
+
+showsTable :: (Show a,Table t) => t a -> ShowS
+showsTable table = shows (getMatrix table)
+
+showTable :: (Show a,Table t) => t a -> String
+showTable table = showsTable table ""
+
+
hunk ./glafp-utils/nofib-analyse/DataHtml.hs 1
--------------------------------------------------------------------------------
--- $Id: DataHtml.hs,v 1.1 1999/11/12 11:54:17 simonmar Exp $
---
--- Copyright (c) 1999 Andy Gill
--------------------------------------------------------------------------------
-
-module DataHtml (
- Html, HtmlName, HtmlAttr, HtmlTable,
- (+++), verbatim, {- tag, atag, -} noHtml, primHtml,
- concatHtml, htmlStr, htmlLine,
- h1,h2,h3,h4,h5,h6,
- font, bold, anchor, header, body, theTitle, paragraph, italics,
- ul, tt,
- bar, meta, li,
- {- tr, int, percent -}
- color, bgcolor, href, name, title, height, width, align, valign,
- border, size, cellpadding, cellspacing,
- p, hr, copyright, spaceHtml,
- renderHtml,
- cellHtml, (+/+), above, (+-+), beside, aboves, besides,
- renderTable, simpleTable,
- ) where
-
-import qualified OptTable as OT
-
-infixr 5 +++ -- appending Html
-infixr 3 +/+ -- combining HtmlTable
-infixr 4 +-+ -- combining HtmlTable
-
-data Html
- = HtmlAppend Html Html -- Some Html, followed by more text
- | HtmlVerbatim Html -- Turn on or off smart formating
- | HtmlEmpty -- Nothing!
- | HtmlNestingTag HtmlName [HtmlAttr] Html
- | HtmlSimpleTag HtmlName [HtmlAttr]
- | HtmlString String
- deriving (Show)
-
-{-
- - A important property of Html is all strings inside the
- - structure are already in Html friendly format.
- - For example, use of >,etc.
- -}
-
-type HtmlName = String
-type HtmlAttr = (HtmlName,Either Int String)
-type HtmlTable = OT.OptTable (Int -> Int -> Html)
-
-------------------------------------------------------------------------------
--- Interface
-------------------------------------------------------------------------------
-
--- primitive combinators
-(+++) :: Html -> Html -> Html
-verbatim :: Html -> Html
-tag :: String -> [HtmlAttr] -> Html -> Html
-atag :: String -> [HtmlAttr] -> Html
-noHtml :: Html
-primHtml :: String -> Html
-
--- useful combinators
-concatHtml :: [Html] -> Html
-htmlStr, htmlLine :: String -> Html
-
--- html constructors
-h1,h2,h3,h4,h5,h6 :: [HtmlAttr] -> Html -> Html
-font, bold, anchor,
- header, body,
- theTitle, paragraph,
- italics, ul, tt :: [HtmlAttr] -> Html -> Html
-bar, meta, li :: [HtmlAttr] -> Html
-
--- html attributes
-str :: String -> String -> HtmlAttr
-int :: String -> Int -> HtmlAttr
-percent :: String -> Int -> HtmlAttr
-
-color, bgcolor, href,
- name, title, height,
- width, align, valign :: String -> HtmlAttr
-
-border, size,
- cellpadding,
- cellspacing :: Int -> HtmlAttr
-
--- abbriviations
-
-p :: Html -> Html
-hr :: Html
-copyright :: Html
-spaceHtml :: Html
-
--- rendering
-renderHtml :: Html -> String
-
--- html tables
-cellHtml :: [HtmlAttr] -> Html -> HtmlTable
-(+/+),above,
- (+-+),beside :: HtmlTable -> HtmlTable -> HtmlTable
-aboves, besides :: [HtmlTable] -> HtmlTable
-renderTable :: [HtmlAttr] -> HtmlTable -> Html
-simpleTable :: [HtmlAttr] -> [HtmlAttr] -> [[Html]]
- -> Html
-
-------------------------------------------------------------------------------
--- Basic, primitive combinators
-
--- This is intentionally lazy in the second argument.
-(HtmlAppend x y) +++ z = x +++ (y +++ z)
-(HtmlEmpty) +++ z = z
-x +++ z = HtmlAppend x z
-
-verbatim = HtmlVerbatim
-tag = HtmlNestingTag
-atag = HtmlSimpleTag
-noHtml = HtmlEmpty
-
--- This is not processed for special chars.
--- It is used to output them, though!
-primHtml = HtmlString
-
-------------------------------------------------------------------------------
--- Useful Combinators
-
-concatHtml = foldr (+++) noHtml
--- Processing Strings into Html friendly things.
--- This converts a string to an Html.
-htmlStr = primHtml . htmlizeStr
-
--- This converts a string, but keeps spaces as non-line-breakable
-htmlLine = primHtml . concat . map htmlizeChar2
- where
- htmlizeChar2 ' ' = " "
- htmlizeChar2 c = htmlizeChar c
-
--- Local Utilites
-htmlizeStr :: String -> String
-htmlizeStr = concat . map htmlizeChar
-
-htmlizeChar :: Char -> String
-htmlizeChar '<' = ">"
-htmlizeChar '>' = "<"
-htmlizeChar '&' = "&amb;"
-htmlizeChar '"' = """
-htmlizeChar c = [c]
-
-------------------------------------------------------------------------------
--- Html Constructors
-h n = tag ("h" ++ show n)
-
--- Isn't Haskell great!
-[h1,h2,h3,h4,h5,h6] = map h [1..6]
-
--- tags
-font = tag "font"
-bold = tag "b"
-anchor = tag "a"
-header = tag "header"
-body = tag "body"
-theTitle = tag "title"
-paragraph = tag "p"
-italics = tag "i"
-ul = tag "ul"
-tt = tag "tt"
-
-bar = atag "hr"
-meta = atag "meta"
-li = atag "li"
-
-------------------------------------------------------------------------------
--- Html Attributes
-
--- note: the string is presumed to be formated for output
---str :: String -> String -> HtmlAttr
-str n s = (n,Right s)
-
---int :: String -> Int -> HtmlAttr
-int n v = (n,Left v)
-
---percent :: String -> Int -> HtmlAttr
-percent n v = str n (show v ++ "%")
-
--- attributes
-color = str "color"
-bgcolor = str "bgcolor"
-href = str "href"
-name = str "name"
-title = str "tile"
-height = str "height"
-width = str "width"
-align = str "align"
-valign = str "valign"
-
-border = int "border"
-size = int "size"
-cellpadding = int "cellpadding"
-cellspacing = int "cellspacing"
-
-------------------------------------------------------------------------------
--- abbriviations
-p = paragraph []
-hr = atag "hr" []
-copyright = primHtml "©"
-spaceHtml = primHtml " "
-
-------------------------------------------------------------------------------
--- Rendering
-
-renderHtml html = renderHtml' html (Just 0) ++ footerMessage
-
-footerMessage
- = "\n\n"
-
-renderHtml' (HtmlAppend html1 html2) d
- = renderHtml' html1 d ++ renderHtml' html2 d
-renderHtml' (HtmlVerbatim html1) d
- = renderHtml' html1 Nothing
-renderHtml' (HtmlEmpty) d = ""
-renderHtml' (HtmlSimpleTag name attr) d
- = renderTag True name attr d
-renderHtml' (HtmlNestingTag name attr html) d
- = renderTag True name attr d ++ renderHtml' html (incDepth d) ++
- renderTag False name [] d
-renderHtml' (HtmlString str) _ = str
-
-incDepth :: Maybe Int -> Maybe Int
-incDepth = fmap (+4)
-
--- This prints the tags in
-renderTag :: Bool -> HtmlName -> [HtmlAttr] -> Maybe Int -> String
-renderTag x name attrs n = start ++ base_spaces ++ open ++ name ++ rest attrs ++ ">"
- where
- open = if x then "<" else ""
- (start,base_spaces,sep) = case n of
- Nothing -> ("",""," ")
- Just n -> ("\n",replicate n ' ',"\n")
-
- rest [] = ""
- rest [(tag,val)] = " " ++ tag ++ "=" ++ myShow val
- rest (hd:tl) = " " ++ showPair hd ++ sep ++
- foldr1 (\ x y -> x ++ sep ++ y)
- [ base_spaces ++ replicate (1 + length name + 1) ' '
- ++ showPair p | p <- tl ]
-
- showPair :: HtmlAttr -> String
- showPair (tag,val) = tag ++ replicate (tagsz - length tag) ' ' ++
- " = " ++ myShow val
- myShow (Left n) = show n
- myShow (Right s) = "\"" ++ s ++ "\""
-
- tagsz = maximum (map (length.fst) attrs)
-
-------------------------------------------------------------------------------
--- Html table related things
-
-cellHtml attr html = OT.single cellFn
- where
- cellFn x y = tag "td" (addX x (addY y attr)) html
- addX 1 rest = rest
- addX n rest = int "colspan" n : rest
- addY 1 rest = rest
- addY n rest = int "rowspan" n : rest
-
-above = OT.above
-(+/+) = above
-beside = OT.beside
-(+-+) = beside
-
-{-
- - Note: Both aboves and besides presume a non-empty list.
- -}
-
-aboves = foldl1 (+/+)
-besides = foldl1 (+-+)
-
--- renderTable takes the HtmlTable, and renders it back into
--- and Html object. The attributes are added to the outside
--- table tag.
-
-renderTable attr theTable
- = table [row [theCell x y | (theCell,(x,y)) <- theRow ]
- | theRow <- OT.getMatrix theTable]
- where
- row :: [Html] -> Html
- row = tag "tr" [] . concatHtml
-
- table :: [Html] -> Html
- table = tag "table" attr . concatHtml
-
--- If you cant be bothered with the above, then you
--- can build simple tables with this.
--- Just provide the attributes for the whole table,
--- attributes for the cells (same for every cell),
--- and a list of list of cell contents,
--- and this function will build the table for you.
--- It does presume that all the lists are non-empty,
--- and there is at least one list.
---
--- Different length lists means that the last cell
--- gets padded. If you want more power, then
--- use the system above.
-
-simpleTable attr cellAttr
- = renderTable attr
- . aboves
- . map (besides . map (cellHtml cellAttr))
-
-
-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+-- $Id: DataHtml.hs,v 1.2 2000/07/10 16:15:34 rrt Exp $
+--
+-- Copyright (c) 1999 Andy Gill
+-------------------------------------------------------------------------------
+
+module DataHtml (
+ Html, HtmlName, HtmlAttr, HtmlTable,
+ (+++), verbatim, {- tag, atag, -} noHtml, primHtml,
+ concatHtml, htmlStr, htmlLine,
+ h1,h2,h3,h4,h5,h6,
+ font, bold, anchor, header, body, theTitle, paragraph, italics,
+ ul, tt,
+ bar, meta, li,
+ {- tr, int, percent -}
+ color, bgcolor, href, name, title, height, width, align, valign,
+ border, size, cellpadding, cellspacing,
+ p, hr, copyright, spaceHtml,
+ renderHtml,
+ cellHtml, (+/+), above, (+-+), beside, aboves, besides,
+ renderTable, simpleTable,
+ ) where
+
+import qualified OptTable as OT
+
+infixr 5 +++ -- appending Html
+infixr 3 +/+ -- combining HtmlTable
+infixr 4 +-+ -- combining HtmlTable
+
+data Html
+ = HtmlAppend Html Html -- Some Html, followed by more text
+ | HtmlVerbatim Html -- Turn on or off smart formating
+ | HtmlEmpty -- Nothing!
+ | HtmlNestingTag HtmlName [HtmlAttr] Html
+ | HtmlSimpleTag HtmlName [HtmlAttr]
+ | HtmlString String
+ deriving (Show)
+
+{-
+ - A important property of Html is all strings inside the
+ - structure are already in Html friendly format.
+ - For example, use of >,etc.
+ -}
+
+type HtmlName = String
+type HtmlAttr = (HtmlName,Either Int String)
+type HtmlTable = OT.OptTable (Int -> Int -> Html)
+
+------------------------------------------------------------------------------
+-- Interface
+------------------------------------------------------------------------------
+
+-- primitive combinators
+(+++) :: Html -> Html -> Html
+verbatim :: Html -> Html
+tag :: String -> [HtmlAttr] -> Html -> Html
+atag :: String -> [HtmlAttr] -> Html
+noHtml :: Html
+primHtml :: String -> Html
+
+-- useful combinators
+concatHtml :: [Html] -> Html
+htmlStr, htmlLine :: String -> Html
+
+-- html constructors
+h1,h2,h3,h4,h5,h6 :: [HtmlAttr] -> Html -> Html
+font, bold, anchor,
+ header, body,
+ theTitle, paragraph,
+ italics, ul, tt :: [HtmlAttr] -> Html -> Html
+bar, meta, li :: [HtmlAttr] -> Html
+
+-- html attributes
+str :: String -> String -> HtmlAttr
+int :: String -> Int -> HtmlAttr
+percent :: String -> Int -> HtmlAttr
+
+color, bgcolor, href,
+ name, title, height,
+ width, align, valign :: String -> HtmlAttr
+
+border, size,
+ cellpadding,
+ cellspacing :: Int -> HtmlAttr
+
+-- abbriviations
+
+p :: Html -> Html
+hr :: Html
+copyright :: Html
+spaceHtml :: Html
+
+-- rendering
+renderHtml :: Html -> String
+
+-- html tables
+cellHtml :: [HtmlAttr] -> Html -> HtmlTable
+(+/+),above,
+ (+-+),beside :: HtmlTable -> HtmlTable -> HtmlTable
+aboves, besides :: [HtmlTable] -> HtmlTable
+renderTable :: [HtmlAttr] -> HtmlTable -> Html
+simpleTable :: [HtmlAttr] -> [HtmlAttr] -> [[Html]]
+ -> Html
+
+------------------------------------------------------------------------------
+-- Basic, primitive combinators
+
+-- This is intentionally lazy in the second argument.
+(HtmlAppend x y) +++ z = x +++ (y +++ z)
+(HtmlEmpty) +++ z = z
+x +++ z = HtmlAppend x z
+
+verbatim = HtmlVerbatim
+tag = HtmlNestingTag
+atag = HtmlSimpleTag
+noHtml = HtmlEmpty
+
+-- This is not processed for special chars.
+-- It is used to output them, though!
+primHtml = HtmlString
+
+------------------------------------------------------------------------------
+-- Useful Combinators
+
+concatHtml = foldr (+++) noHtml
+-- Processing Strings into Html friendly things.
+-- This converts a string to an Html.
+htmlStr = primHtml . htmlizeStr
+
+-- This converts a string, but keeps spaces as non-line-breakable
+htmlLine = primHtml . concat . map htmlizeChar2
+ where
+ htmlizeChar2 ' ' = " "
+ htmlizeChar2 c = htmlizeChar c
+
+-- Local Utilites
+htmlizeStr :: String -> String
+htmlizeStr = concat . map htmlizeChar
+
+htmlizeChar :: Char -> String
+htmlizeChar '<' = ">"
+htmlizeChar '>' = "<"
+htmlizeChar '&' = "&amb;"
+htmlizeChar '"' = """
+htmlizeChar c = [c]
+
+------------------------------------------------------------------------------
+-- Html Constructors
+h n = tag ("h" ++ show n)
+
+-- Isn't Haskell great!
+[h1,h2,h3,h4,h5,h6] = map h [1..6]
+
+-- tags
+font = tag "font"
+bold = tag "b"
+anchor = tag "a"
+header = tag "header"
+body = tag "body"
+theTitle = tag "title"
+paragraph = tag "p"
+italics = tag "i"
+ul = tag "ul"
+tt = tag "tt"
+
+bar = atag "hr"
+meta = atag "meta"
+li = atag "li"
+
+------------------------------------------------------------------------------
+-- Html Attributes
+
+-- note: the string is presumed to be formated for output
+--str :: String -> String -> HtmlAttr
+str n s = (n,Right s)
+
+--int :: String -> Int -> HtmlAttr
+int n v = (n,Left v)
+
+--percent :: String -> Int -> HtmlAttr
+percent n v = str n (show v ++ "%")
+
+-- attributes
+color = str "color"
+bgcolor = str "bgcolor"
+href = str "href"
+name = str "name"
+title = str "tile"
+height = str "height"
+width = str "width"
+align = str "align"
+valign = str "valign"
+
+border = int "border"
+size = int "size"
+cellpadding = int "cellpadding"
+cellspacing = int "cellspacing"
+
+------------------------------------------------------------------------------
+-- abbriviations
+p = paragraph []
+hr = atag "hr" []
+copyright = primHtml "©"
+spaceHtml = primHtml " "
+
+------------------------------------------------------------------------------
+-- Rendering
+
+renderHtml html = renderHtml' html (Just 0) ++ footerMessage
+
+footerMessage
+ = "\n\n"
+
+renderHtml' (HtmlAppend html1 html2) d
+ = renderHtml' html1 d ++ renderHtml' html2 d
+renderHtml' (HtmlVerbatim html1) d
+ = renderHtml' html1 Nothing
+renderHtml' (HtmlEmpty) d = ""
+renderHtml' (HtmlSimpleTag name attr) d
+ = renderTag True name attr d
+renderHtml' (HtmlNestingTag name attr html) d
+ = renderTag True name attr d ++ renderHtml' html (incDepth d) ++
+ renderTag False name [] d
+renderHtml' (HtmlString str) _ = str
+
+incDepth :: Maybe Int -> Maybe Int
+incDepth = fmap (+4)
+
+-- This prints the tags in
+renderTag :: Bool -> HtmlName -> [HtmlAttr] -> Maybe Int -> String
+renderTag x name attrs n = start ++ base_spaces ++ open ++ name ++ rest attrs ++ ">"
+ where
+ open = if x then "<" else ""
+ (start,base_spaces,sep) = case n of
+ Nothing -> ("",""," ")
+ Just n -> ("\n",replicate n ' ',"\n")
+
+ rest [] = ""
+ rest [(tag,val)] = " " ++ tag ++ "=" ++ myShow val
+ rest (hd:tl) = " " ++ showPair hd ++ sep ++
+ foldr1 (\ x y -> x ++ sep ++ y)
+ [ base_spaces ++ replicate (1 + length name + 1) ' '
+ ++ showPair p | p <- tl ]
+
+ showPair :: HtmlAttr -> String
+ showPair (tag,val) = tag ++ replicate (tagsz - length tag) ' ' ++
+ " = " ++ myShow val
+ myShow (Left n) = show n
+ myShow (Right s) = "\"" ++ s ++ "\""
+
+ tagsz = maximum (map (length.fst) attrs)
+
+------------------------------------------------------------------------------
+-- Html table related things
+
+cellHtml attr html = OT.single cellFn
+ where
+ cellFn x y = tag "td" (addX x (addY y attr)) html
+ addX 1 rest = rest
+ addX n rest = int "colspan" n : rest
+ addY 1 rest = rest
+ addY n rest = int "rowspan" n : rest
+
+above = OT.above
+(+/+) = above
+beside = OT.beside
+(+-+) = beside
+
+{-
+ - Note: Both aboves and besides presume a non-empty list.
+ -}
+
+aboves = foldl1 (+/+)
+besides = foldl1 (+-+)
+
+-- renderTable takes the HtmlTable, and renders it back into
+-- and Html object. The attributes are added to the outside
+-- table tag.
+
+renderTable attr theTable
+ = table [row [theCell x y | (theCell,(x,y)) <- theRow ]
+ | theRow <- OT.getMatrix theTable]
+ where
+ row :: [Html] -> Html
+ row = tag "tr" [] . concatHtml
+
+ table :: [Html] -> Html
+ table = tag "table" attr . concatHtml
+
+-- If you cant be bothered with the above, then you
+-- can build simple tables with this.
+-- Just provide the attributes for the whole table,
+-- attributes for the cells (same for every cell),
+-- and a list of list of cell contents,
+-- and this function will build the table for you.
+-- It does presume that all the lists are non-empty,
+-- and there is at least one list.
+--
+-- Different length lists means that the last cell
+-- gets padded. If you want more power, then
+-- use the system above.
+
+simpleTable attr cellAttr
+ = renderTable attr
+ . aboves
+ . map (besides . map (cellHtml cellAttr))
+
+
+------------------------------------------------------------------------------
hunk ./glafp-utils/nofib-analyse/OptTable.hs 1
------------------------------------------------------------------------------
--- $Id: OptTable.hs,v 1.1 1999/11/12 11:54:17 simonmar Exp $
---
--- OGI_Table : Class for combinators used in building 2D tables.
---
--- Copyright (c) 1999 Andy Gill
---
--- This module is distributed as Open Source software under the
--- Artistic License; see the file "Artistic" that is included
--- in the distribution for details.
------------------------------------------------------------------------------
-
-module OptTable (
- OptTable, -- abstract
- single,
- beside,
- above,
- getMatrix,
- ) where
-
-import qualified ClassTable as TC
-
-instance TC.Table OptTable where
- single = OptTable.single
- beside = OptTable.beside
- above = OptTable.above
- getMatrix = OptTable.getMatrix
-
-instance (Show a) => Show (OptTable a) where
- showsPrec p = TC.showsTable
-
-type TableI a = [[(a,(Int,Int))]] -> [[(a,(Int,Int))]]
-
-data OptTable a = Table (Int -> Int -> TableI a) Int Int
-
-{-
- - Perhaps one day I'll fell adventureous, and write the Show instance
- - to show boxes aka the above ascii renditions.
- -}
-
--- You can create a (1x1) table entry
-single :: a -> OptTable a
-single a = Table (\ x y z -> [(a,(x+1,y+1))] : z) 1 1
-
--- You can compose tables, horizonally and vertically
-above :: OptTable a -> OptTable a -> OptTable a
-beside :: OptTable a -> OptTable a -> OptTable a
-
-t1 `above` t2 = trans (combine (trans t1) (trans t2) (.))
-
-t1 `beside` t2 = combine t1 t2 (\ lst1 lst2 r ->
- let
- -- Note this depends on the fact that
- -- that the result has the same number
- -- of lines as the y dimention; one list
- -- per line. This is not true in general
- -- but is always true for these combinators.
- -- I should assert this!
- beside (x:xs) (y:ys) = (x ++ y) : beside xs ys
- beside (x:xs) [] = x : xs ++ r
- beside [] (y:ys) = y : ys ++ r
- beside [] [] = r
- in
- beside (lst1 []) (lst2 []))
-
--- trans flips (transposes) over the x and y axis of
--- the table. It is only used internally, and typically
--- in pairs, ie. (flip ... munge ... (un)flip).
-
-trans :: OptTable a -> OptTable a
-trans (Table f1 x1 y1) = Table (flip f1) y1 x1
-
-combine :: OptTable a
- -> OptTable b
- -> (TableI a -> TableI b -> TableI c)
- -> OptTable c
-combine (Table f1 x1 y1) (Table f2 x2 y2) comb = Table new_fn (x1+x2) max_y
- where
- max_y = max y1 y2
- new_fn x y =
- case compare y1 y2 of
- EQ -> comb (f1 0 y) (f2 x y)
- GT -> comb (f1 0 y) (f2 x (y + y1 - y2))
- LT -> comb (f1 0 (y + y2 - y1)) (f2 x y)
-
--- This is the other thing you can do with a Table;
--- turn it into a 2D list, tagged with the (x,y)
--- sizes of each cell in the table.
-
-getMatrix :: OptTable a -> [[(a,(Int,Int))]]
-getMatrix (Table r _ _) = r 0 0 []
-
+-----------------------------------------------------------------------------
+-- $Id: OptTable.hs,v 1.2 2000/07/10 16:15:34 rrt Exp $
+--
+-- OGI_Table : Class for combinators used in building 2D tables.
+--
+-- Copyright (c) 1999 Andy Gill
+--
+-- This module is distributed as Open Source software under the
+-- Artistic License; see the file "Artistic" that is included
+-- in the distribution for details.
+-----------------------------------------------------------------------------
+
+module OptTable (
+ OptTable, -- abstract
+ single,
+ beside,
+ above,
+ getMatrix,
+ ) where
+
+import qualified ClassTable as TC
+
+instance TC.Table OptTable where
+ single = OptTable.single
+ beside = OptTable.beside
+ above = OptTable.above
+ getMatrix = OptTable.getMatrix
+
+instance (Show a) => Show (OptTable a) where
+ showsPrec p = TC.showsTable
+
+type TableI a = [[(a,(Int,Int))]] -> [[(a,(Int,Int))]]
+
+data OptTable a = Table (Int -> Int -> TableI a) Int Int
+
+{-
+ - Perhaps one day I'll fell adventureous, and write the Show instance
+ - to show boxes aka the above ascii renditions.
+ -}
+
+-- You can create a (1x1) table entry
+single :: a -> OptTable a
+single a = Table (\ x y z -> [(a,(x+1,y+1))] : z) 1 1
+
+-- You can compose tables, horizonally and vertically
+above :: OptTable a -> OptTable a -> OptTable a
+beside :: OptTable a -> OptTable a -> OptTable a
+
+t1 `above` t2 = trans (combine (trans t1) (trans t2) (.))
+
+t1 `beside` t2 = combine t1 t2 (\ lst1 lst2 r ->
+ let
+ -- Note this depends on the fact that
+ -- that the result has the same number
+ -- of lines as the y dimention; one list
+ -- per line. This is not true in general
+ -- but is always true for these combinators.
+ -- I should assert this!
+ beside (x:xs) (y:ys) = (x ++ y) : beside xs ys
+ beside (x:xs) [] = x : xs ++ r
+ beside [] (y:ys) = y : ys ++ r
+ beside [] [] = r
+ in
+ beside (lst1 []) (lst2 []))
+
+-- trans flips (transposes) over the x and y axis of
+-- the table. It is only used internally, and typically
+-- in pairs, ie. (flip ... munge ... (un)flip).
+
+trans :: OptTable a -> OptTable a
+trans (Table f1 x1 y1) = Table (flip f1) y1 x1
+
+combine :: OptTable a
+ -> OptTable b
+ -> (TableI a -> TableI b -> TableI c)
+ -> OptTable c
+combine (Table f1 x1 y1) (Table f2 x2 y2) comb = Table new_fn (x1+x2) max_y
+ where
+ max_y = max y1 y2
+ new_fn x y =
+ case compare y1 y2 of
+ EQ -> comb (f1 0 y) (f2 x y)
+ GT -> comb (f1 0 y) (f2 x (y + y1 - y2))
+ LT -> comb (f1 0 (y + y2 - y1)) (f2 x y)
+
+-- This is the other thing you can do with a Table;
+-- turn it into a 2D list, tagged with the (x,y)
+-- sizes of each cell in the table.
+
+getMatrix :: OptTable a -> [[(a,(Int,Int))]]
+getMatrix (Table r _ _) = r 0 0 []
+
}