ANNOUNCE: GHC version 6.2

2003-12-16 Thread Simon Marlow

   
The (Interactive) Glasgow Haskell Compiler -- version 6.2
   

We are pleased to announce a new major release of the Glasgow Haskell
Compiler (GHC), version 6.2.

Highlights include:

  * Arrows syntax

  * New pragma: UNPACK for selectively unpacking strict constructor
fields.

  * New option -e for giving an expression to evaluate on the
command-line.

  * Portability improvements.  GHC has been ported to a few new
platforms.

  * Removal of obsolete features: _ccall_, _casm_, ``...''.

  * Many bugs fixed

See the release notes for a full list of the changes:

   http://www.haskell.org/ghc/docs/latest/html/users_guide/release-6.2.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/

We supply binary builds in the native package format for various
flavours of Linux and BSD, and in Windows Installer (MSI) form
for Windows folks.  Binary builds for other platforms are available
as a .tar.gz which can be installed wherever you want.  The source
distribution is also available from the same place.

Packages will appear as they are built - if the package for your
system isn't available yet, please try again later.

Background
~~
Haskell is a standard lazy functional programming language; the
current language version is Haskell 98, agreed in December 1998 and
revised December 2002.

GHC is a state-of-the-art programming suite for Haskell.  Included is
an optimising compiler generating good code for a variety of
platforms, together with an interactive system for convenient, quick
development.  The distribution includes space and time profiling
facilities, a large collection of libraries, and support for various
language extensions, including concurrency, exceptions, and foreign
language interfaces (C, whatever).  GHC is distributed under a
BSD-style open source license.

A wide variety of Haskell related resources (tutorials, libraries,
specifications, documentation, compilers, interpreters, references,
contact information, links to research groups) are available from the
Haskell home page (see below).


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



System requirements
~~~
To compile programs with GHC, you need a machine with 64+MB memory, GCC
and perl. This release is known to work on the following platforms:

  * i386-unknown-{linux,*bsd,mingw32}
  * sparc-sun-solaris2
  * alpha-dec-osf3
  * powerpc-apple-darwin (MacOS/X)

Ports to the following platforms should be relatively easy (for a
wunderhacker), but haven't been tested due to lack of time/hardware:

  * hppa1.1-hp-hpux{9,10}
  * i386-unknown-solaris2
  * mips-sgi-irix{5,6}
  * {rs6000,powerpc}-ibm-aix

The builder's guide on the web site gives a complete run-down of what
ports work; it can be found at

   http://www.haskell.org/ghc/docs/latest/html/building/building-guide.html


Mailing lists
~
We run mailing lists for GHC users and bug reports; to subscribe, use
the web interfaces at

http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

There are several other haskell and ghc-related mailing lists on
www.haskell.org; for the full list, see

http://www.haskell.org/mailman/listinfo/

Please report bugs using our SourceForge page at

http://sourceforge.net/projects/ghc/

or send them to [EMAIL PROTECTED]

GHC users hang out on [EMAIL PROTECTED]  Bleeding
edge CVS users party on [EMAIL PROTECTED]

___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Annotating Expressions

2003-12-16 Thread John Meacham
Imagine I have a data structure like so:

data E = EAp E E | ELam Int E | ELetRec [(Int,E)] E | EVar Int

now, I want to annotate every occurence of E with some pass specific
information, such as free variables or levels for lambda lifting.

in [PEY91] this technique was used:

data EAn a = EaAp (a,EAn a) (a,EAn a) | EaLam Int (a,EAn a) | 
EaLetRec [(Int,(a,EAn a))] (a,EAn a) | EaVar Int

however this suffered from two problems, 
1. EAn () is not computationally identical to E, since it has an extra indirection
2. it is anoying to work with EAn () when we don't want to use the extra info,
meaning we keep both E and EAn around, despite them being very similar

using an idea inspired by [SHEARD01] I came up with the following

newtype Id a = Id a

type Er f = f (E f)  -- E used recursivly
data E f = EAp (Er f) (Er f) | ELam Int (Er f) | 
ELetRec [(Int,Er f)] (Er f) | EVar Int


now, this solves problem 1. (E Id) is computationally identical to the
original E, however problem 2 persists. If I don't want to be constantly
casting to and from Id, I have to use both the seperate annotated and
unannotated versions.

is this actually the case? is there a better solution I don't see? perhaps
something using crazy GHC extensions? if not, are there any proposed
extensions which would solve this promlem?

if there were some limited way to partially apply a type declaration that
would solve the problem, but raise others.

perhaps a 'nullary' type constructor, as in
type Id = 
or just type Id
so Id is of kind (* -> *) and expands to nothing.
then in (E Id) it is fully applied...  

