Re: Existential types

1992-03-20 Thread N . Perry

The Hope+C existential type is not unsound. With some help from Evan I
decoded your Haskell example, please excuse the reply being in Hope+C
:-)

Heterogenous list of windows in Hope+C (examples here are actually
Massey Hope+C, Hope+C is a moving target - but the type system is as
in Hope+C).

data Win == Win(alpha); ! useless, but is only an example !
type WinList == list(Win);

Index function:

let index : WinList # int - Win == fun
   (nil, _) = error(...)
|  (h::_, 1) = h
|  (_::t, n) = index(t, n-1)
end;

so the two applications:

Index(wl, 1)  Index(wl, 2)

have the same type, but that is correct as the existential types
havn't been unpacked. However:

let same : Win # Win - truval == fun
   (Win(a), Win(b)) = a == b
end;

is INCORRECT as the type of a  b are DIFFERENT - each seperate unpack
introduces a new unique type constant. The removal of Mitchell
restriction on the "escaping" of unpackaged values is fine; as each
one has a DIFFERENT unique type.

[Note: Hope+C is not totally sound - but this is not due to the type
system itself but rather to the existance of the unsafe (and
untypeable) polymorphic equality function (alpha # alpha - truval).
As in many (most?)  functional languages this function is a bit-level
compare... you can apply it to functions... infinite objects and get
true... It should really be removed, but everybody likes it! The
auto-generation of equality functions as in Haskell solves some of the
problems (type unsoundnes) and not others (equality of user-defined
abstract data types where structural equality is not correct), but is
a step in the right direction.]

Cheers,
Nigel
---
Dr Nigel PerryEmail: [EMAIL PROTECTED]
Department of Computer ScienceTel: +64 6 356 9099 ext 8900
Massey University Fax: +64 6 350 5611
Palmerston North
New Zealand




Haskell report 1.2 now available

1992-03-20 Thread john peterson

  Announcing
  ==

  The Haskell Report
Version  1.2
1 March 1992


The Haskell Committee, formed in September 1987 to design a "common"
non-strict purely functional language, has released an updated version
of the Haskell Report.

Version 1.2 of the report was prepared for publication in SIGPLAN
Notices in the May 1992 issue.  It corrects some typographical errors in
the 1.1 report, and clarifies the presentation in places, sometimes
by giving new examples.  A few small changes have also been made
to the syntax and standard prelude.

In addition to the new report, a Haskell tutorial by Paul Hudak and Joe
Fasel is also now available.  This will also be published in SIGPLAN
Notices as a companion to the report.

---

Both the new report and the tutorial are available via anonymous
internet ftp.  Three Haskell ftp sites have been established:

nebula.cs.yale.edu (128.36.13.1)
ftp.dcs.glasgow.ac.uk  (130.209.240.50)
animal.cs.chalmers.se  (129.16.225.66)

Each of these sites has an area devoted to Haskell-related material in
pub/haskell.  The file pub/haskell/FILES_ORG contains a complete list
of the available material.  The report can be found in:

pub/haskell/report/report-1.2.dvi.Z  -- A compressed dvi file
pub/haskell/report/report-1.2.ps.Z   -- A compressed postscript file

The tutorial can be found in:

pub/haskell/tutorial/tutorial.ps.Z   -- A compressed postscript file
(No dvi version available)

An online supplement to the tutorial for users of Yale haskell is also
available -- look in pub/haskell/tutorial/README for more information.

These sites also contain current Haskell implementations, papers related
to Haskell, the Gofer system, and archives of the Haskell mailing list.

---

The report is also available from Yale as a technical report; however, we
recomend waiting for the SIGPLAN publication instead.  To get a
hardcopy version of the report, send $10 to:

The Haskell Project
Department of Computer Science
Yale University
Box 2158 Yale Station
New Haven, CT 06520 USA

---

A mailing list for general discussions about Haskell is reachable in
one of two ways:

[EMAIL PROTECTED]  or  [EMAIL PROTECTED]

To be added to the above mailing list, send mail to either
[EMAIL PROTECTED] or [EMAIL PROTECTED],
whichever is the nearer site to you.  Please do not post
administrative requests direct to the mailing list.  To inquire about
implementation status, send mail to one of the addresses mentioned in
the preface of the report.