any other ideas? perhaps some that work :)
John

[PEY91] http://research.microsoft.com/~simonpj/papers/fully-lazy-lambda-lifter.ps.gz
[SHEARD01]  http://www.cse.ogi.edu/~sheard/papers/generic.ps
  


-- 
---
John Meacham - California Institute of Technology, Alum. - [EMAIL PROTECTED]
---
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Re: Annotating Expressions

2003-12-16 Thread Fergus Henderson
On 16-Dec-2003, John Meacham <[EMAIL PROTECTED]> wrote:
> newtype Id a = Id a
> 
> type Er f = f (E f)  -- E used recursivly
> data E f = EAp (Er f) (Er f) | ELam Int (Er f) | 
> ELetRec [(Int,Er f)] (Er f) | EVar Int
> 
> [...] problem 2 persists. If I don't want to be constantly
> casting to and from Id, I have to use both the seperate annotated and
> unannotated versions.
> 
> is this actually the case? is there a better solution I don't see? perhaps
> something using crazy GHC extensions? if not, are there any proposed
> extensions which would solve this promlem?

I think views 
would solve this problem, wouldn't they?

You could define a view of `E Id' with constructors
that skip over the conversions to/from Id

view EId of E Id = App (E Id) (E Id) | Lam Int (E Id) |
LetRec [(Int,E Id)] (E Id) | Var Int
   where
eid (EAp (Id x) (Id y)) = Ap x y
eid (ELam x (Id y)) = Lam x y
eid (ELetRec (B bindings) (Id e)) = LetRec bindings' e
   where bindings' = map (\(v,(Id x))->(v,x)) bindings
eid (EVar v) = Var v

Then you can traverse expressions without needing to write
any explicit conversions to/from Id, e.g.

-- "occurs v e" returns True iff v occurs somewhere in e
occurs :: Int -> (E Id) -> Bool
occurs v (Lam v1 e) = v == v1 || occurs v e
occurs v (Ap x y) = occurs v x || occurs v y
occurs v (LetRec bindings e) =
any (\(vi,ei)->v==vi || occurs v ei) bindings || occurs v e
occurs v (Var v1) = v == v1

-- 
Fergus Henderson <[EMAIL PROTECTED]>  |  "I have always known that the pursuit
The University of Melbourne |  of excellence is a lethal habit"
WWW:   | -- the last words of T. S. Garp.
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Re: Annotating Expressions

2003-12-16 Thread ajb
G'day all.

Quoting John Meacham <[EMAIL PROTECTED]>:

> Imagine I have a data structure like so:
>
> data E = EAp E E | ELam Int E | ELetRec [(Int,E)] E | EVar Int
>
> now, I want to annotate every occurence of E with some pass specific
> information, such as free variables or levels for lambda lifting.

http://haskell.org/hawiki/DecoratingStructures
http://haskell.org/hawiki/IndirectComposite

Cheers,
Andrew Bromage
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Re: Annotating Expressions

2003-12-16 Thread Fergus Henderson
On 16-Dec-2003, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> G'day all.
> 
> Quoting John Meacham <[EMAIL PROTECTED]>:
> 
> > Imagine I have a data structure like so:
> >
> > data E = EAp E E | ELam Int E | ELetRec [(Int,E)] E | EVar Int
> >
> > now, I want to annotate every occurence of E with some pass specific
> > information, such as free variables or levels for lambda lifting.
> 
> http://haskell.org/hawiki/DecoratingStructures
> http://haskell.org/hawiki/IndirectComposite

Unless I missed something, none of those solve all the problems that
Meacham is trying to solve (numbers 1 and 2 in his original mail).

-- 
Fergus Henderson <[EMAIL PROTECTED]>  |  "I have always known that the pursuit
The University of Melbourne |  of excellence is a lethal habit"
WWW:   | -- the last words of T. S. Garp.
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Re: Annotating Expressions

2003-12-16 Thread ajb
G'day all.

Quoting Fergus Henderson <[EMAIL PROTECTED]>:

> Unless I missed something, none of those solve all the problems that
> Meacham is trying to solve (numbers 1 and 2 in his original mail).

Many of them solve problem number 1, in that an unannotated structure
is computationally identical to the original data structure.

They don't solve problem number 2, that's true, but problem number 2
is largely a matter of taste.

Having said that, have you considered Template Haskell?  I'm not very
familiar with it, but should, in theory, be possible not only to generate
multiple type declarations from the one specification (e.g. one undecorated
type, one decorated with unboxed decorations and another with boxed
decorations), but also generate code which traverses each version uniformly,
ignoring decorations if they're not needed.

However, you may find this even more annoying than casting and uncasting
the newtype.

Cheers,
Andrew Bromage
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell