Subject: CALL FOR PAPERS -- JOURNAL OF FUNCTIONAL PROGRAMMING
CALL FOR PAPERS
SPECIAL ISSUE
JOURNAL OF FUNCTIONAL PROGRAMMING:
DEPENDENT TYPE THEORY MEETS PROGRAMMING PRACTICE
Modern programming languages rely on advanced type systems that detect
errors at compile-time. While the benefits of type systems have long been
recognized, there are some areas where the standard systems in programming
languages are not expressive enough. Language designers usually trade
expressiveness for decidability of the type system. Some interesting
programs will always be rejected (despite their semantical soundness) or
be assigned uninformative types.
There are several remedies to this situation. Dependent type systems,
which allow the formation of types that explicitly depend on other types
or values, are one of the most promising approaches. These systems are
well-investigated from a theoretical point of view by logicians and type
theorists. For example, dependent types are used in proof assistants to
implement various logics and there are sophisticated proof editors for
developing programs in a dependently typed language.
To the present day, the impact of these developments on practical
programming has been small, partially because of the level of
sophistication of these systems and of their type checkers. Only recently,
there have been efforts to integrate dependent systems into intermediate
languages in compilers and programming languages. Additional uses have
been identified in high-profile applications such as mobile code security,
where terms of a dependently typed lambda calculus to encode safety
proofs.
A special issue of the Journal of Functional Programming will be devoted
to the interplay between dependent type theory and programming practice.
We welcome technical contributions in the field, as well as position
papers that:
- make researchers in programming languages aware of new developments
and research directions on the theory side;
- point out to theorists practical uses of advanced type systems and
urge them to address theoretical problems arising in emerging
applications.
Authors who are concerned about the appropriateness of a topic are welcome
to contact the guest editors. Manuscripts should be unpublished works and
not submitted elsewhere. Revised and enhanced versions of papers published
in conference proceedings that have not appeared in archival journals are
eligible for submission. All submissions will be reviewed according to the
usual standards of scholarship and originality.
Submissions should be sent to Gilles Barthe (Gilles.Barthe@inria.fr), with
a copy to Nasreen Ahmad (nasreen@dcs.gla.ac.uk). Submitted articles should
be sent in postscript format preferably gzipped and uuencoded. In
addition, please send, as plain text, title, abstract, and contact
information.
The submission deadline is December 1st, 2001.
Guest Editors:
o Gilles Barthe, INRIA Sophia-Antipolis, France
o Peter Dybjer, Chalmers Tekniska Högskola, Sweden
o Peter Thiemann, Universität Freiburg, Germany
From rrt@dcs.gla.ac.uk Wed Mar 7 13:04:59 2001
Date: Wed, 7 Mar 2001 13:04:59 +0000 (GMT)
From: Reuben Thomas rrt@dcs.gla.ac.uk
Subject: GHC - Cygwin Installation and also DirectX (fwd)
Sigbjorn says:
Link with -mwindows (if going via gcc to get at
the linker.) i.e., if using the std hello.lhs app
ghc -o hello hello.lhs -static -package win32 -optl-mwindows
that'll get you a non-console app with mingw. Think
it'll do the trick with cygwin too.
From N.Perry@massey.ac.nz Wed Mar 7 19:20:03 2001
Date: Thu, 8 Mar 2001 08:20:03 +1300
From: Nigel Perry N.Perry@massey.ac.nz
Subject: GHC - Cygwin Installation and also DirectX
At 9:52 am +0000 7/3/01, Reuben Thomas wrote:
>(Even more confusing is that our advice has changed recently, and used to be
>much more similar to Nigel's...)
I have compiled up to 4.08.1 (or .2 not sure offhand), if Reuben's
advice has changed for later versions then follow them in preference
to my experience.
As to sed failing - it first happened on a PC in the room next to
Ruben's where I was visiting at the time... But these little things
are easy to forget in the huge job of compiling GHC - I keep
forgetting and wonder why it has broken!
Cheers,
Nigel
From miketh@brisbane.paradigmgeo.com Thu Mar 8 07:27:09 2001
Date: Thu, 8 Mar 2001 17:27:09 +1000
From: Mike Thomas miketh@brisbane.paradigmgeo.com
Subject: GHC - Cygwin Installation and also DirectX (fwd)
Many thanks Reuben and Sigbjorn
> Sigbjorn says:
>
> Link with -mwindows (if going via gcc to get at
> the linker.) i.e., if using the std hello.lhs app
>
> ghc -o hello hello.lhs -static -package win32 -optl-mwindows
>
> that'll get you a non-console app with mingw. Think
> it'll do the trick with cygwin too.
The exe is 4270K, but I can live with that.
Cheers
Mike Thomas
From rrt@dcs.gla.ac.uk Thu Mar 8 08:46:28 2001
Date: Thu, 8 Mar 2001 08:46:28 +0000 (GMT)
From: Reuben Thomas rrt@dcs.gla.ac.uk
Subject: GHC - Cygwin Installation and also DirectX (fwd)
> The exe is 4270K, but I can live with that.
Even stripped? (Unfortunately GHC does give you big EXEs, and fundamentally
will until we get dynamic linking working again; however, I think I might b=
e
able to improve things drastically even before then by re-enabling object
splitting for the libraries under Windows.)
--=20
http://sc3d.org/rrt/
L'art des vers est de transformer en beaut=E9s les faiblesses (Aragon)
From i1083924@petra.euitio.uniovi.es Thu Mar 8 12:08:26 2001
Date: Thu, 08 Mar 2001 13:08:26 +0100 (CET)
From: =?iso-8859-9?Q?Alba_Marina_Lopez_Arg=FCelles?= i1083924@petra.euitio.uniovi.es
Subject: Just one question
Hi! I'm a Spanish student who is 'trying' to do her final proyect
using Haskell; I don't want to bore you explaining what's the work
about but it has to do with internet and all that.Well,currently I'm just
trying to do a little code using sockets that (giving it an url) connects
to a remote machine and gets information from it.
I've checked a library called LibWWW,and I want to do something similar
to that, but in a lower level and that's why I'm using another library
called SocketPrim.
I've managed to get a socket,to connect it but I cannot managed it to
read.
And now here are the questions:
- There's a function in the library Socket called connectTo and I would
like to know how does it work 'from the inside'.
- I also would like to know what does the function readSocket (from
SocketPrim) return.
- If you know some site where I may get information related with
Haskell about TCP/IP,sockets and all that stuff,I would be very pleased if
you send it to me.
Well,that's all for now.I hope you can resolve my questions to keep
on with the proyect.Thank you very much!
Alba ;)
From simonmar@microsoft.com Thu Mar 8 17:26:57 2001
Date: Thu, 8 Mar 2001 09:26:57 -0800
From: Simon Marlow simonmar@microsoft.com
Subject: Just one question
Alba Marina Lopez Arguelles writes:
> - There's a function in the library Socket called connectTo
> and I would
> like to know how does it work 'from the inside'.
connectTo is in the Socket library, and it is implemented in terms of
the lower level primitives from SocketPrim. It takes a hostname and
port, and returns a normal Haskell Handle, on which you can use hGetLine
and hPutStr as you would with a file or pipe. This is easiest way to
open up a connection to a server and communicate with it.
> - I also would like to know what does the function readSocket (from
> SocketPrim) return.
I don't recommend using readSocket. Using the normal Haskell I/O
functions with a socket Handle should be enough.
Cheers,
Simon
From miketh@brisbane.paradigmgeo.com Thu Mar 8 21:32:40 2001
Date: Fri, 9 Mar 2001 07:32:40 +1000
From: Mike Thomas miketh@brisbane.paradigmgeo.com
Subject: GHC - Cygwin Installation and also DirectX (fwd)
> > The exe is 4270K, but I can live with that.
>
> Even stripped?
Woops, sorry. That make it 1869K - a substantial improvement!
> (Unfortunately GHC does give you big EXEs, and
> fundamentally
> will until we get dynamic linking working again; however, I think
> I might be
> able to improve things drastically even before then by re-enabling object
> splitting for the libraries under Windows.)
Thanks. Even without this GHC now stands up very well from my perspective.
I no longer have an excuse for procrastination!
Cheers
Mike Thomas.
From gmu@hotmail.com Fri Mar 9 00:43:40 2001
Date: Fri, 09 Mar 2001 00:43:40
From: G Murali gmu@hotmail.com
Subject: newbie
hi there,
I'm new to this monads stuff.. can you tell me what it is simply ?
an example would be highly appreciated.. i want it is very very simple terms
please..
help please!
gmu
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
From Tom.Pledger@peace.com Fri Mar 9 00:53:00 2001
Date: Fri, 9 Mar 2001 13:53:00 +1300
From: Tom Pledger Tom.Pledger@peace.com
Subject: newbie
G Murali writes:
| hi there,
|
| I'm new to this monads stuff.. can you tell me what it is simply ?
| an example would be highly appreciated.. i want it is very very
| simple terms please..
|
| help please!
There are some introductions to monads in the "Books and Tutorials
about Programming in Haskell" section of the haskell.org website.
From franka@cs.uu.nl Fri Mar 9 14:56:02 2001
Date: Fri, 9 Mar 2001 15:56:02 +0100
From: Frank Atanassow franka@cs.uu.nl
Subject: newbie
G Murali wrote (on 09-03-01 00:43 +0000):
> I'm new to this monads stuff.. can you tell me what it is simply ?
> an example would be highly appreciated.. i want it is very very simple terms
> please..
A monad on category C is a monoid in the category of endofunctors on C.
Is that simple enough? ;)
No? Then see "Using Monads" at http://haskell.org/bookshelf/
(Sorry, I just couldn't resist!)
--
Frank Atanassow, Information & Computing Sciences, Utrecht University
Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands
Tel +31 (030) 253-3261 Fax +31 (030) 251-379
From thiemann@informatik.uni-freiburg.de Fri Mar 9 14:45:24 2001
Date: Fri, 9 Mar 2001 15:45:24 +0100 (CET)
From: Peter Thiemann thiemann@informatik.uni-freiburg.de
Subject: PEPM'02, Preliminary Call for Papers
PRELIMINARY CALL FOR PAPERS
2002 ACM SIGPLAN Workshop on
Partial Evaluation and Semantics-Based Program Manipulation (PEPM'02)
Portland, Oregon, USA, January 14-15, 2002
(preceding POPL'02)
http://www.informatik.uni-freiburg.de/~thiemann/pepm02
Submission deadline: October, 2001
The PEPM'02 workshop will bring together researchers working in the
areas of semantics-based program manipulation, partial evaluation, and
program generation. The workshop focuses on techniques, supporting
theory, and applications of the analysis and manipulation of programs.
Technical topics include, but are not limited to:
* Program manipulation techniques: transformation, specialization,
normalization, reflection, rewriting, run-time code generation,
multi-level programming.
* Program analysis techniques: abstract interpretation, static
analysis, binding-time analysis, attribute grammars, constraints.
* Related issues in language design and models of computation:
imperative, functional, logical, object-oriented, parallel,
distributed, mobile, secure, domain-specific.
* Programs as data objects: staging, meta-programming, incremental
computation, mobility, tools and techniques, prototyping and
debugging.
* Applications: systems programming, scientific computing,
algorithmics, graphics, security checking, simulation, compiler
generation, compiler optimization, decompilation.
* Assessment: applicability of program manipulation techniques to
particular architectures and language paradigms, scalability,
benchmarking, portability.
Original results that bear on these and related topics are solicited.
Papers investigating novel uses and applications of program
manipulation in the broadest sense are especially encouraged. Authors
concerned about the appropriateness of a topic are welcome to consult
with the program chair prior to submission.
SUBMISSION INFORMATION
Papers should be submitted electronically via the workshop's Web
page. Exceptionally, submissions may be emailed to the program
chair: <URL:mailto:thiemann@informatik.uni-freiburg.de>. Acceptable
formats are PostScript or PDF, viewable by gv.
Submissions should not exceed 5000 words, excluding bibliography and
figures. Excessively long submissions may be rejected outright.
Submitted papers will be judged on the basis of significance,
relevance, correctness, originality, and clarity. They should include
a clear identification of what has been accomplished and why it is
significant. They must describe work that has not previously been
published in a major forum. Authors must indicate if a closely
related paper is also being considered for another conference or
journal.
Proceedings will be published as a technical report at the University
of Freiburg. A special issue of the journal "Higher-Order and
Symbolic Computation" <URL:http://www.wkap.nl/journals/lasc> is
planned afterwards.
PROGRAM COMMITTEE
Maria Alpuente (Unversity of Valencia, Spain)
Evelyn Duesterwald (Hewlett-Packard Labs, USA)
Robert Glueck (DIKU, Denmark)
Michael Hanus (Christian-Albrecht-University of Kiel, Germany)
Zhenjiang Hu (University of Tokyo, Japan)
John Hughes (Chalmers Technical University, Sweden)
Mark Jones (OGI, USA)
Siau-Cheng Khoo (NUS, Singapore)
Jakob Rehof (Microsoft Research, USA)
Joao Saraiva (University of Minho, Portugal)
Ulrik Schultz (University of Aarhus, Denmark)
Peter Thiemann (University of Freiburg, Germany, chair)
David Walker (CMU, USA)
From ess_lli@cc.helsinki.fi Fri Mar 9 14:21:06 2001
Date: Fri, 9 Mar 2001 16:21:06 +0200 (EET)
From: Ahti Pietarinen ess_lli@cc.helsinki.fi
Subject: FG/MOL 2001 Second CFP
***********************************************************************
[apologies if you receive this more than once]
FGMOL'01 FGMOL'01 FGMOL'01 FGMOL'01 FGMOL'01 FGMOL'01 FGMOL'01 FGMOL'01
FORMAL GRAMMAR/MATHEMATICS OF LANGUAGE CONFERENCE
August 10--12, 2001
Helsinki, Finland
SECOND CALL FOR PAPERS
We are pleased to announce the joint meeting of two conferences:
the sixth conferene on Formal Grammar and the seventh on the
Mathematics of Language. The joint meeting will be held just prior
to the European Summer School in Logic, Language, and Information.
AIMS and SCOPE
FGMOL'01 provides a forum for the presentation of new and original
research on formal grammar and mathematical aspects of language,
especially with regard to the application of formal methods to natural
language analysis.
Themes of interest include, but are not limited to,
* formal and computational syntax, semantics, pragmatics, and phonology;
* model-theoretic and proof-theoretic methods in linguistics;
* constraint-based and resource-sensitive approaches to grammar;
* foundational, methodological and architectural issues in grammar.
* mathematical properties of linguistic frameworks
* theories and models of natural language processing and generation
* parsing theory
* statistical and quantitative models of language
SPECIAL SESSION on MODEL-THEORETIC SYNTAX
There will be a special session of invited papers on model-theoretic
syntax. The speakers will be Geoffrey K. Pullum (keynote),
Patrick Blackburn, James Rogers, and Uwe Moennich.
ADDITIONAL INVITED SPEAKERS to be announced.
SUBMISSION DETAILS
We invite E-MAIL submissions of abstracts for 30-minute papers (including
questions, comments, and discussion).
A submission should consist of two parts:
- an information sheet (in ascii), containing the name of the author(s),
affiliation(s), e-mail and postal address(es) and a title;
- an abstract, consisting of a description of not more than 5 pages
(including figures and references). Abstracts may be either in plain
ASCII or in (unix-compatible encoded) postscript, PDF, or DVI.
Abstracts can be sent to
fgmol@cs.indiana.edu
ABSTRACT SUBMISSION DEADLINE
April 1, 2001
NOTIFICATION OF ACCEPTANCE
May 15, 2001
PROCEEDINGS
A full version of each accepted paper will be included in the conference
proceedings, to be distributed at the conference. Full papers are due
June 30, 2001.
PROGRAMME COMMITTEE
Anne Abeill'e (Paris)
Patrick Blackburn (INRIA)
Gosse Bouma (Groningen)
Mary Dalrymple (Xerox Parc)
Nissim Francez (Haifa)
Thilo Goetz (IBM)
David Johnson (IBM)
Mark Johnso (Brown)
Aravind Joshi (UPenn)
Gerhard J"ager (Utrecht)
Ruth Kempson (London)
Alain Lecomte (LORIA)
Uwe Moennich (T"ubingen)
Glyn Morrill (U.P. Catalunya)
Michael Moortgat (Utrecht)
Owen Rambo (Cogentex)
James Rogers (Earlham)
Giorgio Satta (Padova)
Mark Steedman (Edinburgh)
FURTHER INFORMATION
Web site for ESSLLI XIII: http://www.helsinki.fi/esslli/
Web site for FGMOL'01 :http://www.cis.upenn.edu/~ircs/mol/mol7.html
The organizers:
Geert-Jan Kruijff gj@cogsci.ed.ac.uk
Larry Moss lsm@cs.indiana.edu
Dick Oehrle oehrle@linc.cis.upenn.edu
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%[LaTeX2E Source File]%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}
\usepackage{tabularx}
\setlength{\textwidth}{7in}
\setlength{\oddsidemargin}{-.5in}
\setlength{\topmargin}{-36pt}
\pagestyle{empty}
\begin{document}
\begin{center}
{\em Please Post}\\[.1cm]
{\large{\bf Formal Grammar / Mathematics of Language Conference ---
FGMOL'01\\
CALL FOR PAPERS}}\\
{August 10--12, 2001}\qquad Helsinki\\
\end{center}
\begin{center}
\begin{tabular}{@{}p{.27\textwidth}|p{.70\textwidth}@{}}
%\small\ixpt\setlength{\baselineskip}{9pt}
\footnotesize
\begin{flushleft}
{\bf Programme Committee}
\end{flushleft}
\begin{tabular}{l@{}}
Anne Abeill\'{e} (Paris) \\
Patrick Blackburn (INRIA) \\
Gosse Bouma (Groningen) \\
Mary Dalrymple (Xerox Parc) \\
Nissim Francez (Haifa)\\
Thilo Goetz (IBM)\\
David Johnson (IBM) \\
Mark Johnson (Brown)\\
Aravind Joshi (UPenn)\\
Gerhard J\"{a}ger (Utrecht)\\
Ruth Kempson (London)\\
Alain Lecomte (LORIA)\\
Uwe M\"{o}nnich (T\"{u}bingen)\\
Glyn Morrill (U.P. Catalunya) \\
Michael Moortgat (Utrecht) \\
Owen Rambow (Cogentex)\\
James Rogers (Earlham) \\
Giorgio Satta (Padova) \\
Mark Steedman (Edinburgh)\\
[12pt]
{\bf Organizing Committee}\\
Geert-Jan Kruijff (Prague)\\
Larry Moss (Indiana)\\
Richard Oehrle (Ashford)
\end{tabular}
\medskip
{\bf Important Dates}
\smallskip
\begin{tabular}{l@{}}
Abstracts Due: March 31, 2001\\
Notification: May 15, 2001\\
Final Versions: June 30, 2001\\
Conference: August 10-12, 2001\\
\end{tabular}
\medskip
{\bf Addresses:\quad}
\smallskip
\begin{tabular}{l@{}}
ESSLLI XIII: \\
\texttt{http://www.helsinki.fi/esslli}\\
FGMOL'01:\\
\texttt{http://www.cis.upenn.edu/\ldots}\\
$\quad$ \texttt{\ldots $^{\sim}$ircs/mol/mol7.html}
\end{tabular}
&
\setlength{\parskip}{2pt}
We are pleased to announce the joint meeting of two conferences:
the sixth conferene on Formal Grammar and the seventh on the
Mathematics of Language. The joint meeting will be held just prior
to the European Summer School in Logic, Language, and Information.
\medskip
{\it Aims And Scope} FGMOL'01 provides a forum for the presentation of new
and
original research on formal grammar and mathematical aspects of language,
especially with regard to the application of formal methods to natural
language
analysis. Themes of interest include, but are not limited to,
\begin{itemize}
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}
\item formal and computational syntax, semantics, pragmatics, and
phonology;
\item model-theoretic and proof-theoretic methods in linguistics;
\item constraint-based and resource-sensitive approaches to grammar;
\item foundational, methodological and architectural issues in grammar.
\item mathematical properties of linguistic frameworks
\item theories and models of natural language processing and generation
\item parsing theory
\item statistical and quantitative models of language
\end{itemize}
\noindent We welcome papers from
a wide variety of frameworks.
\medskip
{\it Special session on model-theoretic syntax}
Invited speakers for this are
Geoffrey K. Pullum (keynote),
Patrick Blackburn, James Rogers, and Uwe Moennich.
\medskip
{\it Additional Invited Speakers} to be announced.
\medskip
{\it Submission Details} We invite E-MAIL submissions of abstracts
for 30-minute papers (including questions, comments, and discussion).
A submission should consist of two parts:
\begin{itemize}
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}
\item an information sheet (in ascii), containing the name of the
author(s),
affiliation(s), e-mail and postal address(es) and a title;
\item an abstract, consisting of a description of not more than 5 pages
(including figures and references). Abstracts may be either in plain
ASCII or in (unix-compatible encoded) postscript, PDF, or DVI.
\end{itemize}
\noindent Abstracts can be sent to {\tt fgmol@cs.indiana.edu} (Larry
Moss).
\medskip
{\it Abstract Submission Deadline} March 31, 2001
{\it Notification of Acceptance} May 15, 2001
{\it Proceedings} A full version of each accepted paper will be
included in the conference proceedings, to be distributed at the
conference. Full papers are due June 30, 2001.
\end{tabular}
\end{center}
\end{document}
From jans@numeric-quest.com Fri Mar 9 18:22:28 2001
Date: Fri, 9 Mar 2001 13:22:28 -0500 (EST)
From: Jan Skibinski jans@numeric-quest.com
Subject: Interesting application for RandomIOR
Well, at least interesting for me ... Thinking a bit
about modelling of a standard interpretation of a measurement
in Quantum Mechanics I came up with this tiny addendum
to module QuantumVector:
http://www.numeric-quest.com/haskell/Observation.hs
which simulates apparently random choice of an eigenvalue
and collapses the state to its corresponding eigenvector.
Jan
From gmu@hotmail.com Fri Mar 9 18:32:11 2001
Date: Fri, 09 Mar 2001 18:32:11
From: G Murali gmu@hotmail.com
Subject: list of results monad
hi,
I'm trying to build a monad that will give a list of results.
this is what i want to be able to do
I have
data M a = I [a]
instance Monad M where
return x = I [x]
I (x:xs) >>= f = ??
The type of >>= is m a -> (a -> m b) -> m b
but here the input is [a], now if I apply the input individually on f then i
can get a [m b] and if i extract at each step then I can get [b] and then if
i say return ([b]) i get m b.. right ??
Is this how I go about it .. if so can you give me a small code snippet of
how to do that.
Thanks,
gmu
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
From gmu@hotmail.com Fri Mar 9 23:15:19 2001
Date: Fri, 09 Mar 2001 23:15:19
From: G Murali gmu@hotmail.com
Subject: exception handling..
Hi,
Is it possible to do/mimic exception handling in Haskell using monads.. if
so can you throw in some pointers on this please..
gmu
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
From edrx@inx.com.br Sat Mar 10 09:54:27 2001
Date: Sat, 10 Mar 2001 06:54:27 -0300 (BRT)
From: Eduardo Ochs edrx@inx.com.br
Subject: newbie
Frank Atanassow wrote:
> G Murali wrote (on 09-03-01 00:43 +0000):
> > I'm new to this monads stuff.. can you tell me what it is simply ?
> > an example would be highly appreciated.. i want it is very very
> > simple terms please..
>
> A monad on category C is a monoid in the category of endofunctors on C.
>
> Is that simple enough? ;)
>
> No? Then see "Using Monads" at http://haskell.org/bookshelf/
>
> (Sorry, I just couldn't resist!)
Uh-oh. I'm a junior categorist and toposopher and I confess that all
my few attempts to understand what Haskell's monads have to do with
the categorical notion of a monad have failed more or less miserably.
Can someone point me to a relevant paper, or give a quick explanation?
Thanks in advance, and sorry for the dumb question,
Eduardo Ochs
http://angg.twu.net/
edrx@inx.com.br
From edrx@inx.com.br Sat Mar 10 10:08:37 2001
Date: Sat, 10 Mar 2001 07:08:37 -0300 (BRT)
From: Eduardo Ochs edrx@inx.com.br
Subject: newbie
Frank Atanassow wrote:
> G Murali wrote (on 09-03-01 00:43 +0000):
> > I'm new to this monads stuff.. can you tell me what it is simply ?
> > an example would be highly appreciated.. i want it is very very
> > simple terms please..
>
> A monad on category C is a monoid in the category of endofunctors on C.
>
> Is that simple enough? ;)
>
> No? Then see "Using Monads" at http://haskell.org/bookshelf/
>
> (Sorry, I just couldn't resist!)
Uh-oh. I'm a junior categorist and toposopher and I confess that all
my few attempts to understand what Haskell's monads have to do with
the categorical notion of a monad have failed more or less miserably.
Can someone point me to a relevant paper, or give a quick explanation?
Thanks in advance, and sorry for the dumb question,
Eduardo Ochs
http://angg.twu.net/
edrx@inx.com.br
From len@mail.wplus.net Sat Mar 10 11:48:43 2001
Date: Sat, 10 Mar 2001 14:48:43 +0300
From: Leonid Bouriakovsky len@mail.wplus.net
Subject: newbie
Perhaps, this paper will help:
http://citeseer.nj.nec.com/62964.html
>Eduardo Ochs wrote:
>
>>Frank Atanassow wrote:
>>
>> A monad on category C is a monoid in the category of endofunctors on C.
>>
>> Is that simple enough? ;)
>
>Uh-oh. I'm a junior categorist and toposopher and I confess that all
>my few attempts to understand what Haskell's monads have to do with
>the categorical notion of a monad have failed more or less miserably.
>Can someone point me to a relevant paper, or give a quick explanation?
From jenglish@flightlab.com Sat Mar 10 17:34:28 2001
Date: Sat, 10 Mar 2001 09:34:28 -0800
From: Joe English jenglish@flightlab.com
Subject: newbie
Eduardo Ochs wrote:
> Frank Atanassow wrote:
> > G Murali wrote (on 09-03-01 00:43 +0000):
> > > I'm new to this monads stuff.. can you tell me what it is simply ?
> > A monad on category C is a monoid in the category of endofunctors on C.
> > Is that simple enough? ;)
>
> Uh-oh. I'm a junior categorist and toposopher and I confess that all
> my few attempts to understand what Haskell's monads have to do with
> the categorical notion of a monad have failed more or less miserably.
> Can someone point me to a relevant paper, or give a quick explanation?
The relevant category for Haskell is the one in which
objects are types and arrows are functions. The identity
arrow for object 't' is 'id' instantiated at type 'id :: t -> t',
and composition of arrows is function composition.
Single-argument type constructors like '[]', Maybe, etc.,
map types to types (objects to objects). If equipped with a
suitable function 'fmap :: (a -> b) -> (T a -> T b)'
(i.e., taking arrows to arrows), they form a categorical
functor (specifically, an endofunctor), and can be made instances
of the Haskell Functor class.
Polymorphic functions are natural transformations: a function
'f :: forall a. F a -> G a' gives, for each object (type) 't'
an arrow from 'F t' to 'G t'.
One of the definitions of a monad is: a functor M equipped
with two natural transformations: eta : Id -> M and mu : MM -> M
(obeying certain laws). Translating this into Haskell,
this is a type constructor M along with polymorphic functions
'return :: forall a. a -> M a' and 'join :: forall a. M (M a) -> M a'
(again obeying certain laws).
The 'join' function makes intuitive sense for "container-like"
monads like List (join = concat :: [[a]] -> [a]) and Maybe
(join (Just (Just x)) = Just x ; join Just Nothing = join Nothing = Nothing).
For other monads like state transformers, parsers, and IO it's
less intuitive, so it's more common to define Haskell Monads
in terms of the "bind" operation ">>=",
(>>=) :: (M a) -> (a -> M b) -> M b
which is a close relative of the Kleisli composition operator.
Join, bind, and Kleisli composition are all interdefinable:
(>>=) :: (M a) -> (a -> M b) -> M b
join :: M (M a) -> M a
o :: (b -> M c) -> (a -> M b) -> (a -> M c)
m >>= k = join (fmap k m)
join mm = mm >>= id
f `o` g = join . fmap f . g
Wadler's "Comprehending Monads" gives a very good presentation
using the fmap/return/join formulation (called map/unit/join
in that paper). "The Essense of Functional Programming"
is another very good presentation using the return/>>=
formulation (there called "unitM/bindM"). See
<URL: http://cm.bell-labs.com/cm/cs/who/wadler/topics/monads.html >
--Joe English
jenglish@flightlab.com
From rjljr2@yahoo.com Sat Mar 10 20:20:48 2001
Date: Sat, 10 Mar 2001 12:20:48 -0800 (PST)
From: Ronald Legere rjljr2@yahoo.com
Subject: FFI tutorial??
Does anyone know of a tutorial introduction to the
FFI? How does one go about getting started with this
thing? Any simple examples? I just want to be able
to do simple things (mostly access a c library from
haskell... ok maybe not trivial :) ) I would be
happy if I could just call c programs with simple
types and pointers (no way am I going to figure out
struct alignment! ).
I have had some success with Java Native methods,
so I believe such things can be done :0
Cheers!
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/
From thorinn@diku.dk Sat Mar 10 20:35:44 2001
Date: 10 Mar 2001 20:35:44 -0000
From: Lars Henrik Mathiesen thorinn@diku.dk
Subject: newbie
> From: Joe English <jenglish@flightlab.com>
> Date: Sat, 10 Mar 2001 09:34:28 -0800
> The relevant category for Haskell is the one in which
> objects are types and arrows are functions. The identity
> arrow for object 't' is 'id' instantiated at type 'id :: t -> t',
> and composition of arrows is function composition.
>
> Single-argument type constructors like '[]', Maybe, etc.,
> map types to types (objects to objects). If equipped with a
> suitable function 'fmap :: (a -> b) -> (T a -> T b)'
> (i.e., taking arrows to arrows), they form a categorical
> functor (specifically, an endofunctor), and can be made instances
> of the Haskell Functor class.
>
> Polymorphic functions are natural transformations: a function
> 'f :: forall a. F a -> G a' gives, for each object (type) 't'
> an arrow from 'F t' to 'G t'.
>
> One of the definitions of a monad is: a functor M equipped
> with two natural transformations: eta : Id -> M and mu : MM -> M
> (obeying certain laws). Translating this into Haskell,
> this is a type constructor M along with polymorphic functions
> 'return :: forall a. a -> M a' and 'join :: forall a. M (M a) -> M a'
> (again obeying certain laws).
However, in some expositions of category theory, the usefulness of
monads is justified because they 'belong' to a certain adjunction.
In Haskell you can't express the adjunction, only the monad, which may
take a little getting used to.
But how about the related concept of an M-algebra? That is, a type T
and a function 'xi :: M T -> T' so that these laws hold:
xi . eta === id
xi . (fmap xi) === xi . mu
As it is, the List monad expresses the idea of the free monoid over a
set. A List-algebra is of course a general monoid:
e :: T
e = xi []
(#) :: T -> T -> T
(#) = \x y.xi [x y]
(And 'M a' is an M-algebra for any a, using xi = join).
And what you do every time you write 'foldl 0 +' in a program is to
give the xi of the additive monoid structure on the Num types.
Would it be useful to have functions that were polymorphic over
List-algebras? (Not that I have any idea how that might be possible to
express in Haskell).
Lars Mathiesen (U of Copenhagen CS Dep) <thorinn@diku.dk> (Humour NOT marked)
From chak@cse.unsw.edu.au Sun Mar 11 03:53:07 2001
Date: Sun, 11 Mar 2001 14:53:07 +1100
From: Manuel M. T. Chakravarty chak@cse.unsw.edu.au
Subject: FFI tutorial??
Ronald Legere <rjljr2@yahoo.com> wrote,
> Does anyone know of a tutorial introduction to the
> FFI? How does one go about getting started with this
> thing? Any simple examples?
Unfortunately, there is no tutorial style text about the FFI
yet - I agree that it is necessary to have one, but nobody
sat down and wrote one so far.
> I just want to be able
> to do simple things (mostly access a c library from
> haskell... ok maybe not trivial :) ) I would be
> happy if I could just call c programs with simple
> types and pointers (no way am I going to figure out
> struct alignment! ).
Have you had a look at the various tools that simplify
calling C code? (The do stuff like figuring out struct
alignment automatically.) There are four tools by now (in
order of increasing complexity and sophistication):
(1) hsc2hs: Comes with new versions of GHC.
(2) c2hs: http://www.cse.unsw.edu.au/~chak/haskell/c2hs/
(3) greencard: http://haskell.org/greencard/
(4) hdirect: http://haskell.org/hdirect/
You see - the Haskell developers believe in choice ;-)
Cheers,
Manuel
From khaliff@astercity.net Sun Mar 11 16:43:28 2001
Date: Sun, 11 Mar 2001 17:43:28 +0100 (CET)
From: Wojciech Moczydlowski, Jr khaliff@astercity.net
Subject: FFI tutorial??
On Sat, 10 Mar 2001, Ronald Legere wrote:
> Does anyone know of a tutorial introduction to the
> FFI? How does one go about getting started with this
> thing? Any simple examples? I just want to be able
> to do simple things (mostly access a c library from
> haskell... ok maybe not trivial :) ) I would be
> happy if I could just call c programs with simple
> types and pointers (no way am I going to figure out
> struct alignment! ).
> I have had some success with Java Native methods,
> so I believe such things can be done :0
>
> Cheers!
Try KDirect - it is relatively simple and the tutorial is present. On the
other hand, it isn't very powerful - yet it may satisfy you.
http://www.astercity.net/~khaliff/haskell/kdirect
Wojciech Moczydlowski, Jr
From uk1o@rz.uni-karlsruhe.de Mon Mar 12 01:28:11 2001
Date: Mon, 12 Mar 2001 02:28:11 +0100
From: Hannah Schroeter uk1o@rz.uni-karlsruhe.de
Subject: list of results monad
Hello!
On Fri, Mar 09, 2001 at 06:32:11PM +0000, G Murali wrote:
> hi,
> I'm trying to build a monad that will give a list of results.
> this is what i want to be able to do
> I have
> data M a = I [a]
> instance Monad M where
> return x = I [x]
> I (x:xs) >>= f = ??
> The type of >>= is m a -> (a -> m b) -> m b
> but here the input is [a], now if I apply the input individually on f then i
> can get a [m b] and if i extract at each step then I can get [b] and then if
> i say return ([b]) i get m b.. right ??
> Is this how I go about it .. if so can you give me a small code snippet of
> how to do that.
Seems you have a different take on monads than me. For me that
which you give to "return" is to be threaded to the next action,
not to some end result of the whole computation.
I *did* do a result monad once (for data compression, in fact
the monad was combined for "imperatively" consuming input as well
as "imperatively" producing output).
In principle, a result monad is a state monad where the state
is the accumulated output. An input+result monad is a state monad
where the state is a tuple of remaining input and accumulated output.
So, I'd do something like this:
data ResultM r a = RM (r -> (r,a))
instance Monad (ResultM r) where
return x = RM $ \oldResult -> (oldResult, x)
(RM m1) >>= fm2 = RM$ \oldResult ->
case m1 oldResult of
(result', a) -> case fm2 a of
RM m2 -> m2 result'
-- (>>) is defaulted!
mfail s = error s
-- if you want to have "exception handling" for mfail, you'd
-- need to have RM (r -> Either String (r,a)) above
changeResult :: (r -> r) -> RM r ()
changeResult changeFn = RM $ \oldResult -> (changeFn oldResult, ())
runResultM :: ResultM r a -> r -> (r,a)
runResultM (RM f) initRes = f initRes
-- with Lists:
runListResultM m = runResultM m []
addResult :: r -> RM [r] ()
addResult element = RM $ \oldResult -> (oldResult ++ [element], ())
-- with functions to finally yield lists (like shows)
runListFnM :: ResultM ([r] -> [r]) a -> ([r], a)
runListFnM (RM m) = case m id of
(listFn, a) -> (listFn [], a)
addFnResult :: r -> RM ([r] -> [r]) ()
addFnResult x = RM $ \oldRes -> (oldRes . (x:), ())
Usage:
someComputation = do
somehow compute x
addFnResult x
...
addFnResult y
...
return z
... runListFnM someComputation === ([x,y], z)
Kind regards,
Hannah.
From Dominic.J.Steinitz@BritishAirways.com Mon Mar 12 11:43:23 2001
Date: 12 Mar 2001 11:43:23 Z
From: Steinitz, Dominic J Dominic.J.Steinitz@BritishAirways.com
Subject: newbie
Monads in Haskell use the Kleisli triple definition which is equivalent to the two natural transformations and functor definition (with the appropriate laws) - see Algebraic Theories by Manes. When using the do notation you are effectively working in the Kleisli category generated by the monad.
Dominic.
edrx@inx.com.br on 10/03/2001 10:13:00
To: haskell
cc:
bcc: Dominic Steinitz
Subject: Re: newbie
Frank Atanassow wrote:
> G Murali wrote (on 09-03-01 00:43 +0000):
> > I'm new to this monads stuff.. can you tell me what it is simply ?
> > an example would be highly appreciated.. i want it is very very
> > simple terms please..
>
> A monad on category C is a monoid in the category of endofunctors on C.
>
> Is that simple enough? ;)
>
> No? Then see "Using Monads" at http://haskell.org/bookshelf/
>
> (Sorry, I just couldn't resist!)
Uh-oh. I'm a junior categorist and toposopher and I confess that all
my few attempts to understand what Haskell's monads have to do with
the categorical notion of a monad have failed more or less miserably.
Can someone point me to a relevant paper, or give a quick explanation?
Thanks in advance, and sorry for the dumb question,
Eduardo Ochs
http://angg.twu.net/
edrx@inx.com.br
_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell
-------------------------------------------------------------------------------------------------
21st century air travel http://www.britishairways.com
From simonpj@microsoft.com Mon Mar 12 12:44:09 2001
Date: Mon, 12 Mar 2001 04:44:09 -0800
From: Simon Peyton-Jones simonpj@microsoft.com
Subject: exception handling..
http://research.microsoft.com/~simonpj/papers/marktoberdorf.ps.gz
http://research.microsoft.com/~simonpj/Papers/except.ps.gz
http://research.microsoft.com/~simonpj/papers/asynch-exns.ps.gz
| -----Original Message-----
| From: G Murali [mailto:gmu@hotmail.com]
| Sent: 09 March 2001 23:15
| To: haskell@haskell.org
| Subject: exception handling..
|
|
| Hi,
|
| Is it possible to do/mimic exception handling in Haskell
| using monads.. if
| so can you throw in some pointers on this please..
|
| gmu
| ______________________________________________________________
| ___________
| Get Your Private, Free E-mail from MSN Hotmail at
| http://www.hotmail.com.
|
|
| _______________________________________________
| Haskell mailing list
| Haskell@haskell.org
| http://www.haskell.org/mailman/listinfo/haskell
|
From franka@cs.uu.nl Fri Mar 9 20:33:09 2001
Date: Fri, 9 Mar 2001 21:33:09 +0100
From: Frank Atanassow franka@cs.uu.nl
Subject: newbie
> On Fri, 9 Mar 2001, Frank Atanassow wrote:
> > A monad on category C is a monoid in the category of endofunctors on C.
Surprisingly, my facetious little remark about monads elicited the following
response (whose author I will not disclose, as I haven't obtained
permission yet):
Somebody wrote (on 09-03-01 15:38 +0000):
> Hi Frank --- Believe it or not your one-liner actually *is* helpful to me.
> >From dim & distant algebra days I remember the definition of monoid (set,
> binary operation, associative, left & right unit) but being a Physics
> major/Maths minor, a long time ago, I was deprived of any introduction to
> Category Theory. I've read some of the papers Haskell monads section &
> also had a look at some category theory books --- but I can't remember
> seeing your nice one-line definition --- do you have a reference to the
> paper or book(s) that do it this way?
I think the monoidal characterization is well known. I first saw it in Asperti
& Longo [1] (p.75), but I'm sure it can be found in other texts. The
connection with monoids is not very evident in Haskell, but is worth keeping
in mind if you know a bit of category theory.
BTW, part of the reason I'm posting this to the Haskell list is to plug a
little project I have started on my home page. It's a small collection of useful
reference texts which deal with programming languages and semantics, all of
which have become available on the web. [1] is among these.
<start violins for impassioned plea>
I occasionally see posts on this list from people who are not researchers or
educators (and consequently do not have ready access to such published
material) expressing some interest in exploring PL theory and other, related
formal topics further, if only the ``barrier-to-entry'' were not so
high. Indeed, there is a wealth of technical articles which are available
online, and could prove useful or at least interesting to many Haskell and ML
programmers, but even the ones directed at a relatively wide audience of PL
researchers can be hard to grasp for non-researchers. Personally, I think this
is one reason that Haskell and ML are still fairly marginalized languages. My
hope is that this list can grow into a useful resource for go-getters and
self-starters from other fields and communities, as well as the average PL
researcher.
<end violins for impassioned plea>
OK, I am only a stupid PhD student with no publications under my belt, but
anyhow that is how I felt before I became a researcher. Over the space of a
few years, while I was still hacking C++ in the dungeons of our vast corporate
megacomplex, I laid out several hundred dollars of my own money to buy enough
texts to jumpstart my own education, and what started with one book soon
exploded into a mini-library of hardbacks and articles (because you know the
dependencies in any non-trivial bibliography resemble a large bowl of sticky
spaghetti), and I would have been deliriously happy to learn that, for
example, Barendregt's encyclopaedic book on lambda-calculus was actually
readable from the web. So here's to you, my comrades-in-arms.
As it states on my page, if any of you know of any other relevant texts
which might be added to the list, please contact me and I will augment the
list forthwith.
The list is available at:
http://www.cs.uu.nl/people/franka/
and here is the reference I promised:
[1] Andrea Asperti and Giussepe Longo. Categories, Types and Structures. An
introduction to Category Theory for the working computer
scientist. MIT Press, 1991.
URL: http://www.dmi.ens.fr/users/longo/download.html
Regards,
--
Frank Atanassow, Information & Computing Sciences, Utrecht University
Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands
Tel +31 (030) 253-3261 Fax +31 (030) 251-379
From franka@cs.uu.nl Mon Mar 12 14:10:09 2001
Date: Mon, 12 Mar 2001 15:10:09 +0100
From: Frank Atanassow franka@cs.uu.nl
Subject: newbie
Frank Atanassow wrote (on 09-03-01 21:33 +0100):
> > On Fri, 9 Mar 2001, Frank Atanassow wrote:
> > > A monad on category C is a monoid in the category of endofunctors on C.
>
> Surprisingly, my facetious little remark about monads elicited the following
> response (whose author I will not disclose, as I haven't obtained
> permission yet):
So much for my attempt at discretion. Sorry, Phil. I Bcc'd the list, but maybe
my understanding of the way it works is wrong...
--
Frank Atanassow, Information & Computing Sciences, Utrecht University
Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands
Tel +31 (030) 253-3261 Fax +31 (030) 251-379
From qrczak@knm.org.pl Mon Mar 12 14:08:50 2001
Date: 12 Mar 2001 14:08:50 GMT
From: Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl
Subject: list of results monad
Mon, 12 Mar 2001 02:28:11 +0100, Hannah Schroeter <uk1o@rz.uni-karlsruhe.de> pisze:
> I *did* do a result monad once (for data compression, in fact
> the monad was combined for "imperatively" consuming input as well
> as "imperatively" producing output).
These monads are present in ghc >= 4.06, in -package lang, modules:
MonadReader
MonadWriter
MonadState
MonadRWS
The combination of state and output can be done as one of these:
WriterT w (State s)
StateT s (Writer w)
RWS () w s
where w is the type of output and must be a monoid (e.g. a list)
and s is the type of state.
> data ResultM r a = RM (r -> (r,a))
This is isomorphic to MonadState.State.
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK
From simonpj@microsoft.com Mon Mar 12 15:43:33 2001
Date: Mon, 12 Mar 2001 07:43:33 -0800
From: Simon Peyton-Jones simonpj@microsoft.com
Subject: Any in Haskell Report
Folks,
In the Haskell Report, Feliks points out:
| On pp. 5 and 120 the rule for "ANYseq" has a very strange
| structure: why the
| "{ANY}" at the beginning and end of the subtracted stuff? It
| seems it could
| be simplified, or at least explained.
I have no idea why it can't be just
ANYseq -> {ANY}_<opencomment | closecomment>
Can anyone see why this simpler form would not work?
I propose to adopt this simplification.
Simon
From franka@cs.uu.nl Mon Mar 12 16:16:29 2001
Date: Mon, 12 Mar 2001 17:16:29 +0100
From: Frank Atanassow franka@cs.uu.nl
Subject: newbie
Lars Henrik Mathiesen wrote (on 10-03-01 20:35 -0000):
> However, in some expositions of category theory, the usefulness of
> monads is justified because they 'belong' to a certain adjunction.
You can regard a monad as arising from a particular adjunction but, although
every adjunction determines a unique monad, the converse is not true. In fact,
the collection of resolutions for a monad forms a category with adjunctions as
objects and certain functors as arrows. The adjunction which gives rise to the
Kleisli category is initial in this category. The terminal object is called
the Eilenberg-Moore category and it has as objects M-algebras, like your `xi',
and as arrows M-algebra homomorphisms.
> In Haskell you can't express the adjunction, only the monad, which may
> take a little getting used to.
I've been looking at this recently to find some canonical way to express how
to `deconstruct' monadic terms (i.e., how to run them). The idea is that you
build up monadic terms in the Kleisli category, somehow describe a resolution,
then use the initiality property of the Kleisli category to map the terms to
the category of the resolution, where you can use the adjunction to
destructure them.
> But how about the related concept of an M-algebra? That is, a type T
> and a function 'xi :: M T -> T' so that these laws hold:
> xi . eta === id
> xi . (fmap xi) === xi . mu
If you reverse the sense of the last equation and regard the monad primitives
as constructors:
xi (Eta x) = x
xi (Mu m) = xi (fmap xi m)
then this starts to look like a pattern-matching definition for folding a
monad regarded as an algebra. In fact, you can express the operators this way
in Haskell if you use are willing to use a nested datatype:
data M a = Eta a | Mu (M (M a))
> Would it be useful to have functions that were polymorphic over
> List-algebras? (Not that I have any idea how that might be possible to
> express in Haskell).
I dunno if it is useful for List-algebras, but if you take your monad M as the
substitution monad generated by a term signature, then the the resolutions of
the monad can be regarded as a way of factoring M into a composition of
signatures which (I think) represent the values and redexes of the term
language. The Kleisli and E-M categories are extremal cases. In the Kleisli
category the redex functor is trivial; I think this is this is why you can use
it to pass around computations.
In the E-M category, the value functor is trivial, but I'm not sure what this
means precisely yet. For intermediate cases, you get a particular choice of
normal forms. What I'm thinking is that an M-algebra for a language M gives
you a way of extending a denotational description of the normal forms to one
for the entire language, which is automatically sound for the equational
theory.
Which sounds useful to me for writing interpreters.
--
Frank Atanassow, Information & Computing Sciences, Utrecht University
Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands
Tel +31 (030) 253-3261 Fax +31 (030) 251-379
From qrczak@knm.org.pl Mon Mar 12 16:33:53 2001
Date: 12 Mar 2001 16:33:53 GMT
From: Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl
Subject: Any in Haskell Report
Mon, 12 Mar 2001 07:43:33 -0800, Simon Peyton-Jones <simonpj@microsoft.com> pisze:
> I have no idea why it can't be just
>
> ANYseq -> {ANY}_<opencomment | closecomment>
This would mean: it's a sequence of characters which is not equal to
'{-' or '-}'. But it should mean: it's a sequence of characters which
doesn't contain '{-' or '-}'. The current definition is correct,
this one is not.
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK
From thorinn@diku.dk Tue Mar 13 00:12:02 2001
Date: 13 Mar 2001 00:12:02 -0000
From: Lars Henrik Mathiesen thorinn@diku.dk
Subject: newbie
> Date: Mon, 12 Mar 2001 17:16:29 +0100
> From: Frank Atanassow <franka@cs.uu.nl>
> Lars Henrik Mathiesen wrote (on 10-03-01 20:35 -0000):
> > However, in some expositions of category theory, the usefulness of
> > monads is justified because they 'belong' to a certain adjunction.
>
> You can regard a monad as arising from a particular adjunction but,
> although every adjunction determines a unique monad, the converse is
> not true. In fact, the collection of resolutions for a monad forms a
> category with adjunctions as objects and certain functors as arrows.
> The adjunction which gives rise to the Kleisli category is initial
> in this category. The terminal object is called the Eilenberg-Moore
> category and it has as objects M-algebras, like your `xi', and as
> arrows M-algebra homomorphisms.
Yes, I was aware of that --- I should perhaps have said that there's
typically a 'motivating' adjunction, often one involving a forgetful
functor. Which is generally different from the one into the Kleisli
category.
I read the rest of your post with great interest too, though I need to
work at it a bit before I think I understand all of it. MacLane is off
the shelf, and section IV.7 is scheduled to be worked though come the
weekend.
My own thoughts were a bit less ambitious, and I found out that
Haskell (at least hugs -98 +o) will in fact do what I had in mind:
> module Algebra () where
> class Monad m => Algebra m a where xi :: m a -> a
> instance (Num a) => Algebra [] a where
> xi = foldl (+) 0
> instance Algebra [] [a] where xi = concat
> unit :: Algebra [] a => a
> unit = xi []
> (#) :: Algebra [] a => a -> a -> a
> x # y = xi [x, y]
Prelude> :load Algebra.lhs
Reading file "Algebra.lhs":
Hugs session for:
/usr/local/share/hugs/lib/Prelude.hs
Algebra.lhs
Algebra> unit :: Int
0
Algebra> unit :: Float
0.0
Algebra> unit :: [Char]
""
Algebra> "foo" # "bar"
"foobar"
Algebra> (1::Int) # 2 # 3
6
But perhaps I'm just easily amused.
Lars Mathiesen (U of Copenhagen CS Dep) <thorinn@diku.dk> (Humour NOT marked)
From gmh@Cs.Nott.AC.UK Tue Mar 13 09:42:10 2001
Date: Tue, 13 Mar 2001 09:42:10 +0000
From: Graham Hutton gmh@Cs.Nott.AC.UK
Subject: fold and unfold
Dear all,
The following new paper may be of interest to some readers of this group:
When is a Function a Fold or an Unfold?
Jeremy Gibbons, Graham Hutton, and Thorsten Altenkirch
http://www.cs.nott.ac.uk/~gmh/when.pdf
http://www.cs.nott.ac.uk/~gmh/when.ps
We give a necessary and sufficient condition for when a set-theoretic
function can be written using the recursion operator fold, and a dual
condition for the recursion operator unfold. The conditions are
simple, practically useful, and generic in the underlying datatype.
(To appear in the Proceedings of the 4th International Workshop on
Coalgebraic Methods in Computer Science, Genova, Italy, April 2001.)
Best wishes,
Graham
+-----------------------------------------------------------------------------+
| Dr Graham Hutton Email : gmh@cs.nott.ac.uk |
| Languages and Programming Group Web : http://www.cs.nott.ac.uk/~gmh/ |
| School of Computer Science and IT |
| The University of Nottingham |
| Jubilee Campus, Wollaton Road |
| Nottingham NG8 1BB |
| United Kingdom |
+-----------------------------------------------------------------------------+
From andreas.marth@daimlerchrysler.com Tue Mar 13 14:16:00 2001
Date: Tue, 13 Mar 2001 15:16:00 +0100
From: andreas.marth@daimlerchrysler.com andreas.marth@daimlerchrysler.com
Subject: guiding strictness/lazyness through the program
Hallo!
Does anybody know of a paper that describes ways how to force strict ev=
aluation=20
at some places and lazy evaluation at others?
And I am also interested in a guideline when to use strict evaluation =
and when=20
lazy.
Any pointers appreciated!
Thanks,
Andreas
=
From nipkow@informatik.tu-muenchen.de Tue Mar 13 14:20:30 2001
Date: Tue, 13 Mar 2001 15:20:30 +0100
From: nipkow@informatik.tu-muenchen.de nipkow@informatik.tu-muenchen.de
Subject: Research Assistant/PhD Vacancy
TOOL SUPPORT FOR LOGICAL CALCULI
Research Assistant/PhD Vacancy
Technical University Munich
The theorem proving group (http://www4.in.tum.de/~kleing/group/group.html) at
the Technical University Munich is looking for a research assistant to join a
DFG-funded project focussing on the development and application of the
theorem prover Isabelle (http://isabelle.in.tum.de). The position offers
exciting opportunities for scientifically challenging research leading to a
PhD. The appointment is initially for 2 years with an optional extension.
We seek a candidate with a strong background in at least one of the following
areas
- theorem proving
- logic
- semantics of programming languages
- functional/logic programming
- specification languages
who should like to work on the boundary between theory and practice.
Depending on the candidates interests and abilities, the work can focus an
either of the following areas:
- logical calculi for the development of (object oriented) programs
- structuring mechanisms for large theories
- tool support for automated reasoning
Informal inquiries and formal applications should be addressed to
nipkow@in.tum.de (http://www.in.tum.de/~nipkow).
From theo@engr.mun.ca Tue Mar 13 19:45:31 2001
Date: Tue, 13 Mar 2001 16:15:31 -0330
From: Theodore Norvell theo@engr.mun.ca
Subject: Laws for Monad and MonadPlus.
Hi all. I was revising a short article I've written about
Monads in Haskell and started wondering about the identities
associated with Monads.
I think it is generally agreed (and in the report) that the
following identities should be true of a Monad:
Left identity: return a >>= k = k a
Right identity: p >>= return = p
Associativity: (p >>= j) >= k = p >>= (\x->(j x >>= k))
[provided x is not free in j or k]
What about MonadPlus? By analogy with semirings, I came up with:
Zero: mzero >>= k = mzero = p >>= (\x -> mzero)
Identity: p `mplus` mzero = p = mzero `mplus` p
Commutativity: p `mplus` q = q `mplus` p
Right distributivity: (p `mplus` q) >>= k = (p >>= k) `mplus` (q >>= k)
Left distributivity: p >>= (\x->j x `mplus` k x) = (p >>= j) `mplus` (p >== k)
[provided x is not free in j or k]
But commutativity does not hold for Maybe or [], left distributivity
does not hold for Maybe and right distributivity does not hold for [],
so these can't be right.
Are the other identities I've listed ok?
Are there other identities that I've missed?
Cheers,
Theodore Norvell
----------------------------
Dr. Theodore Norvell theo@engr.mun.ca
Electrical and Computer Engineering http://www.engr.mun.ca/~theo
Engineering and Applied Science Phone: (709) 737-8962
Memorial University of Newfoundland Fax: (709) 737-4042
St. John's, NF, Canada, A1B 3X5
From dpt@math.harvard.edu Tue Mar 13 20:12:06 2001
Date: Tue, 13 Mar 2001 15:12:06 -0500
From: Dylan Thurston dpt@math.harvard.edu
Subject: Laws for Monad and MonadPlus.
On Tue, Mar 13, 2001 at 04:15:31PM -0330, Theodore Norvell wrote:
> Are there other identities that I've missed?
What about associativity of mplus:
(p `mplus` q) `mplus` r = p `mplus` (q `mplus` r)
Good question!
--Dylan Thurston
From dpt@math.harvard.edu Tue Mar 13 20:13:26 2001
Date: Tue, 13 Mar 2001 15:13:26 -0500
From: Dylan Thurston dpt@math.harvard.edu
Subject: Laws for Monad and MonadPlus.
On Tue, Mar 13, 2001 at 04:15:31PM -0330, Theodore Norvell wrote:
> What about MonadPlus? By analogy with semirings, I came up with:
>
> Zero: mzero >>= k = mzero = p >>= (\x -> mzero)
> Identity: p `mplus` mzero = p = mzero `mplus` p
> Commutativity: p `mplus` q = q `mplus` p
> Right distributivity: (p `mplus` q) >>= k = (p >>= k) `mplus` (q >>= k)
> Left distributivity: p >>= (\x->j x `mplus` k x) = (p >>= j) `mplus` (p >== k)
> [provided x is not free in j or k]
>
> But commutativity does not hold for Maybe or [], left distributivity
> does not hold for Maybe and right distributivity does not hold for [],
> so these can't be right.
Incidentally, a Set monad seems to do better: it would satisfy all
these laws.
Best,
Dylan
From jans@numeric-quest.com Tue Mar 13 20:28:50 2001
Date: Tue, 13 Mar 2001 15:28:50 -0500 (EST)
From: Jan Skibinski jans@numeric-quest.com
Subject: quantum search algorithm
Directly from the oven :-):
http://www.numeric-quest.com/haskell/QuantumSearch.hs
Excerpt from a short module description is given below.
Jan
Grover's algorithm assumes that one is given a quantum function, also called
an oracle, that indicates, when confronted with any number between 0 and N-1,
whether this number is or is not the special number being sought.
The algorithm enables one to find a marked item in unstructured N-item database
in a time that scales not as N, as a classical computer would require, but only
as sqrt N.
Putting it another way: the maximum number of calls to oracle is proportional to
sqrt N. Think about a scenario when the oracle charges you per call, or
when its computations are very lengthy. The answer is probabilistic, but
given with very high degree of probability.
In our implementation the 'search' function is able to find specifically
marked number from the assemble of 8 numbers: 0..7 in just two calls to oracle,
with very high degree of probability. The 'test' performs m such searches.
Note that the final stage of the search is simulated as a quantum measurement
performed on the state vector.
From taha@cs.yale.edu Tue Mar 13 16:39:27 2001
Date: Tue, 13 Mar 2001 11:39:27 -0500
From: Walid Taha taha@cs.yale.edu
Subject: CFP: SAIG'01
CALL FOR PAPERS
Semantics, Applications and Implementation of Program Generation (SAIG'01)
PLI Workshop, September 6th, 2001. (Deadline: May 20, 2001)
http://www.cs.yale.edu/~taha/saig/cfp01.html
Program generation has the prospect of being an integral part of a
wide range of software development processes. Many recent studies
investigate different aspects of program generation systems, including
their semantics, their applications, and their implementation.
Existing theories and systems address both high-level (source)
language and low-level (machine) language generation. A number of
programming languages now supports program generation and
manipulation, with different goals, implementation techniques, and
targeted at different applications. The goal of this workshop is to
provide a meeting place for researchers and practitioners interested
in this research area, and in program generation in general.
Scope: The workshop solicits submissions related to theoretical and
practical models and tools for building program generators systems,
Examples include:
* Semantics, type systems, and implementations for multi-stage
languages.
* Run-time specialization systems: e.g. compilers, operating systems.
* High-level program generation (applications, foundations,
environments).
* Program synthesis from high-level specifications.
* Symbolic computation, linking and explicit substitution, in-lining and
macros.
Reports on applications of these techniques to real-world problems are
especially encouraged, as are submissions that relate ideas and
concepts from several of these topics, or bridge the gap between
theory and practice. The program committee is happy to advise on the
appropriateness of a particular subject.
Format: The one-day workshop will contain slots for technical papers
(30 minutes) and position papers (20 minutes. Both times include
discussion.) In addition, there will be one hour allocated for open
discussions at the end of the workshop. Proceedings will be published
as an LNCS volume.
Invited Speakers:
* Krzysztof Czarnecki, University of Ilmenau and Daimler Chrysler
* Tim Sheard, Oregon Graduate Institute of Science and Technology
* Mitch Wand, Northeastern University
Submission Details: Authors are invited to submit papers of at most
5000 words (excluding figures), in postscript format (letter or A4),
using the electronic submission form by May 20th, 2001. This deadline
is not extensible. Both position and technical papers are welcome.
Please indicate at time of submission. Position papers are expected to
describe ongoing work, future directions, and/or survey previous
results. Technical papers are expected to contain novel results. All
papers will be reviewed by the program committee for the above
mentioned criteria, in addition to correctness and clarity. Authors
will be notified of acceptance by July 17th, 2001. Final version of
the papers must be submitted by July 15th, 2001.
Program Committee:
* Gilles Barthe, INRIA * David Basin, Freiburg
* Don Batory, Texas * Robert Glück, DIKU
* Nevin Heintze, Bell-Labs * Eugenio Moggi, DISI
* Greg Morrisett, Cornell * Flemming Nielson, Aarhus
* David Sands, Chalmers * Walid Taha,Yale (PC Chair)
From taha@cs.yale.edu Tue Mar 13 16:39:27 2001
Date: Tue, 13 Mar 2001 11:39:27 -0500 (EST)
From: Walid Taha taha@cs.yale.edu
Subject: CFP: SAIG'01
CALL FOR PAPERS
Semantics, Applications and Implementation of Program Generation (SAIG'01)
PLI Workshop, September 6th, 2001. (Deadline: May 20, 2001)
http://www.cs.yale.edu/~taha/saig/cfp01.html
Program generation has the prospect of being an integral part of a
wide range of software development processes. Many recent studies
investigate different aspects of program generation systems, including
their semantics, their applications, and their implementation.
Existing theories and systems address both high-level (source)
language and low-level (machine) language generation. A number of
programming languages now supports program generation and
manipulation, with different goals, implementation techniques, and
targeted at different applications. The goal of this workshop is to
provide a meeting place for researchers and practitioners interested
in this research area, and in program generation in general.
Scope: The workshop solicits submissions related to theoretical and
practical models and tools for building program generators systems,
Examples include:
* Semantics, type systems, and implementations for multi-stage
languages.
* Run-time specialization systems: e.g. compilers, operating systems.
* High-level program generation (applications, foundations,
environments).
* Program synthesis from high-level specifications.
* Symbolic computation, linking and explicit substitution, in-lining and
macros.
Reports on applications of these techniques to real-world problems are
especially encouraged, as are submissions that relate ideas and
concepts from several of these topics, or bridge the gap between
theory and practice. The program committee is happy to advise on the
appropriateness of a particular subject.
Format: The one-day workshop will contain slots for technical papers
(30 minutes) and position papers (20 minutes. Both times include
discussion.) In addition, there will be one hour allocated for open
discussions at the end of the workshop. Proceedings will be published
as an LNCS volume.
Invited Speakers:
* Krzysztof Czarnecki, University of Ilmenau and Daimler Chrysler
* Tim Sheard, Oregon Graduate Institute of Science and Technology
* Mitch Wand, Northeastern University
Submission Details: Authors are invited to submit papers of at most
5000 words (excluding figures), in postscript format (letter or A4),
using the electronic submission form by May 20th, 2001. This deadline
is not extensible. Both position and technical papers are welcome.
Please indicate at time of submission. Position papers are expected to
describe ongoing work, future directions, and/or survey previous
results. Technical papers are expected to contain novel results. All
papers will be reviewed by the program committee for the above
mentioned criteria, in addition to correctness and clarity. Authors
will be notified of acceptance by July 17th, 2001. Final version of
the papers must be submitted by July 15th, 2001.
Program Committee:
* Gilles Barthe, INRIA * David Basin, Freiburg
* Don Batory, Texas * Robert Glück, DIKU
* Nevin Heintze, Bell-Labs * Eugenio Moggi, DISI
* Greg Morrisett, Cornell * Flemming Nielson, Aarhus
* David Sands, Chalmers * Walid Taha,Yale (PC Chair)
From ashley@semantic.org Wed Mar 14 03:36:42 2001
Date: Tue, 13 Mar 2001 19:36:42 -0800
From: Ashley Yakeley ashley@semantic.org
Subject: Contexts in Existential Types
Would it be appropriate for Haskell to be able to remember contexts in
existential types? For instance, currently this does not work in Hugs:
--
class Charable a where
obtainChar :: a -> Char
instance Charable Char where
obtainChar c = c
data AnyCharable = forall c. (Charable c) => MkAnyCharable c
anyA = MkAnyCharable 'a'
recoverA = obtainChar ((\(MkAnyCharable c) -> c) anyA)
--
I believe allowing it to work would not amount to storing dynamic type
information.
Is this an overlooked hole or would it break the spirit of the language?
--
Ashley Yakeley, Seattle WA
From ashley@semantic.org Wed Mar 14 04:21:49 2001
Date: Tue, 13 Mar 2001 20:21:49 -0800
From: Ashley Yakeley ashley@semantic.org
Subject: Contexts in Existential Types
At 2001-03-13 19:36, I wrote:
>Would it be appropriate for Haskell to be able to remember contexts in
>existential types? For instance, currently this does not work in Hugs:
>
>--
>class Charable a where
> obtainChar :: a -> Char
>
>instance Charable Char where
> obtainChar c = c
>
>data AnyCharable = forall c. (Charable c) => MkAnyCharable c
>
>anyA = MkAnyCharable 'a'
>recoverA = obtainChar ((\(MkAnyCharable c) -> c) anyA)
>--
Whoops, my error. It is possible to do this:
--
recoverA = (\(MkAnyCharable c) -> obtainChar c) anyA
--
Sorry...
--
Ashley Yakeley, Seattle WA
From fjh@cs.mu.oz.au Wed Mar 14 07:44:54 2001
Date: Wed, 14 Mar 2001 18:44:54 +1100
From: Fergus Henderson fjh@cs.mu.oz.au
Subject: Contexts in Existential Types
On 13-Mar-2001, Ashley Yakeley <ashley@semantic.org> wrote:
> Would it be appropriate for Haskell to be able to remember contexts in
> existential types?
I'm not sure exactly what you mean by that.
But your example requires existentially typed functions.
It would certainly be appropriate for Haskell to support
existentially typed functions.
> For instance, currently this does not work in Hugs:
>
> --
> class Charable a where
> obtainChar :: a -> Char
>
> instance Charable Char where
> obtainChar c = c
>
> data AnyCharable = forall c. (Charable c) => MkAnyCharable c
>
> anyA = MkAnyCharable 'a'
> recoverA = obtainChar ((\(MkAnyCharable c) -> c) anyA)
> --
You can write that kind of thing in Mercury. However, you need to use
a separate function rather than a lambda expression, since for this
to work the lambda expression has to have an existentially quantified
polymorphic type, and in Mercury (as in Haskell 98), lambda expressions
are always monomorphic.
fjh$ cat test.m
:- import_module char.
:- typeclass charable(A) where [
func obtainChar(A) = char
].
:- instance charable(char) where [
obtainChar(C) = C
].
% Note for Haskell readers:
% in Mercury the constructor name goes on the left of the `=>'
% and the type class constraints go on the right of it
:- type anyCharable ---> some [C] mkAnyCharable(C) => charable(C).
anyA = 'new mkAnyCharable'('a').
recoverA = obtainChar(x(anyA)).
x(mkAnyCharable(C)) = C.
fjh$ mmc -C --infer-all test.m
test.m:001: Warning: module should start with a `:- module' declaration.
test.m: 1: Warning: interface for module `test' does not export anything.
test.m:012: Inferred :- func anyA = (test:anyCharable).
test.m:013: Inferred :- func recoverA = character.
test.m:014: Inferred :- some [C] (func x((test:anyCharable)) = C => (test:charab
le(C))).
Note that the type inferred for `x' is an existentially quantified function
type.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
From simonpj@microsoft.com Wed Mar 14 10:10:27 2001
Date: Wed, 14 Mar 2001 02:10:27 -0800
From: Simon Peyton-Jones simonpj@microsoft.com
Subject: Contexts in Existential Types
Yes, with your modification, it works just fine in GHC, and I guess
therefore hbc. Documentatino in the user manual.
http://haskell.cs.yale.edu/ghc/
Simon
| -----Original Message-----
| From: Ashley Yakeley [mailto:ashley@semantic.org]
| Sent: 14 March 2001 04:22
| To: Haskell List
| Subject: Re: Contexts in Existential Types
|
|
| At 2001-03-13 19:36, I wrote:
|
| >Would it be appropriate for Haskell to be able to remember
| contexts in
| >existential types? For instance, currently this does not
| work in Hugs:
| >
| >--
| >class Charable a where
| > obtainChar :: a -> Char
| >
| >instance Charable Char where
| > obtainChar c = c
| >
| >data AnyCharable = forall c. (Charable c) => MkAnyCharable c
| >
| >anyA = MkAnyCharable 'a'
| >recoverA = obtainChar ((\(MkAnyCharable c) -> c) anyA)
| >--
|
| Whoops, my error. It is possible to do this:
|
| --
| recoverA = (\(MkAnyCharable c) -> obtainChar c) anyA
| --
|
| Sorry...
|
| --
| Ashley Yakeley, Seattle WA
|
|
| _______________________________________________
| Haskell mailing list
| Haskell@haskell.org
| http://www.haskell.org/mailman/listinfo/haskell
|
From ess_lli@cc.helsinki.fi Wed Mar 14 15:21:42 2001
Date: Wed, 14 Mar 2001 17:21:42 +0200 (EET)
From: Ahti Pietarinen ess_lli@cc.helsinki.fi
Subject: DEADLINE EXTENSION: Logic & Games ESSLLI'01 workshop
- Apologies for multiple copies
- Please note:
DEADLINE EXTENSION for Logic & Games ESSLLI 2001 workshop
20-24 August, Helsinki University, Finland
!!!!! New Deadline is: April 9, 2001 !!!!!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%
%% Call for Papers %%
%% %%
%% ESSLLI Workshop on Logic and Games %%
%% %%
%% %%
%% August 20-24, 2001 %%
%% Helsinki, Finland %%
%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GENERAL INFORMATION:
Games have been utilized within logic for a variety of different
purposes such as semantic evaluation games, model comparison
games, and proof games. On the other hand, logic has become
increasingly important in game theory, in particular for the
epistemic foundation of game-theoretic solution concepts. As the
TARK (http://www.tark.org) and LOFT (http://www.econ.ucdavis.edu/
faculty/bonanno/loft4.html) conferences show, interaction between
logic and game theory has become more diverse in recent years,
exploring game logics, the use of game-theory in multi-agent
systems, game-theoretic accounts of natural language phenomena,
and the role of language in defining preferences.
The workshop is part of the 13th European Summer School in Logic,
Language and Information (ESSLLI) which takes place at the
University of Helsinki from August 13 until August 24, 2001
(http://www.helsinki.fi/esslli). The workshop aims to provide a
forum for advanced Ph.D. students and other researchers from
game theory and logic to present their research on (1) game-
theoretic techniques applied to logic, and (2) logical models or
analyses of games and game-theoretic problems. We specifically
invite presentations in any of the following areas:
1) Logical analysis of games, e.g. modeling knowledge, belief,
and information flow in games; applications of epistemic and
dynamic logic to games
2) Logic games, e.g. model comparison games, semantic evaluation
games, Independence-friendly logic
3) Game logics, e.g. extensions of program logics and modal logics
to investigate the structure of games in general
4) The role of language and logical definability in games,
and connections between natural language and games generally
5) Logical approaches to multi-agent systems with a special focus
on game-theoretic aspects
SUBMISSION GUIDELINES:
Papers should not exceed 15 pages in length. A postscript or pdf
version of the paper should be submitted by e-mail to BOTH
organizers before the deadline given below. Note that all workshop
contributors must register for the summer school.
ORGANISERS:
Marc Pauly Gabriel Sandu
CWI Department of Philosophy
P.O. Box 94079 P.O. 24 (Unioninkatu 40)
1090 GB Amsterdam 00014 University of Helsinki
The Netherlands Finland
E-mail: pauly@cwi.nl E-mail: Sandu@elo.helsinki.fi
IMPORTANT DATES:
Submission deadline: April 9, 2001
Notification of contributors: May 1, 2001
Final version due: June 1, 2001
Workshop Dates: August 20-24, 2001
================================================================
From nick@microsoft.com Wed Mar 14 17:51:19 2001
Date: Wed, 14 Mar 2001 09:51:19 -0800
From: Nick Benton nick@microsoft.com
Subject: CfP: Babel01 Workshop on Multi-Language Infrastructure and Interoperability
BABEL'01
CALL FOR PAPERS
=20
First Workshop on Multi-Language
Infrastructure and Interoperability
=20
http://research.microsoft.com/~nick/babel01.htm
=20
Satellite to PLI'01
=20
Firenze, Italy, 8th September 2001
=20
=20
AIMS AND SCOPE
=20
Recent years have seen a resurgence of interest in multi-language
tools and intermediate languages, and in interoperability between
programs and components written in different programming
languages. Shared infrastructure such as code generators, analysis
tools and garbage collectors can greatly ease the task of producing a
high-quality implementation of a new programming language, whilst
being able to interoperate easily with code written in existing
languages is essential for such an implementation to be useful in
practice. This workshop aims to bring together researchers and
developers working on multi-language integration. Contributions are
welcome on topics including, but not limited to:=20
=20
=20
* Compilation of high level languages to common executable formats
such as Sun's Java Virtual Machine, the DRA's ANDF or Microsoft's
.NET Common Language Runtime.
=20
* Defining and using bindings for component middleware such as OMG's
CORBA or Microsoft's COM.
=20
* Language constructs to support interoperability between different
languages, particularly from different paradigms (e.g. OO/functional).
=20
* Multi-language backends for compilation and/or analysis
(e.g. MLRISC, FLINT, C--, TAL, SUIF). =20
=20
* Type theoretic and semantic foundations for multi-language work. =20
=20
* Multi-language development environments and tools (e.g. debuggers,
profilers).
=20
Submissions may address any programming paradigm. Experience papers
which describe the use of multiple languages in application
development are also welcome. Authors unsure of the appropriateness of
a potential submission should email the PC chair (nick@microsoft.com).
=20
=20
PROGRAMME COMMITTEE
=20
Nick Benton (chair) Microsoft Research
Fergus Henderson University of Melbourne
Andrew Kennedy (organiser) Microsoft Research
Greg Morrisett Cornell University
Martin Odersky Ecole Polytechnique Federale de Lausanne
John Reppy Bell Labs
Andrew Tolmach Portland State University
David Wakeling University of Exeter
=20
=20
INVITED SPEAKERS
=20
Zhong Shao Yale University
=20
=20
IMPORTANT DATES
=20
Deadline for submission 1st June 2001
Notification of acceptance 9th July 2001
Final version due 10th August 2001
=20
=20
SUBMISSION DETAILS
=20
Papers should be at most 14 pages and should be submitted in
Ghostscript-compatible PostScript or PDF format and be printable on
both US letter and A4 paper. Authors are strongly encouraged to use
ENTCS style files (see http://math.tulane.edu/~entcs/). Papers should
be submitted electronically from the workshop website given above.
Submissions should not overlap significantly with work which has
already been published or submitted to any other conference or
journal. An informal proceedings will be published as a technical
report and distributed at the workshop. It is intended that a final
proceedings will be published in a volume of ENTCS.
From wpd@uswest.net Thu Mar 15 22:15:13 2001
Date: Thu, 15 Mar 2001 15:15:13 -0700
From: Grace Trigue White wpd@uswest.net
Subject: Ghc / Hugs inconsistencty.
This is a multi-part message in MIME format.
------=_NextPart_000_003E_01C0AD62.BB93F4D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
The following program compiles under ghc, but hugs complains that there =
is an unexpected keyword "forall" on the line defining the type X. The =
type used is the type of the primitive runST, so it is a valid type. It =
seems that one should be able to create a type synonym for it. The =
situation is unchanged if the type X is given a parameter a, i.e. "type =
X a =3D (forall s. ST s a) -> a".
module Main where
import ST
type Module s a =3D ST s a
type X =3D (forall s. ST s a) -> a
f :: (forall s. ST s a) -> a
f x =3D undefined
--type ModuleConnect =3D forall s. (forall t. ST (s, t) a) -> ST s a
main :: IO ()
main =3D
do { putStrLn "Hello World!!!"
}
=20
------=_NextPart_000_003E_01C0AD62.BB93F4D0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3103.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#c8e0d8>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> The following program compiles =
under ghc, but=20
hugs complains that there is an unexpected keyword "forall" on the line =
defining=20
the type X. The type used is the type of the primitive runST, so it is a =
valid=20
type. It seems that one should be able to create a type synonym for it. =
The=20
situation is unchanged if the type X is given a parameter a, i.e. "type =
X a =3D=20
(forall s. ST s a) -> a".</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
style=3D"mso-fareast-font-family: 'MS =
Mincho'"></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
style=3D"mso-fareast-font-family: 'MS Mincho'">module Main =
where<BR><BR>import=20
ST<BR><BR>type Module s a =3D ST s a<BR><BR>type X =3D (forall s. ST s =
a) ->=20
a<BR>f :: (forall s. ST s a) -> a<BR>f x =3D undefined<BR>--type =
ModuleConnect=20
=3D forall s. (forall t. ST (s, t) a) -> ST s a<BR><BR>main :: IO =
()<BR>main=20
=3D<BR><SPAN style=3D"mso-spacerun: yes"> </SPAN>do { putStrLn =
"Hello=20
World!!!"<BR><SPAN style=3D"mso-spacerun: yes"> =20
</SPAN>}<BR> <?xml:namespace prefix =3D o ns =3D=20
"urn:schemas-microsoft-com:office:office"=20
/><o:p></o:p></SPAN></FONT></DIV></BODY></HTML>
------=_NextPart_000_003E_01C0AD62.BB93F4D0--
From ess_lli@cc.helsinki.fi Thu Mar 15 16:56:09 2001
Date: Thu, 15 Mar 2001 18:56:09 +0200 (EET)
From: Ahti Pietarinen ess_lli@cc.helsinki.fi
Subject: DEADLINE EXTENSION: ESSLLI'01 Workshop on Semantic Knowledge
Acquisition and Categorisation (Helsinki, Finland)
*************** EXTENDED DEADLINE ****************
----- NEW DEADLINE: APRIL 23rd -----
----- Please check new dates below! -----
SEMANTIC KNOWLEDGE ACQUISITION AND CATEGORISATION
Workshop at ESSLLI XIII (Helsinki, Finland)
Helsinki, Finland, August 13th - 17th 2001
Workshop home page
http://www.ilc.pi.cnr.it/~esslli
ESSLLI 2001 home page
http://www.helsinki.fi/esslli
-------------------------------------------------------------------
Endorsed by SIGSEM, the ACL Special Interest Group on computational
semantics
-------------------------------------------------------------------
The sheer amount of knowledge necessary to shed light on the way word
meanings mutually relate in context or distribute in lexico-semantic
classes appears to exceed the limits of human conscious awareness and
descriptive capability. Particularly at this level of linguistic analysis,
then, we seem to be in need of automatic ways of filtering, structuring
and classifying semantic evidence through inspection of a large number of
word uses in context. Totally or partially unsupervised inductive methods
of knowledge acquisition from corpus data are credited with being able to
provide such ways. Yet, it remains to be seen how acquired information can
best be represented in current formal models for knowledge representation,
for it to be made available to mainstream NLP applications.
There are reasons to believe that this integration will require much more
than a simple extension of off-the-shelf machine learning technology. At
the same time, any major breakthrough in this area is bound to have
significant repercussions on the way word meanings and lexico-semantic
classes in general are formally represented and used for applications.
With these purposes in mind, the workshop intends to focus on the issue of
interaction between techniques for inducing semantic information from
corpus data and formal methods of linguistic knowledge representation. In
particular, we encourage in-depth analysis of underlying assumptions of
the proposed techniques and methods and discussion of possible relevant
connections with cognitive, linguistic,logical and philosophical issues.
TOPICS OF INTEREST
Possible themes for contributions are:
- development of 'data-driven' semantic type systems
- dynamic update and tuning of formal ontologies with text data
- 'hybrid models' of knowledge extraction, whereby machine learning
methods are integrated with formal structures of knowledge representation
- creation of dynamic lexical knowledge-bases
- formal representation and structuring of the flow of information
extracted from texts.
WORKSHOP ORGANISATION
The workshop will be held on five subsequent days, August 13th-17th 2001.
It will take place during the ESSLLI-Summer School in Helsinki, and will
be open to all members of the LLI-community, computational linguistics and
cognitive science as well. Each session will consist of two talks plus
discussion (30mins + 15mins each). The workshop language will be English.
----------------------------------------------------------------------------
GUIDELINES FOR SUBMISSIONS
The organizers welcome contributions from different fields of
computational linguistics, logic and cognitive science.
1. Submissions will consist of full papers reporting on original,
unpublished works. Papers should not exceed 5000 words
(including references), must contain a 5-10 lines abstract, and must
be submitted in postscript format
2. The reviewing of papers will be blind. Hence the paper
should not include the authors' names and affiliations.
Furthermore, self-references that reveal the author's identity
should be avoided.
3. Identification information will be put in a separate file
consisting of:
Title of the paper:
Author(s):
Affiliation(s):
E-mail(s):
Abstract:
4. Submitted papers and identification information must be sent
to the following address by APRIL 23rd 2001:
esslli2001@ilc.pi.cnr.it
Accepted papers will be notified by MAY 15th, together with the comments
of the reviewers.
The final version of the papers will be prepared in LaTeX by JUNE 15th,
for publication in the Workshop proceedings. The stylesheet will be
circulated in due time.
Note that all workshop participants must register as participants of
ESSLLI. The early registration fees apply to authors of accepted papers.
---------------------------------------------------------------------------
IMPORTANT DATES
April 23rd 2001 - Deadline for submitting papers
May 15th 2001 - Notification of acceptance
June 15th 2001 - Preparation of the final version of the paper
June 30th 2001 - Final program of the workshop
August 13th 2001 - The workshop begins
---------------------------------------------------------------------------
PROGRAM COMMITEE
Ted Briscoe (Cambridge University, Cambridge, United Kingdom)
Nicoletta Calzolari (Istituto di Linguistica Computazionale, CNR, Pisa, Italy)
Christiane Fellbaum (Princeton University, Princeton, USA)
Ed Hovy (USC, Marina del Rey CA, USA)
Dekang Lin (University of Alberta, Edmonton, Canada)
Antonio Sanfilippo (LingoMotors Inc., Cambridge MA, USA)
Piek Vossen (SAILLABS, Antwerpen, The Netherlands)
ORGANISING COMMITEE
Alessandro Lenci
Simonetta Montemagni
Vito Pirrelli
Istituto di Linguistica Computazionale (ILC) - CNR
Area della Ricerca CNR
Via Alfieri 1 (San Cataldo)
I-56010 PISA
Italy
WORKSHOP CONTACT ADDRESS
esslli2001@ilc.pi.cnr.it
http://www.ilc.pi.cnr.it/~esslli
ESSLLI 2001 CONTACT ADDRESS
esslli@helsinki.fi
http://www.helsinki.fi/esslli
--------------------------------------------------------------------------
From minihaskell@hotmail.com Fri Mar 16 12:32:35 2001
Date: Fri, 16 Mar 2001 12:32:35 -0000
From: Mini Haskell minihaskell@hotmail.com
Subject: Please help us with our research....
Hi
We are a small group of undergraduate computer science students from the
University of Nottingham. As part of our second year we have been
assigned to do a software engineering group project. The project put us
together as a group and we were told what we had to do, our instructions
were as follows:
Mini Haskell
------------
The aim of this project is to build an interpreter for a small
functional programming language called Mini Haskell. For simplicity, the
only values in the language will be integers, lists, and functions. As
well as allowing expressions to be evaluated to a final result, the
interpreter should also allow the individual steps in the evaluation
process to be seen.
------------
AS part of our research we have developed an on-line questionnaire which
looks at the importance of some of the ideas we have had for the
project. The questionnaire is found on our website and asks some very
simple multiple choice questions which should take no longer than 2
minutes to complete. Please help us by looking at the site and by
filling in our questionnaire in the feedback section.
Please go to
questionnaire: http://quest.minihaskell.com
website: http://www.minihaskell.com
thankyou for your time
Dave - minihaskell
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
From bcpierce@cis.upenn.edu Fri Mar 16 14:33:31 2001
Date: Fri, 16 Mar 2001 09:33:31 EST
From: Benjamin C. Pierce bcpierce@cis.upenn.edu
Subject: TACS 2001 call for papers (deadline April 1)
Call For Papers
Fourth International Symposium on
Theoretical Aspects of Computer Science (TACS 2001)
October 29-31, 2001
Tohoku University, Sendai, Japan
http://tacs2001.ito.ecei.tohoku.ac.jp/tacs2001/
The TACS Symposium will focus on the theoretical foundations of
programming and their applications. The topics of interest include...
Theoretical aspects of the design, semantics, analysis, and
implementation of programming languages and systems; logics of
programs; calculi and models of concurrency and parallel
computation; theories of mobile computation and system security;
categories and types in computer science; formalisms, methods, and
systems for program specification, verification, synthesis, and
optimization; constructive, linear, and modal logics in computer
science.
The scientific program will consist of invited lectures, contributed
talks, and demo sessions. A proceedings containing the full papers of
the invited and contributed talks will be published by Springer-Verlag
as a volume of Lecture Notes in Computer Science.
IMPORTANT DATES
Submission deadline: April 1, 2001
Notification to authors: June 15, 2001
Deadline for final versions: July 20, 2001
INVITED SPEAKERS
Luca Cardelli Microsoft Research
Daniel Jackson Massachusetts Institute of Technology
Christine Paulin-Mohring Universite Paris Sud & INRIA
Andrew Pitts University of Cambridge
Jon Riecke Lucent Technologies
Kazunori Ueda Waseda University
CONFERENCE CHAIR:
Takayasu Ito
Tohoku University
PROGRAM CO-CHAIRS:
Naoki Kobayashi
Tokyo Institute of Technology
kobayasi@cs.titech.ac.jp
Benjamin Pierce
University of Pennsylvania
bcpierce@cis.upenn.edu
PROGRAM COMMITTEE:
Zena Ariola University of Oregon
Cedric Fournet Microsoft Research
Jacques Garrigue Kyoto University
Masami Hagiya University of Tokyo
Robert Harper Carnegie Mellon University
Masahito Hasegawa Kyoto University
Nevin Heintze Lucent Technologies
Martin Hofmann Edinburgh University
Zhenjiang Hu University of Tokyo
Naoki Kobayashi Tokyo Institute of Technology
Martin Odersky Ecole Polytechnique Federale de Lausanne
Catuscia Palamidessi Pennsylvania State University
Benjamin Pierce University of Pennsylvania
Francois Pottier INRIA
Andre Scedrov University of Pennsylvania
Natarajan Shankar SRI International
Ian Stark Edinburgh University
Makoto Tatsuta Kyoto University
SUBMISSION INFORMATION
Authors are invited to submit full papers (up to 6000 words, including
figures and bibliographies). Papers must be unpublished and not submitted
for publication elsewhere. Submissions should be in Postscript or PDF
format, on A4 or US letter pages. They must be printable on common
printers and viewable with ghostview or acroread. The first page of each
submission should include the email address, telephone, and fax numbers
of the corresponding author. Accepted papers must be presented at the
symposium, and the final manuscript must be prepared in the LNCS format.
All submissions should be done electronically through the TACS submission
page http://saul.cis.upenn.edu:8086/.
From harald@cs.mu.OZ.AU Fri Mar 16 15:44:41 2001
Date: Sat, 17 Mar 2001 02:44:41 +1100
From: Harald Sondergaard harald@cs.mu.OZ.AU
Subject: PPDP'01 deadline extension to 23 March
PPDP'01
Principles and Practice of Declarative Programming
Florence, Italy, 5-7 September 2001
http://music.dsi.unifi.it/pli01/ppdp/
EXTENSION OF DEADLINE FOR SUBMISSIONS
The deadline for paper submissions
has been extended to 23 March 2001.
Harald Sondergaard
PPDP'01 Program Chair
From mthomas@gil.com.au Sat Mar 17 02:20:34 2001
Date: Sat, 17 Mar 2001 12:20:34 +1000
From: Mike Thomas mthomas@gil.com.au
Subject: Greencard, GHC and FFI.
Hi all.
I'm having trouble with using green-card 2 on Windows
with GHC-4.08.2. As the default output for -target ghc seems
to be for the C back-end rather than native code, I thought I would
try the FFI target.
Using the example from the green-card doc:
---------------------------------------------
module GCTest where
import StdDIS
%fun my_sin :: Double -> Double
%code res1=sin(arg1);
---------------------------------------------
Compiling for target FFI:
---------------------------------------------
green-card -c GCTest.gc -o GCTest.hs --target ffi
ghc -c GCTest.hs -fglasgow-exts
---------------------------------------------
Linking with this main module:
---------------------------------------------
module Main(main) where
import GCTest
main :: IO()
main = putStrLn (show (my_sin (20.0)))
---------------------------------------------
I get:
---------------------------------------------
$ ghc main.hs -o main.exe GCTest.o StdDIS.o -package lang -package greencard
Compilation IS NOT required
GCTest.o(.text+0x7f):fake: undefined reference to `prim_my_sin'
StdDIS.o(.text+0x549):fake: undefined reference to `prim_free'
StdDIS.o(.text+0x600):fake: undefined reference to `prim_allocCharStar'
StdDIS.o(.text+0x731):fake: undefined reference to `prim_readCharAddr'
StdDIS.o(.text+0xc84):fake: undefined reference to `prim_malloc'
StdDIS.o(.text+0xd38):fake: undefined reference to `access_prim_malloc_res1'
StdDIS.o(.text+0xdec):fake: undefined reference to
`access_prim_malloc_gc_failed
'
StdDIS.o(.text+0xea0):fake: undefined reference to
`access_prim_malloc_gc_failst
ring'
StdDIS.o(.text+0x1206):fake: undefined reference to `prim_writeCharAddr'
collect2: ld returned 1 exit status
---------------------------------------------
Where have I gone wrong?
Cheers
Mike Thomas.
From sigbjorn_finne@hotmail.com Sat Mar 17 09:01:12 2001
Date: Sat, 17 Mar 2001 10:01:12 +0100
From: Sigbjorn Finne sigbjorn_finne@hotmail.com
Subject: Greencard, GHC and FFI.
Mike Thomas mthomas@gil.com.au writes:
>
> I'm having trouble with using green-card 2 on Windows
> with GHC-4.08.2. As the default output for -target ghc seems
> to be for the C back-end rather than native code, I thought I would
> try the FFI target.
>
.... example code deleted
>
> I get
>
> $ ghc main.hs -o main.exe GCTest.o StdDIS.o -package lang -package
greencard
> ---------------------------------------------
> Compilation IS NOT required
> GCTest.o(.text+0x7f):fake: undefined reference to `prim_my_sin'
> ....
Hi,
Greencard lets you write C and Haskell in one source file. When using GHC's
C back end, it is possible to combine the two in one source file (via GHC's
_casm_s.) The FFI doesn't let you do this, but requires you to provide
the C bits separately, and link the Haskell code to it via 'foreign'
declarations.
So, when using GC's FFI backend, it generates two source files for you
(and some header files) - in your case, GCTest.hs and GCTest_stub.c.
To achieve linker happiness, you need to compile up the latter and include
it on the link line *and* drop StdDIS.o from that link line.
hth
--sigbjorn
From mthomas@gil.com.au Sat Mar 17 22:30:40 2001
Date: Sun, 18 Mar 2001 08:30:40 +1000
From: Mike Thomas mthomas@gil.com.au
Subject: Greencard, GHC and FFI.
Hi again.
> So, when using GC's FFI backend, it generates two source files for you
> (and some header files) - in your case, GCTest.hs and GCTest_stub.c.
> To achieve linker happiness, you need to compile up the latter and include
> it on the link line *and* drop StdDIS.o from that link line.
Thanks for that - I've achieved linker happiness.
FYI, I notice that the GCTest stub file has a do..while(0), which I suppose
should be optimised away by GCC, but still makes the code less
palatable:
--------------------------------------------------------
/* Auto generated GreenCard 2 code for FFI */
double prim_my_sin(double arg1)
{ double res1;
do { res1=sin(arg1);
return((double)(res1));} while(0);
}
--------------------------------------------------------
Cheers
Mike Thomas
From johnjohnjohn64@hotmail.com Mon Mar 19 07:59:03 2001
Date: Mon, 19 Mar 2001 18:59:03 +1100
From: john xxx johnjohnjohn64@hotmail.com
Subject: question does haskell have a something like a wild character
i want to know if HAskell has an inbuilt function in the prelude a function
that allows me to use wild character like so:
ie. if a list of strings contains a word or a combination of words that do
not necessarily have to be side by side. someting that works like so [..
"hello" ..] == ["my", "tie" , "egg", "hello", "good"] would return True.
where .. represents other elements of the list it counld be 1element or a
hundred elements.
please reply urgently to johnjohnjohn64@hotmail.com
if haskell does not provide such a function can you please give me
information on how to create one that would do such a thing that i need.
THANKYOU FOR YOUR TIME.
please reply! i need this function for an assignment for university.
p.s if you're interested in the question visit.
http://www.cse.unsw.edu.au/~cs1711/ass1/spec-ass1.html
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
From Christian.Brolin@carmen.se Mon Mar 19 08:28:15 2001
Date: Mon, 19 Mar 2001 09:28:15 +0100
From: Christian Brolin Christian.Brolin@carmen.se
Subject: question does haskell have a something like a wild character
john xxx wrote:
>
> i want to know if HAskell has an inbuilt function in the prelude a function
> that allows me to use wild character like so:
>
> ie. if a list of strings contains a word or a combination of words that do
> not necessarily have to be side by side. someting that works like so [..
> "hello" ..] == ["my", "tie" , "egg", "hello", "good"] would return True.
> where .. represents other elements of the list it counld be 1element or a
> hundred elements.
> whatis elem;
elem :: (Prelude.Eq b) => b -> [b] -> Bool
> elem "hello" ["my", "tie" , "egg", "hello", "good"];
True
--
Christian Brolin
From white_ghost8@hotmail.com Mon Mar 19 15:16:27 2001
Date: Mon, 19 Mar 2001 16:16:27 +0100
From: The Ghost white_ghost8@hotmail.com
Subject: knight's tour - please help
Hello everyone,
I have a little problem with implementing the knight's tour in haskell.
My goal is to print out all possible solutions for the knight's tour.
Allthough finding one path (with given startinposition (x,y) of the horse
and dimension of the bord M*N) is not enough. I have to find all of them.
(the printing out may be very simpel)
I've wrote this problem is several other languages and there they work
perfect. But I'm searching for an implementation in Haskell. The
implementation may also be simpel (I think it can be solved only by using
lists and backtracking).
If I have the implementation I can go one with my project, I should use it
to explain the differences between a functional language and the others
(effiency, speed,..)
Is ther someone who has such an implementation (that is not too complicated
and not too lang).
Would you be so kind to send it to me?
I should be very thankfull.
Greetings,
The White Ghost.
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
From martin@meltin.net Tue Mar 20 04:25:45 2001
Date: Tue, 20 Mar 2001 15:25:45 +1100
From: Martin Schwenke martin@meltin.net
Subject: ANNOUNCE: HasChorus - some modules for Haskore
HasChorus:
A set of Haskell (http://haskell.org/) modules written on top of
Haskore (http://haskell.org/haskore/) to make it easier to sequence
simple, repetitive music.
HasChorus is available via:
http://meltin.net/hacks/haskell/
----------------------------------------------------------------------
HasChorus *has* a bunch of useful modules:
HasChords.lhs: Build (diatonic) chords from scales and scale degrees.
HasDrums.lhs: Sequence drums in a similar manner to a drum machine.
HasEasyMusic.lhs: Allow simple specification of simple music sequences.
HasGroove.lhs: Modify Haskore performances via normal distributions.
HasPatterns.lhs: Sequence patterns by playing chords in different ways.
HasScales.lhs: Build scales and pick notes by scale degree.
HasSounds.lhs: Some boring ways of playing some instruments.
HaskoreExtras.lhs: Some useful functions that aren't in Haskore.
BubbleSort.lhs: An implementation of bubble sort. Used by HasGroove.lhs.
Normal.lhs: Generate normal distributions. Used by HasGroove.lhs.
TwelveBar.lhs: An example song.
Many of the modules can be used without requiring all of the others.
The dependencies look something like:
HasEasyMusic -> HasChords -> HasScales
HasDrums -> HaskoreExtras
HasSounds -> HasPatterns
HasGroove -> BubbleSort, Normal
TwelveBar -> HasChorus -> *EVERTHING ELSE*
----------------------------------------------------------------------
HasChorus has been tested under:
* Hugs: Currently I use Hugs 98, February 2000. I use -h1000000 so
that HasGroove doesn't melt down... :-)
* GHC: 4.08 (previously under 4.07) under x86 Linux.
----------------------------------------------------------------------
I use HasChorus to sequence up simple backing tracks for my own
compositions.
Enjoy...
peace & happiness,
martin
Martin Schwenke <martin@meltin.net>
p.s. Several people who have expressed interest in this project during
the last few years have received this announcement via a BCC.
They haven't been secretly subscribed to the Haskell mailing
list. :-)
From thiemann@informatik.uni-freiburg.de Tue Mar 20 16:55:39 2001
Date: 20 Mar 2001 17:55:39 +0100
From: Peter Thiemann thiemann@informatik.uni-freiburg.de
Subject: modules and re-export
I have a little question about the following two modules. Suppose you
want to write your own variant of the prelude that redefines a couple
of names but leaves all the rest unchanged. The Haskell report says
that the following should work:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
module BUG2A (module BUG2A, module Prelude) where
import Prelude hiding (head)
head = "HEAD"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This overrides the definition of head and should reexport head along
with everything imported from the Prelude. Hugs98/feb2001 loads it
happily and says head :: [Char]
Now, I want to use this module as an alternative prelude:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
module BUG2B where
import qualified Prelude
import BUG2A
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unfortunately, this does not behave as (I think) it should:
Reading file "BUG2B.hs":
Parsing........................................................................
ERROR "BUG2B.hs": Entity "head" imported from module "BUG2A" already defined in module "Prelude"
However, this should be legal from my reading of the report.
Any help appreciated.
-Peter
From mthomas@gil.com.au Tue Mar 20 22:14:03 2001
Date: Wed, 21 Mar 2001 08:14:03 +1000
From: Mike Thomas mthomas@gil.com.au
Subject: GHC Mingw32 build
Hi all..
What is the recommended way of making the Mingw32 build of GHC and all
associated tools, eg HDirect, Green-card etc from the CVS?
Cheers
Mike Thomas
From ru@river.org Wed Mar 21 07:40:28 2001
Date: Tue, 20 Mar 2001 23:40:28 -0800 (PST)
From: Richard Uhtenwoldt ru@river.org
Subject: Coroutines
Andreas Gruenbacher writes:
>It's not what I had in mind, though. Simon's MVars (in the Awkward Squad)
>come pretty close, but they're still not the sort of (cooperative)
>multitasking that I'm thinking of.
I hope I'm not being too fussy, but seems to me that the CVar is what
is needed, not the MVar:
>main=
> newCVar >>= \l0 ->
> newCVar >>= \l1 ->
> newCVar >>= \l2 ->
> forkIO readInputLineAtATime l0 >>
> forkIO printHeader "silly header" l0 l1 >>
> forkIO numberLines 0 l1 l2 >>
> printOutputLineAtATime l2
(untested code.)
From fis@ssh.com Wed Mar 21 10:01:20 2001
Date: 21 Mar 2001 12:01:20 +0200
From: Matthias Fischmann fis@ssh.com
Subject: modules and re-export
Peter Thiemann <thiemann@informatik.uni-freiburg.de> writes:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> module BUG2A (module BUG2A, module Prelude) where
> import Prelude hiding (head)
> head = "HEAD"
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> module BUG2B where
> import qualified Prelude
> import BUG2A
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Unfortunately, this does not behave as (I think) it should:
> [...]
ghc-4.08.1 compiles it without complaining. A Hugs98 bug?
-Matthias
From richard_adams@non.hp.com Wed Mar 21 19:24:15 2001
Date: Wed, 21 Mar 2001 12:24:15 -0700
From: ADAMS,RICHARD (Non-HP-Roseville,ex1) richard_adams@non.hp.com
Subject: Question concerning ftp and GHC binaries for HP-UX
I would like to download the GHC binaries to our HP 9000 machine (HP-UX
11.0), but have access only to ftp (i.e., no Web browser is available).
Does anyone know what ftp address to use? Also, does anyone know whether
the GHC binaries for the HP-UX operating system will work on HP-UX 11.0?
I am not sure whether it is relevant, but I use Reflection terminal
emulation to telnet from my PC to the HP 9000 machine. Truly 'hi-tech' :) .
Thank you.
Sincerely,
Richard E. Adams
Softmatrix, Inc.
Roseville, CA
Email: richard_adams@non.hp.com
From sigbjorn_finne@hotmail.com Wed Mar 21 21:14:58 2001
Date: Wed, 21 Mar 2001 22:14:58 +0100
From: Sigbjorn Finne sigbjorn_finne@hotmail.com
Subject: modules and re-export
Peter Thiemann thiemann@informatik.uni-freiburg.de writes:
>
> I have a little question about the following two modules. Suppose you
> want to write your own variant of the prelude that redefines a couple
> of names but leaves all the rest unchanged. The Haskell report says
> that the following should work:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> module BUG2A (module BUG2A, module Prelude) where
>
> import Prelude hiding (head)
>
> head = "HEAD"
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
....
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> module BUG2B where
>
> import qualified Prelude
> import BUG2A
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Unfortunately, this does not behave as (I think) it should:
>
> Reading file "BUG2B.hs":
>
Parsing.....................................................................
...
> ERROR "BUG2B.hs": Entity "head" imported from module "BUG2A" already
> defined in module "Prelude"
>
> However, this should be legal from my reading of the report.
Hi Peter,
yep, that's right, and it is a known wrinkle in Hugs' implementation of
modules.
I submitted a source fix which addresses just this a couple of weeks ago,
http://haskell.cs.yale.edu/pipermail/hugs-bugs/2001-March/000184.html
hopefully it will be included in future releases of Hugs98.
hth
--sigbjorn
From nordland@cse.ogi.edu Wed Mar 21 22:26:56 2001
Date: Wed, 21 Mar 2001 14:26:56 -0800
From: Johan Nordlander nordland@cse.ogi.edu
Subject: modules and re-export
Sigbjorn Finne wrote:
>
> Peter Thiemann thiemann@informatik.uni-freiburg.de writes:
> >
> > I have a little question about the following two modules. Suppose you
> > want to write your own variant of the prelude that redefines a couple
> > of names but leaves all the rest unchanged. The Haskell report says
> > that the following should work:
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > module BUG2A (module BUG2A, module Prelude) where
> >
> > import Prelude hiding (head)
> >
> > head = "HEAD"
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ....
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > module BUG2B where
> >
> > import qualified Prelude
> > import BUG2A
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > Unfortunately, this does not behave as (I think) it should:
> >
> > Reading file "BUG2B.hs":
> >
> Parsing.....................................................................
> ...
> > ERROR "BUG2B.hs": Entity "head" imported from module "BUG2A" already
> > defined in module "Prelude"
> >
> > However, this should be legal from my reading of the report.
>
> Hi Peter,
>
> yep, that's right, and it is a known wrinkle in Hugs' implementation of
> modules.
> I submitted a source fix which addresses just this a couple of weeks ago,
>
> http://haskell.cs.yale.edu/pipermail/hugs-bugs/2001-March/000184.html
>
> hopefully it will be included in future releases of Hugs98.
>
> hth
> --sigbjorn
Hi all,
The fix will indeed be included in the next Hugs release (thanks
Sigbjorn!); in fact it can be tried right away by checking out the
latest revision from the cvs repository. See http://cvs.haskell.org/
for further details.
Cheers,
Johan
From ltaesch@europemail.com Thu Mar 22 06:39:02 2001
Date: Thu, 22 Mar 2001 06:39:02 +0000
From: luc ltaesch@europemail.com
Subject: Welcome to the "Haskell" mailing list
haskell-request@haskell.org wrote:
> Welcome to the Haskell@haskell.org mailing list!
>
> To post to this list, send your email to:
>
> c
>
hi. im just a newcomer to haskell (www.taesch.com). quite impressed till now
!
im trying to have haxml lib running with hugs and had the following problem
:
1) under win, quite an issue to tun the cpp stuff. did it under linux, (for
info)
2) then i had a "maybeA" which is unknown. some lib i had to add ? ("maybe"
doesnt seems to work)
3) a module declare a "with" function, which hugs doenst seem to like .
renamed it withlt for now.
this make me thinks that this lib is probably not tested under hugs98. could
someone confirm that ? as im too newbies, im maybe missing something
obvious. Id better asking, i thought.
thanks
Luc
From Malcolm.Wallace@cs.york.ac.uk Thu Mar 22 21:19:45 2001
Date: Thu, 22 Mar 2001 21:19:45 +0000
From: Malcolm Wallace Malcolm.Wallace@cs.york.ac.uk
Subject: HaXml (was: Re: Welcome to the "Haskell" mailing list)
> im trying to have haxml lib running with hugs and had the following problem
> 1) under win, quite an issue to tun the cpp stuff. did it under linux, (for
> info)
Thanks for the report. I'll think some more about how to package
HaXml to make things easier for Hugs users.
> 2) then i had a "maybeA" which is unknown. some lib i had to add ? ("maybe"
> doesnt seems to work)
The only use of "maybeA" is in a comment containing some example
code for documentation purposes. It appears that this example is
now out of date, for which, apologies. If you want to use the
example, you need to rename "maybeA" to "maybeToAttr".
> 3) a module declare a "with" function, which hugs doenst seem to like.
> renamed it withlt for now.
"with" is a perfectly valid Haskell function name, but Hugs may have
stolen it for a language extension. Try giving Hugs the +98 option
at startup, to ensure that all extensions are turned off. [Note to
users of the implicit parameter extension: I believe in future the
pseudo-keyword "with" will be removed and replaced by "let".]
> this make me thinks that this lib is probably not tested under hugs98. could
> someone confirm that ? as im too newbies, im maybe missing something
> obvious. Id better asking, i thought.
HaXml is occasionally tested with Hugs98, but not as often as we
test it with other compilers. Soon however, we are hoping to have
a grand hierarchy of standard libraries for Haskell (including HaXml
amongst many others), which will be completely compiler-independent,
and tested regularly with all three or four currently-available
compilers/interpreters. This should greatly improve the portability
of a lot of publically-available Haskell code.
Regards,
Malcolm
From jens-ulrik.petersen@nokia.com Fri Mar 23 03:26:41 2001
Date: 23 Mar 2001 12:26:41 +0900
From: Jens-Ulrik Petersen jens-ulrik.petersen@nokia.com
Subject: url update for Asperti & Longo: "Categories, Types and Structures"
Hi Frank,
Thanks for making <http://www.cs.uu.nl/people/franka/ref.html>. Good
idea!
"Frank Atanassow" <franka@cs.uu.nl> writes:
> [1] Andrea Asperti and Giussepe Longo. Categories, Types and Structures. An
> introduction to Category Theory for the working computer
> scientist. MIT Press, 1991.
> URL: http://www.dmi.ens.fr/users/longo/download.html
It seems ENS's DMI bifurcated... the current url is now
http://www.di.ens.fr/users/longo/download.html
Maybe you could update the link on your page too.
Thanks, Jens
From sambat_101@yahoo.com Fri Mar 23 12:46:44 2001
Date: Fri, 23 Mar 2001 04:46:44 -0800 (PST)
From: Bark Fook sambat_101@yahoo.com
Subject: Question concerning ftp and GHC binaries for HP-UX
> Message: 1
> From: "ADAMS,RICHARD (Non-HP-Roseville,ex1)"
> <richard_adams@non.hp.com>
> To: "'haskell@haskell.org'" <haskell@haskell.org>
> Subject: Question concerning ftp and GHC binaries
> for HP-UX
> Date: Wed, 21 Mar 2001 12:24:15 -0700
>
> I would like to download the GHC binaries to our HP
> 9000 machine (HP-UX
> 11.0), but have access only to ftp (i.e., no Web
> browser is available).
> Does anyone know what ftp address to use? Also,
> does anyone know whether
> the GHC binaries for the HP-UX operating system will
> work on HP-UX 11.0?
>
> I am not sure whether it is relevant, but I use
> Reflection terminal
> emulation to telnet from my PC to the HP 9000
> machine. Truly 'hi-tech' :) .
>
> Thank you.
>
> Sincerely,
>
> Richard E. Adams
> Softmatrix, Inc.
> Roseville, CA
> Email: richard_adams@non.hp.com
>
I encountered the same problem of downloading with
ftp. However, even if you succeeded in downloading, I
guess it would not work as we wish:(. The system I use
is HP-UX 11.00 (64-bit) HPPA 2.0. And I downloaded the
version 4.08.2 for hppa1.1-hp-hpux with HTTP. It ran
(without explicit errors) and output sth when input
sth.hs. However, each time when I ran the sth, I got
core dump. I tried to recompile the compiler (or even
Happy), of course, failed with the same symptom (or
unHappy). If I know anyone has successfully run GHC
without incurring core dumps in HP-UX 11.00 (64-bit),
I'll be very happy if Happy works too:). If I have
enough time, I wish I could port it to HP-UX 11.00
(64-bit). I'm very glad to know if there exists
somebody who will aid me or play together with me over
64-bit ghc for 64-bit HPUXes. Should I attack the
problem from HBC or nhc98?
One more bad news, SMLNJ works on HP-UX 10.20, not on
HP-UX 11.00, either:-(. I've tried and failed too.
One more good news, Hugs98-Feb2001 does work in HP-UX
11.00 (64-bit). I swear, where only very few tweaks
are needed. But I guess it's running in 32-bit
mode:-).
The last kisstion: Can I build ghc from Hugs, my god?
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
From Malcolm.Wallace@cs.york.ac.uk Fri Mar 23 16:24:18 2001
Date: Fri, 23 Mar 2001 16:24:18 +0000
From: Malcolm Wallace Malcolm.Wallace@cs.york.ac.uk
Subject: Question concerning ftp and GHC binaries for HP-UX
> I'm very glad to know if there exists
> somebody who will aid me or play together with me over
> 64-bit ghc for 64-bit HPUXes. Should I attack the
> problem from HBC or nhc98?
> The last kisstion: Can I build ghc from Hugs
Ghc can only be built by itself, not with any other Haskell system.
The only Haskell compiler that is truly written in Haskell'98 and
can be built by all other compilers is nhc98. Unfortunately nhc98
only works (currently) on 32-bit machines, not on 64-bits.
By the way, if someone wanted to donate a login on an 64-bit machine
accessible over the net, I would be interested to try to patch nhc98
to work under a 64-bit architecture.
Regards,
Malcolm
From khaliff@astercity.net Fri Mar 23 18:45:25 2001
Date: Fri, 23 Mar 2001 19:45:25 +0100 (CET)
From: Wojciech Moczydlowski, Jr khaliff@astercity.net
Subject: Announce: Haskell libpq binding
The Haskell libpq (client-side PostgreSQL programming library) binding is
now available to download, along with a simple DBI for Haskell, similar to
this in Perl, allowing a programmer to write a database-independent
code.
It can be found at http://www.astercity.net/~khaliff/haskell/dbi/dbi.tgz. To
compile, KDirect (http://www.astercity.net/~khaliff/kdirect) and the latest
version of QForeign (http://sourceforge.net/projects/qforeign) is needed. It
should compile both under ghc and nhc, yet only ghc was tested. It is no
end-user product, though - there is no "install" rule in Makefile and
Makefile editing is necessary, I'm afraid.
If someone finds it useful or has any suggestions, I would love to hear
them.
Wojciech Moczydlowski, Jr
From tobi.haeberlein@gmx.de Tue Mar 27 09:38:55 2001
Date: Tue, 27 Mar 2001 11:38:55 +0200 (MEST)
From: Tobias Haeberlein tobi.haeberlein@gmx.de
Subject: the constant functor
I am trying to make all polynomial functors (in the
categorical sense) an instance of the class Functor.
Consider a datatype (corresponsing to a constant functor):
data ConstInt a = Const Int
ConstInt is clearly a functor in the categorical sense,
but is 'ConstInt' also a functor in Haskell??
Any ideas how to make 'ConstInt' an instance of class Functor?
-Tobi
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
From tobi.haeberlein@gmx.de Tue Mar 27 10:09:59 2001
Date: Tue, 27 Mar 2001 12:09:59 +0200 (MEST)
From: Tobias Haeberlein tobi.haeberlein@gmx.de
Subject: the constant functor
> What is wrong with:
>
> class Functor ConstInt where
> map f (Const n) = Const n
Ups - absolutely nothing.
I actually tried it with
data ConstInt a = Int
and didnt manage to make this an instance of
class Functor. Sorry for giving the wrong
example.
-Tobi
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
From rms@it-c.dk Tue Mar 27 11:37:13 2001
Date: Tue, 27 Mar 2001 13:37:13 +0200
From: rms rms@it-c.dk
Subject: Regarding open positions at IT-C
Regarding open positions at The IT-University of Copenhagen,
Via the following URL you will find a detailed description of 13 positions as
Associate or Assistant Professor currently open at The IT-University of
Copenhagen.
http://www.it-c.dk/pub_uk/db_363.html
Kind Regards
Personnel Department/ The IT-University of Copenhagen
From aw@free.elogica.com.br Wed Mar 28 05:35:11 2001
Date: Wed, 28 Mar 2001 02:35:11 -0300
From: Andre W B Furtado aw@free.elogica.com.br
Subject: Duvidas
This is a multi-part message in MIME format.
------=_NextPart_000_0005_01C0B72F.B655DC00
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
In Hugs Graphics Library, many procedures call the function getEvent =
with a Window as the parameter. But getEvent is defined as below:
getEvent :: Events -> IO Event
How does this work? I've tryied to do something similar and got the =
following error message (in GHC):
Couldn't match `Events' against `Window'
Expected type: Events
Inferred type: Window
In the first argument of `getEvent', namely `w'
In a do statement: e <- getEvent w
In time: my "Window" is defined as following
data Window =3D MkWindow {=20
win :: GLUT.Window, -- the real window
events :: Events -- the event stream
}
And in Hugs Graphics Library the "Window" is defined as:
data Window =3D MkWindow {
wnd :: WND, -- the real window
events :: Events, -- the event stream
graphic :: IORef (Draw ()) -- the current graphic
}
Thanks,
Andre
------=_NextPart_000_0005_01C0B72F.B655DC00
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>
<DIV>In Hugs Graphics Library, many procedures call =
the function=20
getEvent with a Window as the parameter. But getEvent is =
defined=20
as below:</DIV>
<DIV> </DIV>
<DIV>getEvent :: Events -> IO Event</DIV>
<DIV> </DIV>
<DIV>How does this work? I've tryied to do something similar and =
got the=20
following error message (in GHC):</DIV>
<DIV> </DIV>
<DIV> Couldn't match `Events' against=20
`Window'<BR> Expected type:=20
Events<BR> Inferred type:=20
Window<BR> In the first argument of `getEvent', namely =
`w'<BR> In a do statement: e <- getEvent =
w<BR></DIV>
<DIV>In time: my "Window" is defined as following</DIV>
<DIV> </DIV>
<DIV>data Window =3D MkWindow { <BR> =
win =20
:: GLUT.Window, -- the real window<BR> =
events ::=20
Events -- the event stream<BR> }</DIV>
<DIV> </DIV>
<DIV>And in Hugs Graphics Library the "Window" is defined as:</DIV>
<DIV> </DIV>
<DIV>data Window =3D MkWindow {</DIV>
<DIV> wnd ::=20
WND, -- the real=20
window<BR> events :: =
Events, --=20
the event stream<BR> graphic :: IORef (Draw ()) =
-- the=20
current graphic<BR> }<BR></DIV>
<DIV>Thanks,</DIV>
<DIV>Andre</DIV></FONT></DIV></BODY></HTML>
------=_NextPart_000_0005_01C0B72F.B655DC00--
From aw@free.elogica.com.br Wed Mar 28 05:37:05 2001
Date: Wed, 28 Mar 2001 02:37:05 -0300
From: Andre W B Furtado aw@free.elogica.com.br
Subject: getEvent Doubts
This is a multi-part message in MIME format.
------=_NextPart_000_0010_01C0B72F.FA8770A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
[Sorry about the previous email subject :) ]
In Hugs Graphics Library, many procedures call the function getEvent =
with a Window as the parameter. But getEvent is defined as below:
getEvent :: Events -> IO Event
How does this work? I've tryied to do something similar and got the =
following error message (in GHC):
Couldn't match `Events' against `Window'
Expected type: Events
Inferred type: Window
In the first argument of `getEvent', namely `w'
In a do statement: e <- getEvent w
In time: my "Window" is defined as following
data Window =3D MkWindow {=20
win :: GLUT.Window, -- the real window
events :: Events -- the event stream
}
And in Hugs Graphics Library the "Window" is defined as:
data Window =3D MkWindow {
wnd :: WND, -- the real window
events :: Events, -- the event stream
graphic :: IORef (Draw ()) -- the current graphic
}
Thanks,
Andre
------=_NextPart_000_0010_01C0B72F.FA8770A0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>
<DIV>[Sorry about the previous email subject :) ]</DIV>
<DIV> </DIV>
<DIV>In Hugs Graphics Library, many procedures call =
the function=20
getEvent with a Window as the parameter. But getEvent is =
defined=20
as below:</DIV>
<DIV> </DIV>
<DIV>getEvent :: Events -> IO Event</DIV>
<DIV> </DIV>
<DIV>How does this work? I've tryied to do something similar and =
got the=20
following error message (in GHC):</DIV>
<DIV> </DIV>
<DIV> Couldn't match `Events' against=20
`Window'<BR> Expected type:=20
Events<BR> Inferred type:=20
Window<BR> In the first argument of `getEvent', namely =
`w'<BR> In a do statement: e <- getEvent =
w<BR></DIV>
<DIV>In time: my "Window" is defined as following</DIV>
<DIV> </DIV>
<DIV>data Window =3D MkWindow { <BR> =
win =20
:: GLUT.Window, -- the real window<BR> =
events ::=20
Events -- the event stream<BR> }</DIV>
<DIV> </DIV>
<DIV>And in Hugs Graphics Library the "Window" is defined as:</DIV>
<DIV> </DIV>
<DIV>data Window =3D MkWindow {</DIV>
<DIV> wnd ::=20
WND, -- the real=20
window<BR> events :: =
Events, --=20
the event stream<BR> graphic :: IORef (Draw ()) =
-- the=20
current graphic<BR> }<BR></DIV>
<DIV>Thanks,</DIV>
<DIV>Andre</DIV></FONT></DIV></FONT></DIV></BODY></HTML>
------=_NextPart_000_0010_01C0B72F.FA8770A0--
From christian.lescher@icn.siemens.de Wed Mar 28 09:30:04 2001
Date: Wed, 28 Mar 2001 11:30:04 +0200
From: Lescher Christian christian.lescher@icn.siemens.de
Subject: Difficulties compiling hmake / HaXml
I want to use HaXml, and since hmake is required first, I'm currently trying to build hmake with GHC. Unfortunately "make" fails; I get the above errors message.
What am I doing wrong here?
I use GHC4.08.2 (InstallShield version) under WinNT4/Cygwin1.1.8.
Christian
make[1]: Entering directory `/test-hmake/hmake-2.02/src/interpreter'
mkdir -p /test-hmake/hmake-2.02/targets/ix86-CYGWIN_NT-4.0/obj/interpreter
/test-hmake/hmake-2.02/script/hmake -ghc HInteractive -d/test-hmake/hmake-2.02/t
argets/ix86-CYGWIN_NT-4.0/obj/interpreter
Fail: Can't find module Posix in
.
Or in standard libraries at
/ghc/ghc-4.08.2/lib/imports/std
/ghc/ghc-4.08.2/lib/imports/data
/ghc/ghc-4.08.2/lib/imports/lang
/ghc/ghc-4.08.2/lib/imports/posix
/ghc/ghc-4.08.2/lib/imports/net
/ghc/ghc-4.08.2/lib/imports/num
/ghc/ghc-4.08.2/lib/imports/text
/ghc/ghc-4.08.2/lib/imports/util
/ghc/ghc-4.08.2/lib/imports/win32
/ghc/ghc-4.08.2/lib/imports/concurrent
Asked for by: HmakeConfig.hs
[Check settings of -I or -P flags?]
Stop - hmake dependency error.
make[1]: *** [/test-hmake/hmake-2.02/lib/ix86-CYGWIN_NT-4.0/HInteractive.exe] Er
ror 1
make[1]: Leaving directory `/test-hmake/hmake-2.02/src/interpreter'
make: *** [targets/ix86-CYGWIN_NT-4.0/hmake_g] Error 2
From rjljr2@yahoo.com Wed Mar 28 12:17:39 2001
Date: Wed, 28 Mar 2001 04:17:39 -0800 (PST)
From: Ronald Legere rjljr2@yahoo.com
Subject: getEvent Doubts
--- Andre W B Furtado <aw@free.elogica.com.br> wrote:
> [Sorry about the previous email subject :) ]
>
> In Hugs Graphics Library, many procedures call the
> function getEvent with a Window as the parameter.
> But getEvent is defined as below:
>
> getEvent :: Events -> IO Event
>
> How does this work? I've tryied to do something
> similar and got the following error message (in
> GHC):
Actually, this can't work (can it?).
So there must be another
getEvent :: Window -> IO Event.
(.i.e. Its sort of overloaded).
And so , there is at least one, in SOEGraphics.hs
getEvent window = getWindowEvent window
where getWindowEvent pulls out the Events from
a window and calls Events.getEvent :: Events-> IO
Event
(The getEvent :: Events-> IO Event is imported
qualified from GraphicsEvents.hs. I guess this was
done to avoid defining a type class, and probably
also because the end user doesnt need the
Events.getEvent, or at least very much)
Of course I am just speculating. I didnt write it :)
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/?.refer=text
From reid@cs.utah.edu Wed Mar 28 19:21:24 2001
Date: Wed, 28 Mar 2001 12:21:24 -0700
From: Alastair Reid reid@cs.utah.edu
Subject: getEvent Doubts
> Actually, this can't work (can it?).
> So there must be another
> getEvent :: Window -> IO Event.
> (.i.e. Its sort of overloaded).
> And so , there is at least one, in SOEGraphics.hs
> getEvent window = getWindowEvent window
Absolutely correct.
The SOEGraphics interface was frozen at the time that the School of Expression (SOE) book went to the printers. The HGL interface
has been updated (cleaned up and extended) since and SOEGraphics.hs is used to bridge the gap between the two interfaces. If you're
using SOE, you should rely on the book as your primary source of information about the interface. If you're not using SOE, I'd
recommend the HGL interface.
> where getWindowEvent pulls out the Events from
> a window and calls Events.getEvent :: Events-> IO Event
> (The getEvent :: Events-> IO Event is imported
> qualified from GraphicsEvents.hs. I guess this was
> done to avoid defining a type class, and probably
> also because the end user doesnt need the
> Events.getEvent, or at least very much)
More the latter than the former.
Hope this helps,
--
Alastair Reid
From ashley@semantic.org Thu Mar 29 09:46:59 2001
Date: Thu, 29 Mar 2001 01:46:59 -0800
From: Ashley Yakeley ashley@semantic.org
Subject: Parameterising Class Constraints in Existential Types
Is this valid (extended) Haskell?
--
class MyClass a b where
foo :: a -> b -> Int
data Special = forall b. (MyClass Int b)=> MkSpecial b
data General a = forall b. (MyClass a b)=> MkGeneral b
--
Hugs complains about the 'General' line but has no problem with the
'Special' line...
--
Ashley Yakeley, Seattle WA
From nozone@sbox.tu-graz.ac.at Thu Mar 29 16:54:01 2001
Date: Thu, 29 Mar 2001 18:54:01 +0200
From: Andreas Leitner nozone@sbox.tu-graz.ac.at
Subject: constants and functions without arguments
Hi,
I hope this is the right forum to post my question to.
Given a lazy pure functional language do we need to differntiate (in
syntax) between constants and functions without agruments? And if we
don't need to, does Haskell make a difference?
In a language with eager evaluation (let's take SML) we must
differentiat. Given we have a function that takes one argument of type
int, is different than a function that takes unit->int. Because of
that in SML, whenever I have a function (say "h") that takes an int,
and I want to apply a function (without arguments), let's call it g)
on it I need to add "()" at the end.
h g()
but for any constant i of type int I write:
h i
Now, this leads to my question: In a lazy language do I need to write
those "()", or could the compiler tell the difference and always do
the correct thing?
many thanks in advance,
Andreas
From Tom.Pledger@peace.com Thu Mar 29 22:15:00 2001
Date: Fri, 30 Mar 2001 10:15:00 +1200
From: Tom Pledger Tom.Pledger@peace.com
Subject: constants and functions without arguments
Andreas Leitner writes:
:
| Given a lazy pure functional language do we need to differntiate
| (in syntax) between constants and functions without agruments? And
| if we don't need to, does Haskell make a difference?
Haskell always treats a declaration of the form
foo = ...
as a pattern binding, not as a function binding. Sections 4.4.3 and
4.5 of the Haskell 98 report give more details.
So, in that sense, every function in Haskell takes an argument.
There's nothing to prevent you from adding a dummy parameter to turn a
constant (i.e. a simple pattern binding) into a function. The only
reason I've heard for doing so, is to work around the monomorphism
restriction.
HTH.
Tom
From dario.bahena@correo.unam.mx Fri Mar 30 05:33:05 2001
Date: Thu, 29 Mar 2001 23:33:05 -0600
From: dario.bahena@correo.unam.mx dario.bahena@correo.unam.mx
Subject: ffi & recursive data types
hi ...
I'm new in ffi stuff and tools like greencard.
Everything was working ok, until I wanted to:
translate a haskell recursive data type(list,trees,etc) into
a corresponding C type and back again.
How can I do this?
Thanks in advance
saludos
dario estepario ...
-------------------------------------------------
Obtén tu correo en www.correo.unam.mx
UNAMonos Comunicándonos
From simonpj@microsoft.com Fri Mar 30 07:57:16 2001
Date: Thu, 29 Mar 2001 23:57:16 -0800
From: Simon Peyton-Jones simonpj@microsoft.com
Subject: Parameterising Class Constraints in Existential Types
It seems reasonable to me, and GHC is happy.=20
Here's a working example:
Simon
class MyClass a b where
foo :: a -> b -> Int
data Special =3D forall b. (MyClass Int b)=3D> MkSpecial b
data General a =3D forall b. (MyClass a b)=3D> MkGeneral b
instance MyClass Int Bool where
foo x False =3D -x
foo x True =3D x
xs :: [General Int]
xs =3D [MkGeneral True, MkGeneral False]
main =3D print [foo (3::Int) x | MkGeneral x <- xs]
| -----Original Message-----
| From: Ashley Yakeley [mailto:ashley@semantic.org]
| Sent: 29 March 2001 10:47
| To: Haskell List
| Subject: Parameterising Class Constraints in Existential Types
|=20
|=20
| Is this valid (extended) Haskell?
|=20
| --
| class MyClass a b where
| foo :: a -> b -> Int
|=20
| data Special =3D forall b. (MyClass Int b)=3D> MkSpecial b
| data General a =3D forall b. (MyClass a b)=3D> MkGeneral b
| --
|=20
| Hugs complains about the 'General' line but has no problem with the=20
| 'Special' line...
|=20
| --=20
| Ashley Yakeley, Seattle WA
|=20
|=20
| _______________________________________________
| Haskell mailing list
| Haskell@haskell.org
| http://www.haskell.org/mailman/listinfo/haskell
|=20
From nozone@sbox.tu-graz.ac.at Fri Mar 30 10:25:16 2001
Date: Fri, 30 Mar 2001 12:25:16 +0200
From: Andreas Leitner nozone@sbox.tu-graz.ac.at
Subject: constants and functions without arguments
This is a multi-part message in MIME format.
--------------9A5E4CE57464CF0630C36C5F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Tom Pledger wrote:
>
> Andreas Leitner writes:
> :
> | Given a lazy pure functional language do we need to differntiate
> | (in syntax) between constants and functions without agruments? And
> | if we don't need to, does Haskell make a difference?
>
> Haskell always treats a declaration of the form
>
> foo = ...
>
> as a pattern binding, not as a function binding. Sections 4.4.3 and
> 4.5 of the Haskell 98 report give more details.
>
> So, in that sense, every function in Haskell takes an argument.
> There's nothing to prevent you from adding a dummy parameter to turn a
> constant (i.e. a simple pattern binding) into a function. The only
> reason I've heard for doing so, is to work around the monomorphism
> restriction.
Exactly thats' the reason for my question: Overcome ther monomorphism.
I come from an Eiffel background and there we have the uniform access
principle, which is a very important thing in that world. It means
that you access an attribute just like a function with no parameters.
This is actually a form of information hiding as you can change the
underlying implementation (an attribute to a function and vice versa).
The classic examlple for this is class POINT, which has an interface
like that:
--
POINT
-- group 1
x: DOUBLE
y: DOUBLE
-- group 2
rho: DOUBLE
abs: DOUBLE
--
Now, you can choose to either implement group 1 as attributes, or
group 2 and calculate the other one. With the uniform access
principle, which says that accessing attributes and functions with no
arguments happen in the same syntactic way, you can change the
implementaion without notice. No user of this class needs to know.
I am to new to FP to say whether this is equaly important in
FP-languages, since the semantics are different (constants vs.
attributes and immutable values vs. objects), but for now I am just
currious wether it is possible theoretically.
I mean couldn't one say that there are no constants, just functions
with no arguments or the Void/Unit argument that return an expression.
Since we have lazy evaluation, there won't be a problem at runtime,
but would the type system allow such a thing?
tia,
Andreas
--------------9A5E4CE57464CF0630C36C5F
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
X-Mozilla-Status2: 00000000
Message-ID: <3AC45E6E.AC2DC3C2@sbox.tu-graz.ac.at>
Date: Fri, 30 Mar 2001 12:22:38 +0200
From: Andreas Leitner <nozone@sbox.tu-graz.ac.at>
X-Mailer: Mozilla 4.75 [en] (X11; U; Linux 2.2.17 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: Tom Pledger <Tom.Pledger@peace.com>
Subject: Re: constants and functions without arguments
References: <3AC368A9.5BE8721F@sbox.tu-graz.ac.at> <15043.46052.112130.797961@waytogo.peace.co.nz>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Tom Pledger wrote:
>
> Andreas Leitner writes:
> :
> | Given a lazy pure functional language do we need to differntiate
> | (in syntax) between constants and functions without agruments? And
> | if we don't need to, does Haskell make a difference?
>
> Haskell always treats a declaration of the form
>
> foo = ...
>
> as a pattern binding, not as a function binding. Sections 4.4.3 and
> 4.5 of the Haskell 98 report give more details.
>
> So, in that sense, every function in Haskell takes an argument.
> There's nothing to prevent you from adding a dummy parameter to turn a
> constant (i.e. a simple pattern binding) into a function. The only
> reason I've heard for doing so, is to work around the monomorphism
> restriction.
Exactly thats' the reason for my question: Overcome ther monomorphism.
I come from an Eiffel background and there we have the uniform access
principle, which is a very important thing in that world. It means
that you access an attribute just like a function with no parameters.
This is actually a form of information hiding as you can change the
underlying implementation (an attribute to a function and vice versa).
The classic examlple for this is class POINT, which has an interface
like that:
--
POINT
-- group 1
x: DOUBLE
y: DOUBLE
-- group 2
rho: DOUBLE
abs: DOUBLE
--
Now, you can choose to either implement group 1 as attributes, or
group 2 and calculate the other one. With the uniform access
principle, which says that accessing attributes and functions with no
arguments happen in the same syntactic way, you can change the
implementaion without notice. No user of this class needs to know.
I am to new to FP to say whether this is equaly important in
FP-languages, since the semantics are different (constants vs.
attributes and immutable values vs. objects), but for now I am just
currious wether it is possible theoretically.
I mean couldn't one say that there are no constants, just functions
with no arguments or the Void/Unit argument that return an expression.
Since we have lazy evaluation, there won't be a problem at runtime,
but would the type system allow such a thing?
tia,
Andreas
--------------9A5E4CE57464CF0630C36C5F--
From jigg@ugr.es Fri Mar 30 10:42:02 2001
Date: Fri, 30 Mar 2001 12:42:02 +0200
From: Juan Ignacio =?iso-8859-1?Q?Garc=EDa=20Garc=EDa?= jigg@ugr.es
Subject: communication between thread
Hello,
I am using the library oncurrent of GHC. I'd like to know how two
different threads can communicate each other.
To solve the problem I thought in something like a global variable. If
there any method to avoid the use of that kind of variables in haskell.
Thanks in advance
J. I. García
From simonmar@microsoft.com Fri Mar 30 11:47:20 2001
Date: Fri, 30 Mar 2001 12:47:20 +0100
From: Simon Marlow simonmar@microsoft.com
Subject: communication between thread
> I am using the library oncurrent of GHC. I'd like to know how two
> different threads can communicate each other.=20
> To solve the problem I thought in something like a global variable. If
> there any method to avoid the use of that kind of variables=20
> in haskell.
You can use the various concurrent data structures in the Concurrent
library. See:
=20
http://www.haskell.org/ghc/docs/latest/set/sec-concurrency-abstractions.
html
The simplest form of communication is through an MVar, which is a
thread-safe mutable variable.
Cheers,
Simon
From lennart@mail.augustsson.net Fri Mar 30 12:18:44 2001
Date: Fri, 30 Mar 2001 07:18:44 -0500
From: Lennart Augustsson lennart@mail.augustsson.net
Subject: constants and functions without arguments
Andreas Leitner wrote:
> Hi,
>
> I hope this is the right forum to post my question to.
>
> Given a lazy pure functional language do we need to differntiate (in
> syntax) between constants and functions without agruments? And if we
> don't need to, does Haskell make a difference?
>From a pedantic point of view your question makes no sense. The definition
of a function is something that takes an argument and transforms it to a
result. So a function always has exactly one argument. Period.
But from a practical point of view, yes you can regard constants as functions
with no arguments. And it makes sense from a syntactic point of view:
f0 = e0
f1 x = e1
f2 x y = e2
f3 x y z = e3
...
-- Lennart
From ltaesch@europemail.com Fri Mar 30 13:01:32 2001
Date: Fri, 30 Mar 2001 08:01:32 -0500
From: Luc taecsh ltaesch@europemail.com
Subject: beginners silly question
<intro>
Ive just decided to start with haskell (after a decade of OO, and a few month
of erlang (already impressive))
despite i love linux, id like to stay with wintel, to be able to use it at the
office, and try to slot it in my daily job, slowly.
(doing some modeling, should be useful)
</intro>
1)are there a full package of haskell over there ?
2)ive installed hugs, SOE libs, haxml, frantk, tcl/tk, g/hood, hdoc, and
jcreator
what am i missing ?
any incompatiblities +98 -98, and so on ?
3)if i get some good stuff done, id like to compile them , as small
utilitaries. (best way to turn H in my daily job)
my first try at ghc was not that fun (deppendencies on gcc, libs, and so on)
as a alternative, ive tried under linux (m7.2),where ghc is installed by
default, but even here , were i was expecting fluentness, its not cristal
clear, hangs, missing bits i dont understand. no samples/ demo ? or is it a
packaging issue ?
<whining>
4) generally, are there any project to have some ready to use all-included
package ? i understans some effort are under way on the great lib side, but
are there anything avaialble now (its still farther than for me)
for info, in the eiffel world, some guy (elj) once tried to put all the stuff
together in a click and install package, and it really helped the gnu eiffel
stuff starting in win world, (where things are not so simple , when unix is
assumed with gnu stuffs...)
(if some think answering DIY, just think its what effectivelly happen^s
everytime, everywhere in the world someone goes beyong haskell.org front
page... but all u haskell people are too smart for me to mention that.. ;-)
</whining>
From karczma@info.unicaen.fr Fri Mar 30 15:01:25 2001
Date: Fri, 30 Mar 2001 16:01:25 +0100
From: Jerzy Karczmarczuk karczma@info.unicaen.fr
Subject: constants and functions without arguments
Andreas Leitner wrote at the end of his discussion about
constants/functions sans arguments:
> I mean couldn't one say that there are no constants, just functions
> with no arguments or the Void/Unit argument that return an expression.
> Since we have lazy evaluation, there won't be a problem at runtime,
> but would the type system allow such a thing?
Lennart Augustsson:
> From a pedantic point of view your question makes no sense.
> The definition of a function is something that takes an argument
> and transforms it to a result. So a function always has exactly
> one argument. Period.
>
> But from a practical point of view, yes you can regard constants
> as functions with no arguments. And it makes sense from a syntactic
> point of view:
...
There are different kinds of pedantry.
In Clean there are constants-constants, and constants-functions,
or rather unevaluated graphs, and an assignment
x = expr
may mean something different from
x =: expr
If expr produces a loooong lazy structure, sometimes treating it
as an unevaluated thunk (or not reduced graph) is better than
having the "final" result, although in a pure functional language
there are no differences.
This is another problem, most probably beyond what interests A. L.,
but as you see, people think about such things.
Jerzy Karczmarczuk
Caen, France
From nordland@cse.ogi.edu Fri Mar 30 20:07:55 2001
Date: Fri, 30 Mar 2001 12:07:55 -0800
From: Johan Nordlander nordland@cse.ogi.edu
Subject: Parameterising Class Constraints in Existential Types
Hi Ashley,
Hugs currently restricts the way constrained existential types
may be formed, for entirely internal, technical reasons. We're
currently looking over the implementation to see if it's
possible to lift the restriction without rewriting substantial
parts of the type checker.
-- Johan
On Thursday, March 29, 2001, at 01:46 AM, Ashley Yakeley wrote:
> Is this valid (extended) Haskell?
>
> --
> class MyClass a b where
> foo :: a -> b -> Int
>
> data Special = forall b. (MyClass Int b)=> MkSpecial b
> data General a = forall b. (MyClass a b)=> MkGeneral b
> --
>
> Hugs complains about the 'General' line but has no problem with the
> 'Special' line...
>
> --
> Ashley Yakeley, Seattle WA
>
>
> _______________________________________________
> Haskell mailing list
> Haskell@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell
>
From 2003250@mail.escuelaing.edu.co Fri Mar 30 22:26:53 2001
Date: Fri, 30 Mar 2001 17:26:53 -0500 (COT)
From: Maldonado Castiblanco Camilo Ernesto 2003250@mail.escuelaing.edu.co
Subject: question class tree
I need a class tree for haskell. where can i find it?
From fis@ssh.com Sat Mar 31 09:20:18 2001
Date: 31 Mar 2001 12:20:18 +0300
From: Matthias Fischmann fis@ssh.com
Subject: question class tree
Cris Okasaki [http://www.cs.columbia.edu/~cdo] has written tons of
papers on functional data structures, I guess you can steal code from
there. There was also a file containing all the examples from his
book `Purely Functional Data Structures' (Cambridge University Press,
1998, and everybody sais it's a must although I haven't seen it yet).
Unfortunately, I could not find it any more.
Matthias
Maldonado Castiblanco Camilo Ernesto <2003250@mail.escuelaing.edu.co> writes:
> I need a class tree for haskell. where can i find it?
>
>
> _______________________________________________
> Haskell mailing list
> Haskell@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell
>
--
Matthias Fischmann | Research Engineer | +358 (9) 8565 7474
fis@ssh.fi | SSH Communication Security Corp | +358 (40) 752 5291
From rjljr2@yahoo.com Sat Mar 31 14:44:59 2001
Date: Sat, 31 Mar 2001 06:44:59 -0800 (PST)
From: Ronald Legere rjljr2@yahoo.com
Subject: FFI tutorial??
--- "Manuel M. T. Chakravarty" <chak@cse.unsw.edu.au>
wrote:
** about the various interface generators
> You see - the Haskell developers believe in choice
> ;-)
>
> Cheers,
> Manuel
I guess I have mixed feelings about all the choices.
Choices mean you can pick the best one for the job,
but it also means more to learn. Which also is good
and bad :):)
I suppose for the moment I will try to HDirect
and KDirect, as I would like to get a bit into
understanding how TCLhaskell is implemented. Cheers!
Thanks again for the pointers,Wojciech and Manuel !
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/?.refer=text
From rjljr2@yahoo.com Sat Mar 31 14:48:16 2001
Date: Sat, 31 Mar 2001 06:48:16 -0800 (PST)
From: Ronald Legere rjljr2@yahoo.com
Subject: A GUI toolkit looking for a friend
--- Simon Peyton-Jones <simonpj@microsoft.com> wrote:
> Gentle Haskellers
Did Clean IO ever find a friend? I wish I had the
time and abilities myself, as it does sound
interesting. I am still trying to get FFI stuff
working.
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/?.refer=text
From qrczak@knm.org.pl Sat Mar 31 20:18:23 2001
Date: 31 Mar 2001 20:18:23 GMT
From: Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl
Subject: HaXml (was: Re: Welcome to the "Haskell" mailing list)
Thu, 22 Mar 2001 21:19:45 +0000, Malcolm Wallace <Malcolm.Wallace@cs.york.ac.uk> pisze:
> "with" is a perfectly valid Haskell function name, but Hugs may have
> stolen it for a language extension. Try giving Hugs the +98 option
> at startup, to ensure that all extensions are turned off. [Note to
> users of the implicit parameter extension: I believe in future the
> pseudo-keyword "with" will be removed and replaced by "let".]
I would like to replace "with" with "let" too. But SimonPJ said he
won't do it in ghc unless Hugs does it too, and Mark P Jones said
he won't do it in Hugs now (without deep reasons: no people/hours
to do that, and no plans to release next Hugs version this year).
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK
From senganb@ia.nsc.com Thu Mar 1 00:07:43 2001
From: senganb@ia.nsc.com (senganb@ia.nsc.com)
Date: Wed, 28 Feb 2001 17:07:43 -0700 (MST)
Subject: My stack overflow was due to addListToFM
Message-ID: <200103010007.RAA25137@ia.nsc.com>
Hi,
Interestingly given the recent discussion about foldl versus foldl'
I'd like to report that the stack overflow I was seeing was due to
addListToFM which is defined using foldl although addToFM is strict
in FiniteMap according to ghc:
addToFM :: ... {PrelBase.Ord key} -> FiniteMap key elt -> key -> elt -> FiniteMap key elt {-## __A 4 __S LSLL __U ...
So, I'd like to request that FiniteMap be changed to use foldl'.
Compiler implementors, I'd also like to request that your compiler
emit a warning in such cases if at all possible given that this has
since even the best haskell programmers seem to miss this case
(the authors of FiniteMap).
---------------------------------------------------------------------------------
For those of you wondering how I found this, I used the following heuristic:
1 Build your program with -prof -auto-all -caf-all
2 Run your program with -h so that Main.hp is created.
3 Then look at the various functions that are reported to use a lot of heap.
4 Grep through Main.hp for the function that happens to have a recent rapid increase of heap.
5 Then look at its code.
In my case I got
find_atoms/add_atom_equalities 33808
find_atoms/add_atom_equalities 186128
find_atoms/add_atom_equalities 338448
find_atoms/add_atom_equalities 490768
find_atoms/add_atom_equalities 643088
find_atoms/add_atom_equalities 795408
find_atoms/add_atom_equalities 947728
find_atoms/add_atom_equalities 1100048
find_atoms/add_atom_equalities 1233976
find_atoms/add_atom_equalities 1302328
find_atoms/add_atom_equalities 1370680
find_atoms/add_atom_equalities 1439032
find_atoms/add_atom_equalities 1507384
find_atoms/add_atom_equalities 1575736
find_atoms/add_atom_equalities 1644088
find_atoms/add_atom_equalities 1697552
just before the crash.
Reasoning
---------
Since GHC optimizes tail recursion, the cause of a stack overflow must be something else, eg:
a you've got a non-tail recursive function
b your tail recursive function has built a long spine on the heap of functions that are strict in their 2cd argument
so that you need to evaluate the bottom-most element of the spine (which causes you to push the address
of all the functions along the spine onto the stack)
c or...
I assumed b since I know my code doesn't contain many cases of a.
If b is the case, since the function that is overflowing is being evaluated,
we know that it's going to build up its spine quickly and then try to evalute it,
find that each function on the spine is strict in its second argument and then die. Therefore heuristic step 4.
You also need it to use a fair bit of heap to actually be bad enough to overflow the stack (therefore heuristic step 3).
Sengan
From proff@iq.org Thu Mar 1 02:25:46 2001
From: proff@iq.org (Julian Assange)
Date: 01 Mar 2001 13:25:46 +1100
Subject: interesting example of lazyness/ghc optimisation
Message-ID:
Brian Gregor wrote a haskell entrant for the random number
generation in Doug's language shootout
(http://www.bagley.org/~doug/shootout). Which is as follows:
module Main where
import System
import Numeric
iMi :: Int
iMi = 139968
iMd :: Double
iMd = 139968.0
iA ::Int
iA = 3877
iC ::Int
iC = 29573
nrRandom :: Int -> Double -> (Int,Double)
nrRandom last max = (newlast,(max * (fromIntegral newlast)/iMd))
where newlast = (last*iA+iC) `mod` iMi
runRandom :: Int -> Double -> Int -> Double
runRandom last max num
| num > 1 = runRandom (fst new) max (num-1)
| otherwise = snd new
where
new = nrRandom last max
main = do
~[n] <- getArgs
putStrLn (showFFloat (Just 12) (runRandom 42 100.0 (read n::Int)) "")
Noticing the use of tuples and normalisation at each step of
the iteration, I re-wrote this as:
module Main(main) where
import System(getArgs)
import Numeric(showFFloat)
main = do
~[n] <- getArgs
putStrLn (showFFloat (Just 12) (random 42 (read n::Int) 100.0) "")
return 1
random :: Int -> Int -> Double -> Double
random seed n max = norm (rand n seed) max
where norm x max = (fromIntegral x) * (max / imd)
rand n x = if n > 0 then rand (n-1) ((x * ia + ic) `mod` im) else x
im = 139968
imd = fromIntegral im
ia = 3877
ic = 29573
Interestingly, ghc / lazyness is able to detect that Brian's
normalisation etc at each step is uneeded, and only perform it at the
end. Consequently both of these programs are the the same speed (well,
almost; bizarrely, Brian's seems to be about 2% faster).
Julian.
From ketil@ii.uib.no Thu Mar 1 07:13:47 2001
From: ketil@ii.uib.no (Ketil Malde)
Date: 01 Mar 2001 08:13:47 +0100
Subject: interesting example of lazyness/ghc optimisation
In-Reply-To: Julian Assange's message of "01 Mar 2001 13:25:46 +1100"
References:
Message-ID:
There's something that I've been wanting to ask sombody about, since
it isn't terribly clear to me. Blatantly hijacking a function from
Julian's code:
> runRandom last max num
> | num > 1 = runRandom (fst new) max (num-1)
> | otherwise = snd new
While ifs are perhaps more intuitive when there are only two choices
(like here!), and pattern matching matches on the type of arguments
and not (only) their values,
What's the difference between the pipe-syntax, and a case statement,
i.e. writing the function as
runRandom last max num = case num of
1 -> runRandom ....
otherwise -> snd new
Is there a practical difference, and if not, why are there two ways to
skin this particular cat?
Apologies for coming up with a terribly naive question, but I've
looked in the HR without gaining much wisdom (beyond the recipe for
translating if to case).
-kzm
--
If I haven't seen further, it is by standing in the footprints of giants
From laszlo@ropas.kaist.ac.kr Thu Mar 1 07:37:58 2001
From: laszlo@ropas.kaist.ac.kr (Laszlo Nemeth)
Date: Thu, 1 Mar 2001 16:37:58 +0900 (KST)
Subject: interesting example of laziness/ghc optimisation
In-Reply-To: (message from Ketil
Malde on 01 Mar 2001 08:13:47 +0100)
References:
Message-ID: <200103010737.QAA16627@ropas.kaist.ac.kr>
* * * Ketil Malde wrote:
> > runRandom last max num
> > | num > 1 = runRandom (fst new) max (num-1)
> > | otherwise = snd new
>
> What's the difference between the pipe-syntax, and a case statement,
> i.e. writing the function as
>
> runRandom last max num = case num of
> 1 -> runRandom ....
> otherwise -> snd new
There is no difference. The 'pipe-syntax' (or pattern guards) gets
desugared (by the pattern matching compiler) to case statements i.e.:
runRandom = \ last max num.case (num > 1) of
True -> runRandom (fst new) max (num-1)
False -> snd new
For a more detailed discussion see SPJ's book, Augustsson original
paper, or M Pettersen't thesis (LNCS 1549).
HTH,
--laszlo
From ketil@ii.uib.no Thu Mar 1 08:40:48 2001
From: ketil@ii.uib.no (Ketil Malde)
Date: 01 Mar 2001 09:40:48 +0100
Subject: Pattern guards vs. case (was, unfortunately :Re: interesting example of laziness/ghc optimisation)
In-Reply-To: Laszlo Nemeth's message of "Thu, 1 Mar 2001 16:37:58 +0900 (KST)"
References:
<200103010737.QAA16627@ropas.kaist.ac.kr>
Message-ID:
(Apologies, I forgot to change the subject)
Laszlo Nemeth writes:
> * * * Ketil Malde wrote:
> There is no difference. The 'pipe-syntax' (or pattern guards) gets
> desugared (by the pattern matching compiler) to case statements i.e.:
> runRandom = \ last max num.case (num > 1) of
> True -> runRandom (fst new) max (num-1)
> False -> snd new
But - the converse is not true, is it? I can write
... = case foo of
(Foo f) -> ...
(Bar b) -> ...
but I can't express that as a pattern-guarded expression, can I? My
impression here is that the PG syntax adds nothing, and is hardly any
more readable, and less intuitive for migrators from more traditional
language. Why is it there at all? Is there a (rough) guideline for
when to use one or the other?
> For a more detailed discussion see SPJ's book, Augustsson original
> paper, or M Pettersen't thesis (LNCS 1549).
Okay, I'll try to look them up.
-kzm
--
If I haven't seen further, it is by standing in the footprints of giants
From john@foo.net Thu Mar 1 09:06:36 2001
From: john@foo.net (John Meacham)
Date: Thu, 1 Mar 2001 01:06:36 -0800
Subject: Pattern guards vs. case (was, unfortunately :Re: interesting example of laziness/ghc optimisation)
In-Reply-To: ; from ketil@ii.uib.no on Thu, Mar 01, 2001 at 09:40:48AM +0100
References: <200103010737.QAA16627@ropas.kaist.ac.kr>
Message-ID: <20010301010636.B21799@mark.ugcs.caltech.edu>
On Thu, Mar 01, 2001 at 09:40:48AM +0100, Ketil Malde wrote:
>
> (Apologies, I forgot to change the subject)
>
> Laszlo Nemeth writes:
>
> > * * * Ketil Malde wrote:
>
> > There is no difference. The 'pipe-syntax' (or pattern guards) gets
> > desugared (by the pattern matching compiler) to case statements i.e.:
>
> > runRandom = \ last max num.case (num > 1) of
> > True -> runRandom (fst new) max (num-1)
> > False -> snd new
>
> But - the converse is not true, is it? I can write
>
> ... = case foo of
> (Foo f) -> ...
> (Bar b) -> ...
>
> but I can't express that as a pattern-guarded expression, can I? My
> impression here is that the PG syntax adds nothing, and is hardly any
> more readable, and less intuitive for migrators from more traditional
> language. Why is it there at all? Is there a (rough) guideline for
> when to use one or the other?
this is because pattern guards are not the same as case statements, they
do not do matching and deconstruction of values, but rather are boolean
expressions to be checked _in order_ to determine whether to use that
function body or not.
imagine
f n | n < 0 = -1
f n | n < 5 = 1
f n = 2
this cannot be expressed as a single case statement because you cannot
match 'n' against an expression. (just like you cannot deconstruct a
value in a boolean expression as your above example demonstrates)
this translates to nested if statements rather than a single case
statement. what is confusing is that if statements can be constructed
from case statements too... the above translates to
f n = if n < 0 then -1 else if n < 5 then 1 else 2
or in case notation
case n < 0 of
True -> -1
False -> case n < 5 of
True -> 1
False -> 2
note you will need many nested case statements to deal with patter
guards, they are not equivalent to a single case statement.
in the core language 'case' is the ONLY alternation primitive so
everything can translate to it at some point. pattern guards are useful
because otherwise you end up with heavily nested if or case statements
which are definately less readable than the pattern-guard syntax.
hint: read '|' as 'such that' so
f n | n < 0 = ... reads "f of n such that n is less than zero is
..."
note also that the vertical bar interpreted in this way also
has mathematical precident so its not completely arbitrary.
Hope this helps and that I am not utterly wrong :)
John
--
--------------------------------------------------------------
John Meacham http://www.ugcs.caltech.edu/~john/
California Institute of Technology, Alum. john@foo.net
--------------------------------------------------------------
From Malcolm.Wallace@cs.york.ac.uk Thu Mar 1 09:13:44 2001
From: Malcolm.Wallace@cs.york.ac.uk (Malcolm Wallace)
Date: Thu, 1 Mar 2001 09:13:44 +0000
Subject: Pattern guards vs. case
In-Reply-To:
Message-ID:
> runRandom last max num
> | num > 1 = runRandom (fst new) max (num-1)
> | otherwise = snd new
> What's the difference between the pipe-syntax, and a case statement,
> i.e. writing the function as
> runRandom last max num = case num of
> 1 -> runRandom ....
> otherwise -> snd new
Eeek! This is not the same function! (num>1) =/= (num==1)
Oh, and it isn't type-correct either.
Try:
runRandom last max num = case num>1 of
True -> runRandom ....
otherwise -> snd new
Oops. No. Try again:
runRandom last max num = case num>1 of
True -> runRandom ....
False -> snd new
That's better. These transformations by hand can be tricky, huh?
Regards,
Malcolm
From laszlo@ropas.kaist.ac.kr Thu Mar 1 10:43:04 2001
From: laszlo@ropas.kaist.ac.kr (Laszlo Nemeth)
Date: Thu, 1 Mar 2001 19:43:04 +0900 (KST)
Subject: Pattern guards vs. case (was, unfortunately :Re: interesting example of laziness/ghc optimisation)
In-Reply-To: (message from Ketil
Malde on 01 Mar 2001 09:40:48 +0100)
References:
<200103010737.QAA16627@ropas.kaist.ac.kr>
Message-ID: <200103011043.TAA17620@ropas.kaist.ac.kr>
* * * Ketil Malde wrote:
> ut - the converse is not true, is it? I can write
>
> ... = case foo of
> (Foo f) -> ...
> (Bar b) -> ...
>
> ut I can't express that as a pattern-guarded expression, can I?
You probably have already seen John's reply which pretty much says
everything. But if you want to be really weird you can write something
like (I haven't typed this in):
f x | (Foo _) == x =
f x | (Bar _) == x =
which doesn't buy you anything because it doesn't bind the argument of
Foo to anything. There were a couple of messages a year or so ago
about what can be done with pattern matching and I recall Simon Marlow
posted a few puzzling examples.
> Why is it there at all? Is there a (rough) guideline for when to
> use one or the other?
Sugar ... but I think in this case is not the 'unhealthy' variety. As
John noted, without it you would have to write nested case statements
which is cumbersome and may lead to suboptimal code i.e. code
duplication and repeated tests (assuming later stages of your compiler
doesn't rearrange the code). In fact, the entire issue of compilation
of pattern matching arises from the desire to select the appropriate
rhs with the minimum number of tests.
Rough guideline? I use guards whenever I can (which means not at all
these days since SML sadly lacks guards (for a good reason!)), because
I find it easy to read it and I hope that a clever pattern matching
compiler takes advantage of the extra information.
--laszlo
From joe@isun.informatik.uni-leipzig.de Thu Mar 1 10:52:33 2001
From: joe@isun.informatik.uni-leipzig.de (Johannes Waldmann)
Date: Thu, 1 Mar 2001 11:52:33 +0100 (MET)
Subject: Pattern guards vs. case (was, unfortunately :Re: interesting example
of laziness/ghc optimisation)
In-Reply-To: <200103011043.TAA17620@ropas.kaist.ac.kr> from Laszlo Nemeth at
"Mar 1, 2001 07:43:04 pm"
Message-ID: <200103011052.LAA18219@isun11.informatik.uni-leipzig.de>
> But if you want to be really weird you can write something
> like (I haven't typed this in):
>
> f x | (Foo _) == x =
> f x | (Bar _) == x =
no, you can't, e. g. hugs (Feb 2000) says
Prelude> let f x | Just 4 == x = 0 in f (Just 4)
0
Prelude> let f x | Just _ == x = 0 in f (Just 4)
ERROR: Illegal `_' in expression
--
-- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ --
-- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 --
From laszlo@ropas.kaist.ac.kr Thu Mar 1 11:25:28 2001
From: laszlo@ropas.kaist.ac.kr (Laszlo Nemeth)
Date: Thu, 1 Mar 2001 20:25:28 +0900 (KST)
Subject: Pattern guards vs. case (was, unfortunately :Re: interesting example
of laziness/ghc optimisation)
In-Reply-To: <200103011052.LAA18219@isun11.informatik.uni-leipzig.de> (message
from Johannes Waldmann on Thu, 1 Mar 2001 11:52:33 +0100 (MET))
References: <200103011052.LAA18219@isun11.informatik.uni-leipzig.de>
Message-ID: <200103011125.UAA17785@ropas.kaist.ac.kr>
* * * Johannes Waldmann wrote:
> > But if you want to be really weird you can write something
> > like (I haven't typed this in):
> >
> > f x | (Foo _) == x =
> > f x | (Bar _) == x =
>
> no, you can't, e. g. hugs (Feb 2000) says
>
> Prelude> let f x | Just 4 == x = 0 in f (Just 4)
> 0
> Prelude> let f x | Just _ == x = 0 in f (Just 4)
> ERROR: Illegal `_' in expression
So it works with (Just 4), but it doesn't with (Just _)? I can't see
anything in the syntax (Haskell report pg 127, 128) which rules the
second one out. Though, I'd try it with parenthesis. Shall we call it
a bug (unless I am missing something obvious)?
--laszlo
From Christian.Brolin@carmen.se Thu Mar 1 15:41:15 2001
From: Christian.Brolin@carmen.se (Christian Brolin)
Date: Thu, 01 Mar 2001 16:41:15 +0100
Subject: interesting example of lazyness/ghc optimisation
References:
Message-ID: <3A9E6D9B.B7987AE8@carmen.se>
Ketil Malde wrote:
>
> There's something that I've been wanting to ask sombody about, since
> it isn't terribly clear to me. Blatantly hijacking a function from
> Julian's code:
>
> > runRandom last max num
> > | num > 1 = runRandom (fst new) max (num-1)
> > | otherwise = snd new
>
> While ifs are perhaps more intuitive when there are only two choices
> (like here!), and pattern matching matches on the type of arguments
> and not (only) their values,
>
> What's the difference between the pipe-syntax, and a case statement,
> i.e. writing the function as
>
> runRandom last max num = case num of
> 1 -> runRandom ....
> otherwise -> snd new
>
> Is there a practical difference, and if not, why are there two ways to
> skin this particular cat?
You shouldn't compare case expressions with guards. Guards are used
together with patterns, while case expressions are using patterns.
Hence, it is possible to use guards in case expressions. The question is
why *patterns* are allowed with function definitions. I guess the answer
is syntax sugar.
example:
f [a] | a>0 = 1
| a<0 = 2
f _ = 3 -- [], [0], [a:as]
Can be written as:
f x = case x of
[a] | a>0 -> 1
| a<0 -> 2
_ -> 3
--
Christian Brolin
From ger@tzi.de Thu Mar 1 15:58:53 2001
From: ger@tzi.de (George Russell)
Date: Thu, 01 Mar 2001 16:58:53 +0100
Subject: interesting example of lazyness/ghc optimisation
Message-ID: <3A9E71BD.94B53C1C@tzi.de>
I hope nobody actually uses this random number generator. It appears
to be linear congruential with period less than 140000. The author
of these benchmarks seem to have got this algorithm from "Numerical
Recipes", whose code (at least, in the early editions)
has come in for some very heavy criticism:
http://math.jpl.nasa.gov/nr/nr.html
I would take these benchmarks more seriously if "random" implied
a slightly more modern algorithm, like the Mersenne Twister
(which has been implemented in Haskell I believe).
Julian Assange wrote:
> Noticing the use of tuples and normalisation at each step of
> the iteration, I re-wrote this as:
>
> module Main(main) where
> import System(getArgs)
> import Numeric(showFFloat)
>
> main = do
> ~[n] <- getArgs
> putStrLn (showFFloat (Just 12) (random 42 (read n::Int) 100.0) "")
> return 1
>
> random :: Int -> Int -> Double -> Double
> random seed n max = norm (rand n seed) max
> where norm x max = (fromIntegral x) * (max / imd)
> rand n x = if n > 0 then rand (n-1) ((x * ia + ic) `mod` im) else x
> im = 139968
> imd = fromIntegral im
> ia = 3877
> ic = 29573
From ralf@informatik.uni-bonn.de Thu Mar 1 09:31:20 2001
From: ralf@informatik.uni-bonn.de (Ralf Hinze)
Date: Thu, 01 Mar 2001 10:31:20 +0100
Subject: 2001 Haskell Workshop: 1st call for papers
Message-ID: <3A9E16E8.B696DEAD@informatik.uni-bonn.de>
============================================================================
FIRST CALL FOR PAPERS
[Deadline for submission: 1st June 2001]
2001 Haskell Workshop
Firenze, Italy, 2nd September 2001
The Haskell Workshop forms part of the PLI 2001 colloquium
on Principles, Logics, and Implementations of high-level
programming languages, which comprises the ICFP/PPDP conferences
and associated workshops. Previous Haskell Workshops have been
held in La Jolla (1995), Amsterdam (1997), Paris (1999), and
Montreal (2000).
http://www.cs.uu.nl/people/ralf/hw2001.{html,pdf,ps,txt}
============================================================================
Scope
-----
The purpose of the Haskell Workshop is to discuss experience with
Haskell, and possible future developments for the language. The scope
of the workshop includes all aspects of the design, semantics, theory,
application, implementation, and teaching of Haskell. Submissions that
discuss limitations of Haskell at present and/or propose new ideas for
future versions of Haskell are particularly encouraged. Adopting an
idea from ICFP 2000, the workshop also solicits two special classes of
submissions, application letters and functional pearls, described
below.
Application Letters
-------------------
An application letter describes experience using Haskell to solve
real-world problems. Such a paper might typically be about six pages,
and may be judged by interest of the application and novel use of
Haskell.
Functional Pearls
-----------------
A functional pearl presents - using Haskell as a vehicle - an idea that
is small, rounded, and glows with its own light. Such a paper might
typically be about six pages, and may be judged by elegance of
development and clarity of expression.
Submission details
------------------
Deadline for submission: 1st June 2001
Notification of acceptance: 1st July 2001
Final submission due: 1st August 2001
Haskell Workshop: 2nd September 2001
Authors should submit papers of at most 12 pages, in postscript format,
formatted for A4 paper, to Ralf Hinze (ralf@cs.uu.nl) by 1st June
2001. The use of the ENTCS style files is strongly recommended.
Application letters and functional pearls should be labeled as such on
the first page. They may be any length up to twelve pages, though
shorter submissions are welcome. The accepted papers will be published
as a University of Utrecht technical report.
Programme committee
-------------------
Manuel Chakravarty University of New South Wales
Jeremy Gibbons University of Oxford
Ralf Hinze (chair) University of Utrecht
Patrik Jansson Chalmers University
Mark Jones Oregon Graduate Institute
Ross Paterson City University, London
Simon Peyton Jones Microsoft Research
Stephanie Weirich Cornell University
============================================================================
From slucas@dsic.upv.es Fri Mar 2 10:13:45 2001
From: slucas@dsic.upv.es (Salvador Lucas Alba)
Date: Fri, 02 Mar 2001 11:13:45 +0100
Subject: WRS'2001 - Extended deadline
Message-ID: <3A9F7258.AB3BC9D9@dsic.upv.es>
[Apologies for multiple copies of this announcement]
**************************************************************************
******* Last call for papers - extended deadline: March 12, 2001 *******
**************************************************************************
International Workshop on Reduction Strategies in Rewriting and
Programming (WRS 2001)
held in conjunction with RTA 2001
Utrecht, The Netherlands, May 26, 2001
--------------------------------------------------------------------------
BACKGROUND AND AIMS
Reduction strategies in rewriting and programming have attracted an
increasing attention within the last years. New types of reduction
strategies have been invented and investigated, and new results on
rewriting / computation under particular strategies have
been obtained. Research in this field ranges from primarily theoretical
questions about reduction strategies to very practical application and
implementation issues. The need for a deeper understanding of reduction
strategies in rewriting and programming, both in theory and practice,
is obvious, since they bridge the gap between unrestricted general
rewriting (computation) and (more deterministic) rewriting with
particular strategies (programming). Moreover, reduction strategies
provide a natural way to go from operational principles (e.g., graph
and term rewriting, narrowing, lambda-calculus) and semantics (e.g.,
normalization, computation of values, infinitary normalization,
head-normalization) to implementations of programming languages.
Therefore any progress in this area is likely to be of interest not
only to the rewriting community, but also to neighbouring fields like
functional programming, functional-logic programming, and termination
proofs of algorithms.
The workshop wants to provide a forum for the presentation and
discussion of new ideas and results, recent developments, new research
directions, as well as of surveys on existing knowledge in this
area. Furthermore we aim at fostering interaction and exchange between
researchers and students actively working on such topics.
The workshop will be held in conjunction with RTA 2001 in Utrecht (The
Netherlands) on May 26, 2001. It will feature 2 invited talks, a panel
discussion, and contributed presentations selected from the
submissions, with ample time for discussion.
The workshop is (co-)organized by U Utrecht, TU Valencia and TU Wien.
TOPICS OF INTEREST
Topics of interest include, but are not restricted to,
- theoretical foundations for the definition and semantic description
of reduction strategies
- strategies in different frameworks (term rewriting, graph rewriting,
infinitary rewriting, lambda calculi, higher order rewriting,
conditional rewriting, rewriting with built-ins, narrowing,
constraint solving, etc.) and their application in (equational,
functional, functional-logic) programming (languages)
- properties of reduction strategies / computations under
strategies (e.g., completeness, computability, decidability,
complexity, optimality, (hyper-)normalization, cofinality,
fairness, perpetuality, context-freeness, neededness, laziness,
eagerness, strictness)
- interrelations, combinations and applications of
reduction under different strategies (e.g., equivalence
conditions for fundamental properties like termination and
confluence, applications in modularity analysis, connections
between strategies of different frameworks, etc.)
- program analysis and other semantics-based optimization techniques
dealing with reduction strategies
- rewrite systems / tools / implementations with flexible /
programmable strategies as essential concept / ingredient
- specification of reduction strategies in (real) languages
- data structures and implementation techniques for reduction
strategies.
SUBMISSIONS
We solicit papers on all aspects of reduction strategies in
rewriting and programming. Submissions should describe unpublished
work, except for survey papers which are explicitly welcome,
too. Submissions should not exceed 10 pages (however, survey papers
may be longer) and be sent in postscript format to the PC co-chairs
(wrs01@logic.at) by March 12, 2001. Selection of papers by the PC
will be based on originality, significance, and correctness.
Accepted papers will be included in the workshop proceedings that will
be available at the workshop, and electronically on the web.
Depending on the number and quality of submissions, formal publication
of the proceedings is envisaged.
Researchers just interested in attending the workshop may send a
corresponding email to wrs01@logic.at by March 12, 2001, preferably
together with a brief position paper (up to two pages in postscript)
describing their interest and/or work in the area. However, we will
also consider late requests for attendance.
INVITED TALKS
Sergio Antoy (U Portland State):
Evaluation Strategies for Functional Logic Programming
Eelco Visser (U Utrecht, The Netherlands):
A Survey of Strategies in Program Transformation Systems
PANEL DISCUSSION on ``Hot Topics in Reduction Strategies'' with
Michael Hanus U Kiel (Germany)
Tetsuo Ida U Tsukuba (Japan)
Paul Klint CWI & U Amsterdam (The Netherlands)
PROGRAM COMMITTEE
Maria Alpuente TU Valencia (Spain)
Rachid Echahed IMAG Grenoble (France)
Bernhard Gramlich (co-chair) TU Wien (Austria)
Salvador Lucas (co-chair) TU Valencia (Spain)
Vincent van Oostrom U Utrecht (The Netherlands)
Rinus Plasmeijer KU Nijmegen (The Netherlands)
Manfred Schmidt-Schauss U Frankfurt a.M. (Germany)
Yoshihito Toyama U Tohoku (Japan)
LOCAL ORGANIZATION
Vincent van Oostrom U Utrecht (The Netherlands)
IMPORTANT DATES
Submission March 12, 2001 (extended deadline)
Notification March 31, 2001
Final version April 30, 2001
Workshop May 26, 2001
FURTHER INFORMATION
workshop website http://www.logic.at/wrs01/
workshop email address wrs01@logic.at
**************************************************************************
From doaitse@cs.uu.nl Thu Mar 1 11:25:33 2001
From: doaitse@cs.uu.nl (S. Doaitse Swierstra)
Date: Thu, 1 Mar 2001 12:25:33 +0100
Subject: strictness question
Message-ID:
I ran into a difference between GHC and Hugs. The following code:
f (P p) ~(P q) = P (\ k -> \inp -> let (((pv, (qv, r)), m), st) =
p (q k) inp
in (((pv qv , r ), m), st))
runs fine with Hugs but blows up with GHC, whereas:
f (P p) ~(P q) = P (\ k -> \inp -> let ~(~(~(pv, ~(qv, r)), m),
st) = p (q k) inp
in (((pv qv , r ), m), st))
runs fine with GHC too.
From the Haskell manual I understand that pattern matching in "let"'s
should be done lazily, so the addition of a collection of ~'s should
not make a difference. Am I right with this interpretation?
A possible source of this problem may be origination from the smarter
GHC optimiser, but in that case the optimiser is not doing its work
well.
Doaitse Swierstra
--
__________________________________________________________________________
S. Doaitse Swierstra, Department of Computer Science, Utrecht University
P.O.Box 80.089, 3508 TB UTRECHT, the Netherlands
Mail: mailto:doaitse@cs.uu.nl
WWW: http://www.cs.uu.nl/
PGP Public Key: http://www.cs.uu.nl/people/doaitse/
tel: +31 (30) 253 3962, fax: +31 (30) 2513791
__________________________________________________________________________
From qrczak@knm.org.pl Fri Mar 2 18:58:16 2001
From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk)
Date: 2 Mar 2001 18:58:16 GMT
Subject: strictness question
References:
Message-ID:
Thu, 1 Mar 2001 12:25:33 +0100, S. Doaitse Swierstra pisze:
> From the Haskell manual I understand that pattern matching in "let"'s
> should be done lazily, so the addition of a collection of ~'s should
> not make a difference.
Toplevel ~ in let doesn't change anything. But nested ~'s do make
a difference. When a variable of a pattern is evaluated, the whole
pattern is matched. When you protect a subpattern by ~ deferring its
matching and a variable from the subpattern is evaluated, again the
whole subpattern is matched, unless its subsubpatterns are protected
with their own ~'s etc.
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK
From qrczak@knm.org.pl Fri Mar 2 19:00:17 2001
From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk)
Date: 2 Mar 2001 19:00:17 GMT
Subject: Pattern guards vs. case (was, unfortunately :Re: interesting example of laziness/ghc optimisation)
References: <200103011052.LAA18219@isun11.informatik.uni-leipzig.de> <200103011125.UAA17785@ropas.kaist.ac.kr>
Message-ID:
Thu, 1 Mar 2001 20:25:28 +0900 (KST), Laszlo Nemeth pisze:
> > Prelude> let f x | Just _ == x = 0 in f (Just 4)
> > ERROR: Illegal `_' in expression
>
> So it works with (Just 4), but it doesn't with (Just _)?
'Just _ == x' must be an exppression. '_' is a pattern but not an
expression.
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK
From doaitse@cs.uu.nl Fri Mar 2 20:08:45 2001
From: doaitse@cs.uu.nl (S. Doaitse Swierstra)
Date: Fri, 2 Mar 2001 21:08:45 +0100
Subject: strictness question
In-Reply-To: <37DA476A2BC9F64C95379BF66BA2690260D8EC@red-msg-09.redmond.corp.microsoft.
com>
References: <37DA476A2BC9F64C95379BF66BA2690260D8EC@red-msg-09.redmond.corp.microsoft.
com>
Message-ID:
Thanks for the prompt reply. Hugs apparently is more lazy and
performs all the matching lazily, and that really makes a difference
in my case.
Doaitse
At 8:11 AM -0800 3/2/01, Simon Peyton-Jones wrote:
>Strange. You don't supply a complete program, so it's hard to
>test.
>
>Nevertheless, the Haskell Report (Sect 3.12) specifies that
>a let adds a single twiddle. Thus
>
> let (x, (y,z)) = e in b
>
>means
>
> let x = case e of (x,(y,z)) -> x
> y = case e of (x,(y,z)) -> y
> z = case e of (x,(y,z)) -> z
> in b
>
>And that is what GHC implements. You get something different if you
>add twiddles inside:
>
> let (x, ~(y,z)) = e in b
>
>means
> let x = case e of (x,_) -> x
> y = case e of (_,(y,_)) -> y
> etc
>
>Adding more twiddles means less eager matching. I don't know whether
>Hugs implements this.
>
>Simon
>
>| -----Original Message-----
>| From: S. Doaitse Swierstra [mailto:doaitse@cs.uu.nl]
>| Sent: 01 March 2001 11:26
>| To: haskell@haskell.org
>| Subject: strictness question
>|
>|
>| I ran into a difference between GHC and Hugs. The following code:
>|
>| f (P p) ~(P q) = P (\ k -> \inp -> let (((pv, (qv, r)), m), st) =
>| p (q k) inp
>| in (((pv qv , r ), m), st))
>|
>| runs fine with Hugs but blows up with GHC, whereas:
>|
>| f (P p) ~(P q) = P (\ k -> \inp -> let ~(~(~(pv, ~(qv, r)), m),
>| st) = p (q k) inp
>| in (((pv qv , r ), m), st))
>|
>| runs fine with GHC too.
>|
>| From the Haskell manual I understand that pattern matching
>| in "let"'s
>| should be done lazily, so the addition of a collection of ~'s should
>| not make a difference. Am I right with this interpretation?
>|
>| A possible source of this problem may be origination from the smarter
>| GHC optimiser, but in that case the optimiser is not doing its work
>| well.
>|
>| Doaitse Swierstra
>|
>|
>|
>|
>| --
>| ______________________________________________________________
>| ____________
>| S. Doaitse Swierstra, Department of Computer Science, Utrecht
>| University
>| P.O.Box 80.089, 3508 TB UTRECHT, the
>| Netherlands
>| Mail: mailto:doaitse@cs.uu.nl
>| WWW: http://www.cs.uu.nl/
>| PGP Public Key:
>http://www.cs.uu.nl/people/doaitse/
> tel: +31 (30) 253 3962, fax: +31 (30) 2513791
>__________________________________________________________________________
>
>_______________________________________________
>Haskell mailing list
>Haskell@haskell.org
>http://www.haskell.org/mailman/listinfo/haskell
--
__________________________________________________________________________
S. Doaitse Swierstra, Department of Computer Science, Utrecht University
P.O.Box 80.089, 3508 TB UTRECHT, the Netherlands
Mail: mailto:doaitse@cs.uu.nl
WWW: http://www.cs.uu.nl/
PGP Public Key: http://www.cs.uu.nl/people/doaitse/
tel: +31 (30) 253 3962, fax: +31 (30) 2513791
__________________________________________________________________________
From dpt@math.harvard.edu Fri Mar 2 20:27:03 2001
From: dpt@math.harvard.edu (Dylan Thurston)
Date: Fri, 2 Mar 2001 15:27:03 -0500
Subject: strictness question
In-Reply-To: ; from qrczak@knm.org.pl on Fri, Mar 02, 2001 at 06:58:16PM +0000
References:
Message-ID: <20010302152703.A15504@math.harvard.edu>
On Fri, Mar 02, 2001 at 06:58:16PM +0000, Marcin 'Qrczak' Kowalczyk wrote:
> Toplevel ~ in let doesn't change anything. But nested ~'s do make
> a difference. When a variable of a pattern is evaluated, the whole
> pattern is matched. When you protect a subpattern by ~ deferring its
> matching and a variable from the subpattern is evaluated, again the
> whole subpattern is matched, unless its subsubpatterns are protected
> with their own ~'s etc.
Is the behaviour of Hugs incorrect in this case?
Best,
Dylan Thurston
From dduggan@cs.stevens-tech.edu Fri Mar 2 21:55:10 2001
From: dduggan@cs.stevens-tech.edu (Dominic Duggan)
Date: Fri, 02 Mar 2001 16:55:10 -0500
Subject: question re hugs and func dependencies
Message-ID: <3AA016BE.DFA4C85D@cs.stevens-tech.edu>
This is a multi-part message in MIME format.
--------------330C6A4F811AE17438D91FD6
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Dear all, I haven't got a reply from hugs-bugs,
so I'll see if anyone here can answer the question.
class foo a b | a |-> b where foo :: a -> b -> Int
instance foo Int Float where foo x y = 0
instance foo [a] [b] where foo [x] [y] = foo x y
g x y = (foo [x] y) + (foo [y] x)
It is my conjecture that Hugs terminates on type-checking
g because of a depth bound in the type-checker
(although there is no indication from the type-checker
that this is what is going on).
Can anyone confirm or refute this conjecture?
FWIW this is as part of the related work section
for a paper that has been accepted to JFP:
"Type-Checking Multi-Parameter Type Classes,"
by D. Duggan and J. Ophel.
I'd appreciate cc-ing any replies to me, I'm not
sure that I'm still on this mailing list.
Cheers
--dd
--------------330C6A4F811AE17438D91FD6
Content-Type: text/x-vcard; charset=us-ascii;
name="dduggan.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Dominic Duggan
Content-Disposition: attachment;
filename="dduggan.vcf"
begin:vcard
n:Duggan;Dominic
tel;fax:(201) 216-8249
tel;work:(201) 216-8042
x-mozilla-html:FALSE
url:http://guinness.cs.stevens-tech.edu/~dduggan/index.html
org:Stevens Institute of Technology;Computer Science
version:2.1
email;internet:dduggan@cs.stevens-tech.edu
title:Associate Professor
note:Web page: http://guinness.cs.stevens-tech.edu/~dduggan/index.html
adr;quoted-printable:;;Department of Computer Science=0D=0AStevens Institute of Technology;Hoboken;New Jersey;07030;USA
x-mozilla-cpt:;10656
fn:Dominic Duggan
end:vcard
--------------330C6A4F811AE17438D91FD6--
From volker.wysk@student.uni-tuebingen.de Fri Mar 2 23:34:28 2001
From: volker.wysk@student.uni-tuebingen.de (Volker Wysk)
Date: Sat, 3 Mar 2001 00:34:28 +0100 (CET)
Subject: Announce: Mysql-HS 0.10.0
Message-ID:
MySQL-HS is an interface to the MySQL database. This is a maintaince
release.
Changes:
- Ported to GHC 4.08 and H/Direct 0.17
- Inproved documentation
- General polishment
This version is considered to be stable. If there don't show any bugs, the
next version will be 1.0.0 and probably the conclusive one. (Except for support
of new versions of GHC, H/Direct, MySQL).
The homepage is at
http://www.volker-wysk.de/mysql-hs
From simonpj@microsoft.com Fri Mar 2 16:11:41 2001
From: simonpj@microsoft.com (Simon Peyton-Jones)
Date: Fri, 2 Mar 2001 08:11:41 -0800
Subject: strictness question
Message-ID: <37DA476A2BC9F64C95379BF66BA2690260D8EC@red-msg-09.redmond.corp.microsoft.com>
Strange. You don't supply a complete program, so it's hard to
test.
Nevertheless, the Haskell Report (Sect 3.12) specifies that
a let adds a single twiddle. Thus
let (x, (y,z)) = e in b
means
let x = case e of (x,(y,z)) -> x
y = case e of (x,(y,z)) -> y
z = case e of (x,(y,z)) -> z
in b
And that is what GHC implements. You get something different if you
add twiddles inside:
let (x, ~(y,z)) = e in b
means
let x = case e of (x,_) -> x
y = case e of (_,(y,_)) -> y
etc
Adding more twiddles means less eager matching. I don't know whether
Hugs implements this.
Simon
| -----Original Message-----
| From: S. Doaitse Swierstra [mailto:doaitse@cs.uu.nl]
| Sent: 01 March 2001 11:26
| To: haskell@haskell.org
| Subject: strictness question
|
|
| I ran into a difference between GHC and Hugs. The following code:
|
| f (P p) ~(P q) = P (\ k -> \inp -> let (((pv, (qv, r)), m), st) =
| p (q k) inp
| in (((pv qv , r ), m), st))
|
| runs fine with Hugs but blows up with GHC, whereas:
|
| f (P p) ~(P q) = P (\ k -> \inp -> let ~(~(~(pv, ~(qv, r)), m),
| st) = p (q k) inp
| in (((pv qv , r ), m), st))
|
| runs fine with GHC too.
|
| From the Haskell manual I understand that pattern matching
| in "let"'s
| should be done lazily, so the addition of a collection of ~'s should
| not make a difference. Am I right with this interpretation?
|
| A possible source of this problem may be origination from the smarter
| GHC optimiser, but in that case the optimiser is not doing its work
| well.
|
| Doaitse Swierstra
|
|
|
|
| --
| ______________________________________________________________
| ____________
| S. Doaitse Swierstra, Department of Computer Science, Utrecht
| University
| P.O.Box 80.089, 3508 TB UTRECHT, the
| Netherlands
| Mail: mailto:doaitse@cs.uu.nl
| WWW: http://www.cs.uu.nl/
| PGP Public Key:
http://www.cs.uu.nl/people/doaitse/
tel: +31 (30) 253 3962, fax: +31 (30) 2513791
__________________________________________________________________________
_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell
From ashley@semantic.org Sat Mar 3 01:36:15 2001
From: ashley@semantic.org (Ashley Yakeley)
Date: Fri, 2 Mar 2001 17:36:15 -0800
Subject: Extensible Algebraic Data Types
Message-ID: <200103030136.RAA24813@mail4.halcyon.com>
I think it would be useful to extend Haskell so that one could create
algebraic data types in one module that could be union-extended in
another. Something like this:
data Thing = CharThing Char | IntThing Int | _
...later...
data Thing |= StringThing String
This would be useful for two reasons:
1. You could do something akin to dynamic typing without unreasonably
stressing the ideas behind the Haskell type system:
data BaseExtension = _
data Base = MkBase (Char,Int,BaseExtension)
...later...
data Derived = MkDerived (Char,Int,Int,Int)
data BaseExtension |= MkDerivedExtension (Int,Int)
upcast :: Derived -> Base
upcast (MkDerived (a,b,c,d)) = MkBase (a,b,MkDerivedExtension(c,d))
downcast :: Base -> Maybe Derived
downcast MkBase (a,b,MkDerivedExtension(c,d)) = Just (MkDerived (a,b,c,d))
downcast MkBase (a,b,_) = Nothing
2. You'd have a way of autogenerating values similar to LISP's gensym:
data Token = _ deriving Eq
...later...
data Token |= ThisToken
data Token |= ThatToken
data Token |= BunchOfTokens Int
Of course this extension to Haskell begs another, virtual or generic
functions. I'm not sure how to do this properly while maintaining the
principle that an expression has the same value regardless of other
modules loaded.
data Thing = CharThing Char | IntThing Int | _
f1 :: Thing -> Int
f1 (CharThing c) = ord c
f1 (IntThing i) = i
-- somehow allow cases to be inserted later here
f1 _ = 0
-- multiple dispatch
f2 :: Thing -> Thing -> Int
f2 (IntThing i) (IntThing j) = i + j
-- might want cases inserted here,
-- provided they don't cause trouble
f2 (IntThing i) _ = i
-- or here
f2 _ (IntThing i) = i + 1
-- or here
f2 _ _ = 0
Are these ideas something worth thinking about? Or would such extensions
compromise important principles behind Haskell?
--
Ashley Yakeley, Seattle WA
From shlomif@vipe.technion.ac.il Sun Mar 4 15:48:35 2001
From: shlomif@vipe.technion.ac.il (Shlomi Fish)
Date: Sun, 4 Mar 2001 17:48:35 +0200 (IST)
Subject: Circular Data Types - a directory tree abstraction
Message-ID:
I want to implement a directory data type where each directory may contain
other directories, as well as end documents. I declared the following
file for managing it:
------------------------------
module Contents_Abs where
data Contents_Image url mime = MakeContents_Image url mime
get_image_url (MakeContents_Image url mime) = url
get_image_mime_type (MakeContents_Image url mime) = mime
make_image url mime = (MakeContents_Image url mime)
data Contents_Node url title subs images is_dir =
MakeContents_Node url title subs images is_dir
get_url (MakeContents_Node url title subs images is_dir) = url
get_title (MakeContents_Node url title subs images is_dir) = title
get_subs (MakeContents_Node url title subs images is_dir) = subs
get_is_dir (MakeContents_Node url title subs images is_dir) = is_dir
make_contents_doc url title = (MakeContents_Node url title [] [] False)
make_contents_dir url title subs = (MakeContents_Node url title subs []
True)
make_contents_dir_with_images url title subs images = (MakeContents_Node
url title subs images True)
--------------------------------------------
Now, I have the following example file:
--------------------------------------------
module Contents where
import Contents_Abs
contents = (make_contents_dir_with_images "" "Contents"
[
(make_contents_doc "intro.html" "Introduction"),
(make_contents_doc "properties.html" "Properties"),
(make_contents_dir "recursion" "Recursion"
[
(make_contents_doc "fib1.html" "Fibonnaci (Take 1)"),
(make_contents_doc "qsort.html" "Quick Sort")
]
),
(make_contents_dir "lazy_eval" "Lazy Evaluation"
[
(make_contents_doc "primes1.html" "Primes (Take 1)"),
(make_contents_doc "fib2.html" "Fibonnaci (Take 2)")
]
)
]
[
(make_image "style.css" "text/css")
]
)
-------------------------------------------
I would like to be able to traverse this tree, so I defined the following
script:
---------------------
import Contents_Abs
import Contents
mytraverse contents = trav contents where
trav branch =
(get_url branch) ++ (trav_subs (get_subs branch)) where
trav_subs [] = ""
trav_subs (a:as) = (trav a) ++ (trav_subs as)
result = mytraverse contents
-----------------------
However, when trying to load it hugs reports the following error:
Reading file "Z:\Download\unpack\hugs98\lib\Prelude.hs":
Reading file "print_cont.hs":
Reading file "Contents_Abs.hs":
Reading file "Contents.hs":
Reading file "print_cont.hs":
Type checking
ERROR "print_cont.hs" (line 5): Type error in function binding
*** Term : trav
*** Type : Contents_Node [Char] b [a] c d -> [Char]
*** Does not match : a -> [Char]
*** Because : unification would give infinite type
Contents>
I would like to know how I can define a data structure that will contain a
list of references to its own types (I don't need circular data
structures). I would also like to know how I can define such an
abstraction inside a type.
Regards,
Shlomi Fish
----------------------------------------------------------------------
Shlomi Fish shlomif@vipe.technion.ac.il
Home Page: http://t2.technion.ac.il/~shlomif/
Home E-mail: shlomif@techie.com
The prefix "God Said" has the extraordinary logical property of
converting any statement that follows it into a true one.
From tom-list-haskell@moertel.com Sun Mar 4 19:28:26 2001
From: tom-list-haskell@moertel.com (Tom Moertel)
Date: Sun, 04 Mar 2001 14:28:26 -0500
Subject: Circular Data Types - a directory tree abstraction
References:
Message-ID: <3AA2975A.D1D8A839@moertel.com>
Shlomi Fish wrote:
>
> I would like to know how I can define a data structure that will contain a
> list of references to its own types (I don't need circular data
> structures). I would also like to know how I can define such an
> abstraction inside a type.
Here's one way that uses Haskell's Either type to differentiate between
directory entries that represent documents and those the represent
directories.
module URITree
where
-- some type synonynms to make things easier to remember
type URI = String
type MimeType = String
type Title = String
-- here is the type the represents a directory entry
newtype DirectoryEntry = DE (URI, Title, (Either [DirectoryEntry] {- Directory -}
MimeType)) {- Document -}
deriving (Show, Read, Eq)
-- a few helper functions to create entries
mkDirectory :: URI -> Title -> [DirectoryEntry] -> DirectoryEntry
mkDirectory uri title subs = DE (uri, title, (Left subs))
mkDocument :: URI -> Title -> MimeType -> DirectoryEntry
mkDocument uri title mtype = DE (uri, title, (Right mtype))
mkHTMLDocument :: URI -> Title -> DirectoryEntry
mkHTMLDocument uri title = DE (uri, title, (Right "text/html"))
-- here is a sample directory entry for a small hierarchy of documents
contents = mkDirectory "" "Contents" $
[ mkHTMLDocument "intro.html" "Introduction"
, mkHTMLDocument "properties.html" "Properties"
, mkDirectory "recursion/" "Recursion" $
[ mkHTMLDocument "fib1.html" "Fibonnaci (Take 1)"
, mkHTMLDocument "qsort.html" "Quick Sort"
]
, mkDirectory "lazy_eval/" "Lazy Evaluation" $
[ mkHTMLDocument "primes1.html" "Primes (Take 1)"
, mkHTMLDocument "fib2.html" "Fibonnaci (Take 2)"
]
, mkDocument "style.css" "Style sheet" "text/css"
]
-- traverse a directory entry, generating an indented set of titles
-- that represents its contents
traverse :: DirectoryEntry -> String
traverse d = tr 0 d
where tr n (DE (uri,title,ent)) = (indent n)++title++"\n"++(content (n+1) ent)
content n (Left subs) = foldr (++) "" (map (tr n) subs)
content n (Right _) = ""
indent n = foldr (++) "" (replicate n " ")
Hugs98 session using the above:
> :load uri-tree.hs
Reading file "uri-tree.hs":
Hugs session for:
C:\hugs98\lib\Prelude.hs
uri-tree.hs
URITree> putStr (traverse contents)
Contents
Introduction
Properties
Recursion
Fibonnaci (Take 1)
Quick Sort
Lazy Evaluation
Primes (Take 1)
Fibonnaci (Take 2)
Style sheet
From simonpj@microsoft.com Mon Mar 5 08:42:59 2001
From: simonpj@microsoft.com (Simon Peyton-Jones)
Date: Mon, 5 Mar 2001 00:42:59 -0800
Subject: question re hugs and func dependencies
Message-ID: <37DA476A2BC9F64C95379BF66BA2690260DBCB@red-msg-09.redmond.corp.microsoft.com>
I replied last week:
-----Original Message-----
From: Simon Peyton-Jones
Sent: 28 February 2001 16:51
To: 'Dominic Duggan'; hugs-bugs@haskell.org
Subject: RE: please confirm that this is a feature
GHC infers the type
g :: (Foo [[a]] [b], Foo [[b]] [a]) => [a] -> [b] -> Int
As you imply, if GHC used the instance decl to simplify
the first constraint to Foo [a] b, for example, then the functional
dependency would kick in, and there would be an infinite loop.
But GHC's constraint simplification is (now) lazy, unless forced
to be eager by supplying a type signature.
I think Hugs is the same, and I think that's probably why it
terminates.
Interesting example!
Simon
| -----Original Message-----
| From: Dominic Duggan [mailto:dduggan@cs.stevens-tech.edu]
| Sent: 02 March 2001 21:55
| To: haskell@haskell.org
| Subject: question re hugs and func dependencies
|
|
| Dear all, I haven't got a reply from hugs-bugs,
| so I'll see if anyone here can answer the question.
|
| class foo a b | a |-> b where foo :: a -> b -> Int
| instance foo Int Float where foo x y = 0
| instance foo [a] [b] where foo [x] [y] = foo x y
| g x y = (foo [x] y) + (foo [y] x)
|
| It is my conjecture that Hugs terminates on type-checking
| g because of a depth bound in the type-checker
| (although there is no indication from the type-checker
| that this is what is going on).
|
| Can anyone confirm or refute this conjecture?
|
| FWIW this is as part of the related work section
| for a paper that has been accepted to JFP:
| "Type-Checking Multi-Parameter Type Classes,"
| by D. Duggan and J. Ophel.
|
| I'd appreciate cc-ing any replies to me, I'm not
| sure that I'm still on this mailing list.
|
| Cheers
| --dd
|
From pugliese@dsi.unifi.it Mon Mar 5 08:12:48 2001
From: pugliese@dsi.unifi.it (Rosario Pugliese)
Date: Mon, 05 Mar 2001 09:12:48 +0100
Subject: PLI 2001: submission deadline is approaching
Message-ID: <3AA34A80.D2607D09@dsi.unifi.it>
[Apologies for multiple copies]
----------------------------------------------------------------
PLI 2001
Principles, Logics, and Implementations
of high-level programming languages
(Sponsored by ACM)
Firenze, ITALY September 2 - 8, 2001
http://music.dsi.unifi.it/pli01/
The colloquium on Principles, Logics, and Implementations of high-
level programming languages is a collection of conferences and
workshops aimed at the advancement of high-level programming
languages. The events composing PLI will cover a spectrum of
topics important to language development and use, including issues
such as semantics, design, analysis, implementation, and
application. Theoretical issues relevant to language design and
programming will be represented. Implementation questions will
provide an emphasis on compilation methods, distributed
computation and static debugging techniques. There will also be a
focus on industrial and educational applications.
Conferences:
ICFP (September 3-5)
Int. Conf. on Functional Programming
General chair: Benjamin Pierce (Univ. Pennsylvania)
Program chair: Xavier Leroy (INRIA Rocquencourt)
PPDP (September 5-7)
Int. Conf. on Principles and Practice of Declarative
Programming
Conference chair: Rocco De Nicola (Univ. Firenze)
Program chair: Harald Sřndergaard (Univ. Melbourne)
Workshops:
· Multilanguage Infrastructure and Interoperability (BABEL)
· ERLANG Workshop
· Fixed Points in Computer Science (FICS)
· HASKELL Workshop
· Quantitative Aspects of Programming Languages (QAPL)
· Rule-Based Programming (RULE)
· Semantics, Applications, and Implementation of Program
Generation (SAIG)
· Scheme and Functional Programming (SCHEME)
· Verification and Computational Logic (VCL)
Submission deadline for ICFP and PPDP: March 15, 2001
Workshops chair: Betti Venneri (Univ. Firenze)
Publicity chair: Rosario Pugliese (Univ. Firenze)
Organizing Committee: Gianni Aguzzi (Univ. Firenze, co-chair),
Giorgio Ghelli (Univ. Pisa, co-chair), Lorenzo Bettini (Univ.
Firenze), Michele Loreti (Univ. Firenze), Dario Colazzo (Univ.
Pisa)
Contact Information: pli-inf@gdn.dsi.unifi.it
Conference Venue:
Auditorium Banca Toscana, Via Panciatichi, 87 (Firenze Nova),
Firenze, ITALY
From dduggan@cs.stevens-tech.edu Mon Mar 5 14:00:51 2001
From: dduggan@cs.stevens-tech.edu (Dominic Duggan)
Date: Mon, 5 Mar 2001 09:00:51 -0500 (EST)
Subject: question re hugs and func dependencies
In-Reply-To: <37DA476A2BC9F64C95379BF66BA2690260DBCB@red-msg-09.redmond.corp.microsoft.com>
"from Simon Peyton-Jones at Mar 5, 2001 00:42:59 am"
Message-ID: <200103051400.JAA1772138@guinness.cs.stevens-tech.edu>
Simon thanks I'm afraid I didn't see your earlier reply.
I didn't try this in GHC, thanks for the clarification.
Hugs on the other hand does give a type:
g :: (Foo [[[[a]]]] [[[[b]]]], Foo [[[[[b]]]]] [[[a]]]) => [[[[b]]]] -> [[[a]]] -> Int
My assumption is that this is because of a depth bound check.
As an editorial aside, it seems to me that the GHC approach
of lazy context reduction introduces the same problems that
functional dependencies were supposed to solve. The type of
g with unresolved constraints hides a type error, and this
is part of the motivation for FD given by Mark Jones in his web note.
It seems to me that an approach of "I don't know" would be
more useful, but I cc to the haskell list in case others have
opinions.
Cheers
--dd
From simonpj@microsoft.com Mon Mar 5 17:48:12 2001
From: simonpj@microsoft.com (Simon Peyton-Jones)
Date: Mon, 5 Mar 2001 09:48:12 -0800
Subject: Rewrite rules
Message-ID: <37DA476A2BC9F64C95379BF66BA2690260DBE2@red-msg-09.redmond.corp.microsoft.com>
Folks
Andrew Tolmach, Tony Hoare, and I are writing a paper about
rewrite rules in GHC -- the {-# RULES #-} stuff.
We'd like to report on practical experience of using rewrite rules.
Has anyone use them in practice? What's your experience?
Pls reply to me, to avoid clogging the list with your cries of rapture.
Simon
From qrczak@knm.org.pl Mon Mar 5 21:12:30 2001
From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk)
Date: 5 Mar 2001 21:12:30 GMT
Subject: Disjoint type classes
References: <001601b205b3$20bd81c0$5d1f239c@ccu.uniovi.es>
Message-ID:
Thu, 18 Feb 1988 08:17:58 +0100, Jose Emilio Labra Gayo pisze:
> Which doesn't work because Haskell doesn't detect that
> "Integral" and "Fractional" are disjoint.
And indeed there is no disjointness concept in the language.
Nothing prevents from making a type an instance of both.
> Is there a way to implement these type classes with current Haskell
> implementations?
I'm afraid not. In the standard way you must decide for each type
separately. At most you could use ghc with -fallow-overlapping-instances
-fallow-undecidable-instances, which would allow to define one of your
instances - the other would have to be defined for each type separately;
but these options are not nice.
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK
From cwitty@newtonlabs.com Mon Mar 5 22:22:45 2001
From: cwitty@newtonlabs.com (Carl R. Witty)
Date: 05 Mar 2001 14:22:45 -0800
Subject: Extensible Algebraic Data Types
In-Reply-To: Ashley Yakeley's message of "Fri, 2 Mar 2001 17:36:15 -0800"
References: <200103030136.RAA24813@mail4.halcyon.com>
Message-ID:
Ashley Yakeley writes:
> I think it would be useful to extend Haskell so that one could create
> algebraic data types in one module that could be union-extended in
> another. Something like this:
>
> data Thing = CharThing Char | IntThing Int | _
>
> ...later...
>
> data Thing |= StringThing String
You might be able to use the Gaster and Jones extensible variants from
"A Polymorphic Type System for Extensible Records and Variants"
(http://www.cse.ogi.edu/~mpj/pubs/polyrec.html). As far as I know,
the extensible variants described in this paper have never been
implemented (although the extensible records are implemented in Hugs).
I've often thought that extensible variants would be at least as
useful, if not more useful, than extensible records.
Carl Witty
From miketh@brisbane.paradigmgeo.com Tue Mar 6 07:40:26 2001
From: miketh@brisbane.paradigmgeo.com (Mike Thomas)
Date: Tue, 6 Mar 2001 17:40:26 +1000
Subject: GHC - Cygwin Installation and also DirectX
Message-ID: <007701c0a610$c15cdcf0$0cb4a8c0@brisbane.paradigmgeo.com>
Hi all.
I'm having ghc import path problems on NT:
----------------------------------------------------------------------------
------------------------------
$ ghc -i//c/ghc/ghc-4.08.2/lib/imports/win32 hello.lhs
Import path element `/cygdrive/c/ghc/ghc-4.08.2/lib/imports/win32' does not
exist, ignor
ing.
hello.lhs:14:
Could not find interface file for `Win32'
in the directories /cygdrive/c/ghc/ghc-4.08.2/lib/imports/win32/*.hi
./*.hi
C:/ghc/ghc-4.08.2/lib/imports/std/*.hi
hello.lhs:15:
Could not find interface file for `Addr'
in the directories /cygdrive/c/ghc/ghc-4.08.2/lib/imports/win32/*.hi
./*.hi
C:/ghc/ghc-4.08.2/lib/imports/std/*.hi
Compilation had errors
----------------------------------------------------------------------------
------------------------------
The Win32 installation instructions say that one should execute "mount -f C:
/", but having done that in response to this error it does not fix the
problem and it stops bash from starting up correctly (Cygwin is installed in
c:\cygwin and GHC in c:\ghc\ghc-4.08.2). (Why am I supposed to do this
mount?)
Has anyone got a solution?
Furthermore, is anyone using Direct X especially Direct Play and Draw with
GHC?
Cheers
Mike Thomas.
From rrt1001@cam.ac.uk Tue Mar 6 11:09:39 2001
From: rrt1001@cam.ac.uk (Reuben Thomas)
Date: Tue, 6 Mar 2001 11:09:39 +0000 (GMT)
Subject: GHC - Cygwin Installation and also DirectX
In-Reply-To: <007701c0a610$c15cdcf0$0cb4a8c0@brisbane.paradigmgeo.com>
Message-ID:
> The Win32 installation instructions say that one should execute "mount -f C:
> /", but having done that in response to this error it does not fix the
> problem and it stops bash from starting up correctly (Cygwin is installed in
> c:\cygwin and GHC in c:\ghc\ghc-4.08.2). (Why am I supposed to do this
> mount?)
It helps because it means that Cygwin's UNIX-style paths (starting from /)
are also valid Windows paths. However, as you've observed, when installing
Cygwin in its default location, it stops other things working, and I've now
retracted that piece of advice. Unfortunately, not mounting C: at / messes
up other things (though more so when building GHC than when merely using
it). Mounting C: at / shouldn't stop bash starting up, though...
> Has anyone got a solution?
There should be some hardwired paths in the driver
(/ghc/ghc-4.08.2/bin/ghc-4.08.2) and possibly other scripts that start with
/cygdrive/c; changing these to C:/ should make things work. If the paths are
being generated somewhere, then running them through cygpath -w will convert
them into Windows format.
I'm working on getting this cleared up in the head, for the upcoming GHC 5.0
release...hopefully Cygwin 1.2 will be out soon, and then things will settle
down somewhat.
--
http://sc3d.org/rrt/ | computation, n. automated pedantry
From iscp9157@nus.edu.sg Wed Mar 7 04:14:32 2001
From: iscp9157@nus.edu.sg (Saswat Anand)
Date: Tue, 6 Mar 2001 20:14:32 -0800
Subject: Can Class do this?
Message-ID: <000c01c0a6bd$55b79be0$aad512ac@iscp9157>
This is a multi-part message in MIME format.
------=_NextPart_000_0009_01C0A67A.0E4074A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I have a problem as follows -
type CF =3D Char -> Float
type IF =3D Integer -> Float
type CIF =3D (Char,Integer) -> Float
There be two functions:
fun :: CF
fun =3D fromInt.ord
sun :: IF
sun =3D fromInteger
I want the followings to be valid.
x :: IF
x =3D sun \+ sun
y :: IF
y =3D sun \+ sun \+ sun -- when only sun is there, type should be =
IF
a :: CF
a =3D fun \+ fun=20
b :: CF
b =3D fun \+ fun \+ fun -- when only fun is there, type should be =
IF
p :: CIF
p =3D sun \+ fun=20
q :: CIF
q =3D sun \+ fun \+ sun - -when sun and fun are mixed type =
should be CIF
I guess this can be done using classes, but I have not been successful =
after trying many variations.
Any help is very much appreciated.
Thanks,
Saswat
------=_NextPart_000_0009_01C0A67A.0E4074A0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I have a problem as follows =
-
type CF =3D Char -> =
Float
type IF =3D Integer -> =
Float
type CIF =3D (Char,Integer) -> =
Float
There be two =
functions:
fun :: CF
fun =3D fromInt.ord
sun :: IF
sun =3D fromInteger
I want the followings to be =
valid.
x :: IF
x =3D sun \+ sun
y :: IF
y =3D sun \+ sun \+=20
sun -- when only sun is there, type =
should=20
be IF
a :: CF
a =3D fun \+ fun
b :: CF
b =3D fun \+ fun \+=20
fun -- when only fun is there, =
type=20
should be IF
p :: CIF
p =3D sun \+ fun
q :: CIF
q =3D sun \+ fun \+=20
sun - -when sun and =
fun are=20
mixed type should be CIF
I guess this can be done using =
classes, but I=20
have not been successful after trying many variations.
Any help is very much =
appreciated.
Thanks,
Saswat
------=_NextPart_000_0009_01C0A67A.0E4074A0--
From mk167280@students.mimuw.edu.pl Tue Mar 6 13:05:23 2001
From: mk167280@students.mimuw.edu.pl (Marcin 'Qrczak' Kowalczyk)
Date: Tue, 6 Mar 2001 14:05:23 +0100 (CET)
Subject: Can Class do this?
In-Reply-To: <000c01c0a6bd$55b79be0$aad512ac@iscp9157>
Message-ID:
On Tue, 6 Mar 2001, Saswat Anand wrote:
> I guess this can be done using classes, but I have not been successful
> after trying many variations.
It requires extensions supported by ghc and Hugs: multiparameter type
classes are required, functional dependencies are recommended.
Functional dependencies don't work well for released ghc versions, but
shoud work in the upcoming ghc-5.0. You might need to remove '| a b -> c'
below and need more explicit type annotations (will not be very
convenient).
class Plus a b c | a b -> c where
(\+) :: a -> b -> c
instance Plus CF CF CF where
f \+ g = ...
instance Plus IF IF IF where
f \+ g = ...
instance Plus CF IF CIF where
f \+ g = ...
instance Plus IF CF CIF where
f \+ g = ...
instance Plus CF CIF CIF where
f \+ g = ...
instance Plus IF CIF CIF where
f \+ g = ...
instance Plus CIF CF CIF where
f \+ g = ...
instance Plus CIF IF CIF where
f \+ g = ...
instance Plus CIF CIF CIF where
f \+ g = ...
--
Marcin 'Qrczak' Kowalczyk
From iscp9157@nus.edu.sg Wed Mar 7 09:00:05 2001
From: iscp9157@nus.edu.sg (Saswat Anand)
Date: Wed, 7 Mar 2001 01:00:05 -0800
Subject: Can Class do this?
Message-ID: <001801c0a6e5$01cfefa0$aad512ac@iscp9157>
This is a multi-part message in MIME format.
------=_NextPart_000_0015_01C0A6A1.F26DC700
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Thanks a lot. It works great with Hugs.=20
But it has a small problem. I also want to be able to write=20
=20
4 \+ fc :: CF
fc \+ 4 :: CF
ic \+ 4 :: IF
4 \+ fc \+ ic :: CIF
Well for that I did this,
instance (Rational a) =3D> Plus a CF CF where --to support 4.0 \+ fc
f \+ g =3D \c -> (realToFrac f) \+ (g c)
I did not do : instance Plus Float CF CF where .. so that I don't have =
to write (4::Float) \+ fc.=20
But it complains because, it violates functional dependency a b -> c. Is =
there any other way to avoid writing (4::Float) in this case.
Well I tried this:
(\+) :: (Lift a c, Lift b c) =3D> a -> b -> (c -> Float)
f \+ g =3D \x -> (lift f) x + (lift f) x
class Lift a b where
lift :: a -> (b -> Float)
instance Lift CF Char where
lift =3D id
instance Lift CF (Char,Integer) where
lift f =3D \(c,i) -> f c
instance Lift IF Integer where
lift =3D id
instance Lift IF (Char,Integer) where
lift f =3D \(c,i) -> f i
instance Lift CIF (Char,Integer) where
lift =3D id
But it does not take following:
x :: CF
x =3D cf \+ cf \+ cf
Cannot justify constraints in explicitly typed binding
*****Expresssion : x
*****Type : CF
*****Given Context : ()
*****Constraints : (Lift (a -> Float) Char, Lift (Char -> FLoat) a)
Thanks,
Saswat
------=_NextPart_000_0015_01C0A6A1.F26DC700
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Thanks a lot. It works great with Hugs. =
But it has a small problem. I also want =
to be able=20
to write
4 \+ fc :: CF
fc \+ 4 :: CF
ic \+ 4 :: IF
4 \+ fc \+ ic :: CIF
Well for that I did this,
instance (Rational a) =3D> Plus a CF =
CF=20
where --to support 4.0 \+ fc
f =
\+ g =3D \c=20
-> (realToFrac f) \+ (g c)
I did not do : instance Plus Float CF CF where .. so that I =
don't have=20
to write (4::Float) =
\+ fc.=20
But it complains because, it violates =
functional=20
dependency a b -> c. Is there any other way to avoid writing =
(4::Float) in=20
this case.
Well I tried this:
(\+) :: (Lift a c, Lift b c) =3D> a =
-> b ->=20
(c -> Float)
f \+ g =3D \x -> (lift f) x + (lift f) =
x
class Lift a b where
lift :: a =
-> (b=20
-> Float)
instance Lift CF Char =
where
lift =3D=20
id
instance Lift CF (Char,Integer) =
where
lift=20
f =3D \(c,i) -> f c
instance Lift IF Integer =
where
lift =3D=20
id
instance Lift IF (Char,Integer) =
where
lift=20
f =3D \(c,i) -> f i
instance Lift CIF (Char,Integer)=20
where
lift =3D id
But it does not take =
following:
x :: CF
x =3D cf \+ cf \+ =
cf
Cannot justify constraints in =
explicitly typed=20
binding
*****Expresssion : x
*****Type : CF
*****Given Context : ()
*****Constraints : (Lift (a -> =
Float) Char, Lift=20
(Char -> FLoat) a)
Thanks,
Saswat
------=_NextPart_000_0015_01C0A6A1.F26DC700--
From qrczak@knm.org.pl Tue Mar 6 17:10:24 2001
From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk)
Date: 6 Mar 2001 17:10:24 GMT
Subject: Can Class do this?
References: <001801c0a6e5$01cfefa0$aad512ac@iscp9157>
Message-ID:
Wed, 7 Mar 2001 01:00:05 -0800, Saswat Anand pisze:
> But it has a small problem. I also want to be able to write
>
> 4 \+ fc :: CF
> fc \+ 4 :: CF
> ic \+ 4 :: IF
> 4 \+ fc \+ ic :: CIF
You can have more fundeps which allow to deduce a type of an argument
from the other argument and the result:
| a b -> c, a c -> b, b c -> a
and make CF and IF instances of Integral (define fromIntegral for them).
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK
From N.Perry@massey.ac.nz Tue Mar 6 19:24:31 2001
From: N.Perry@massey.ac.nz (Nigel Perry)
Date: Wed, 7 Mar 2001 08:24:31 +1300
Subject: GHC - Cygwin Installation and also DirectX
In-Reply-To: <007701c0a610$c15cdcf0$0cb4a8c0@brisbane.paradigmgeo.com>
References: <007701c0a610$c15cdcf0$0cb4a8c0@brisbane.paradigmgeo.com>
Message-ID:
At 5:40 pm +1000 6/3/01 you wrote:
>The Win32 installation instructions say that one should execute "mount -f C:
>/", but having done that in response to this error it does not fix the
>problem and it stops bash from starting up correctly (Cygwin is installed in
>c:\cygwin and GHC in c:\ghc\ghc-4.08.2). (Why am I supposed to do this
>mount?)
From painful experience installing GHC under Win2K I can advise you should
install Cygwin at root level now, contrary to advice in Cygwin. Also make
sure your disks are mounted in binary mode or things go awry. The sed part
of the build process will fail first time around but the build will
continue and
fail later, so build twice (and no I've no idea why sed fails). After that just
the usual amount of salt over the shoulder, frogs leg and bat wing broth, etc.
should get it going. ;-)
Hope that helps.
Nigel
Nigel Perry, New Zealand
From ken@digitas.harvard.edu Tue Mar 6 21:56:28 2001
From: ken@digitas.harvard.edu (Ken Shan)
Date: Tue, 6 Mar 2001 16:56:28 -0500
Subject: Viewing inferred types
Message-ID: <20010306165628.A26183@digitas.harvard.edu>
--Q68bSM7Ycu6FN28Q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Hello all,
When I edit Haskell code in a text editor, I often want to point at an
expression and be told its type. (Even assuming that this feature
only works when the entire file type-checks correctly, it would still
be very useful to me.) For example, in
let c:cs =3D "string" in ...
I would like to point at "c" and be told that
c :: Char
c:cs :: [Char]
I divide this functionality into two parts:
1. Given a Haskell program, produce a list of pairs (span, type),
where "span" is a contiguous region in the source code that parses
as an expression, and "type" is the type of the expression
(possibly universally quantified and/or with context).
2. Make this information easy to generate and view in an editor.
Focusing on part 1, I see two possible approaches:
A. Ask an existing Haskell interpreter/compiler to output the
information. I looked briefly at the implementations listed at
http://www.haskell.org; none of them seems to produce anything
(i.e., any debugging output) from which the necessary information
can be extracted. Therefore, to take this approach, we would need
to modify an implementation. I would be very happy to be
corrected on this observation.
B. Connect a Haskell parser (e.g., hsparser) to a Haskell type
checker (e.g., _Typing Haskell in Haskell_). This is the
preferred approach because the solution would not depend on the
internals of any Haskell implementation. However, the output of
hsparser is neither typed nor desugared for piping into _Typing
Haskell in Haskell_, so some conversion/desugaring work is
required.
I would appreciate any comments, pointers to existing work, or other
help on this project. In particular, how much work would be involved
in approach B above, and has it already been done? Thanks in advance!
--=20
Edit this signature at http://rodimus.digitas.harvard.edu/cgi-bin/ken/sig
Dumpster Clocking: The tendency when looking at objects to guesstimate=20
the amount of time they will take to eventually decompose: "Ski boots are=
=20
the worst. Solid plastic. They'll be around till the sun goes supernova."
--Q68bSM7Ycu6FN28Q
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE6pV0MzjAc4f+uuBURAte/AKD4ulAi86NOK2uGEL4lAiBv/XdYJACguCxO
X4Uct6B7zf2wKVJFTKWD99k=
=ADCU
-----END PGP SIGNATURE-----
--Q68bSM7Ycu6FN28Q--
From bjpop@cs.mu.OZ.AU Wed Mar 7 02:06:44 2001
From: bjpop@cs.mu.OZ.AU (Bernard James POPE)
Date: Wed, 7 Mar 2001 13:06:44 +1100 (EST)
Subject: Viewing inferred types
Message-ID: <200103070206.NAA29941@mundook.cs.mu.OZ.AU>
I think that the ability to view types of subexpressions in programs would
be very useful. Some work has been done in this direction. One example
I know of is Typeview (www-users.cs.york.ac.uk/~olaf/PUBLICATIONS/typeview.html)
The last time I checked it only worked for a small functional language.
> Focusing on part 1, I see two possible approaches:
>
> A. Ask an existing Haskell interpreter/compiler to output the
> information. I looked briefly at the implementations listed at
> http://www.haskell.org; none of them seems to produce anything
> (i.e., any debugging output) from which the necessary information
> can be extracted. Therefore, to take this approach, we would need
> to modify an implementation. I would be very happy to be
> corrected on this observation.
I have looked at pulling types out of various compilers. This can be
tricky for a number of reasons.
ghc provides the -ddump-types flag which
will dump type signatures for all top-level bindings in a module. With some
help from the devlopers I was able to get types for local bindings as well
(lets and wheres). Still, with this information you would need to do some
reconstruction of subexpression types within your typeviewer.
nhc98 provides the option -tbound, which shows the symbol table after type
checking. If I remember correctly I had trouble with the renamer of nhc98.
It seemed hard to reconcile source ids with their renamed counterparts.
> B. Connect a Haskell parser (e.g., hsparser) to a Haskell type
> checker (e.g., _Typing Haskell in Haskell_). This is the
> preferred approach because the solution would not depend on the
> internals of any Haskell implementation. However, the output of
> hsparser is neither typed nor desugared for piping into _Typing
> hsparser is neither typed nor desugared for piping into _Typing
> Haskell in Haskell_, so some conversion/desugaring work is
> required.
I am nearly finished doing precisely this task. Basically I have stuck
hsparser onto the front of thih (with a lot of glue). It only works for
single module programs at the moment, and it runs slowly. The reason I
did this is that I need detailed type information for some other work that
I am doing, and I couldn't easily get what I wanted from the compilers.
It is not currently available for public release, partly because it needs
some polishing, and partly because not all of the code is mine to release
(some of it is Mark Jones'). The intention is to make an alpha release
available soon (next few weeks) with the appropriate permissions granted of
course.
A colleague of mine will be speeding up the code and adding better error
diagnostics, and time permitting, extending the code to multi-modules
(possibly with a hmake style front-end).
If you want more information, or you wish to collaborate on this project
please let me know.
Bernie
From rrt@dcs.gla.ac.uk Wed Mar 7 09:52:08 2001
From: rrt@dcs.gla.ac.uk (Reuben Thomas)
Date: Wed, 7 Mar 2001 09:52:08 +0000 (GMT)
Subject: GHC - Cygwin Installation and also DirectX
In-Reply-To:
Message-ID:
> From painful experience installing GHC under Win2K I can advise you should
> install Cygwin at root level now, contrary to advice in Cygwin. Also make
> sure your disks are mounted in binary mode or things go awry. The sed part
> of the build process will fail first time around but the build will
> continue and
> fail later, so build twice (and no I've no idea why sed fails). After that just
> the usual amount of salt over the shoulder, frogs leg and bat wing broth, etc.
> should get it going. ;-)
Unfortunately, this is all contrary to the advice we currently give: we
advise not to install at the root level, and to mount in text mode. We have
no experience of sed failing.
Of course, you should do whatever works for you, but if you'd like advice
from us, please make sure you've followed our recipe!
(Even more confusing is that our advice has changed recently, and used to be
much more similar to Nigel's...)
--
http://sc3d.org/rrt/ | free, a. already paid for (Peyton Jones)
From Simon Helsen Wed Mar 7 11:43:45 2001
From: Simon Helsen (Simon Helsen)
Date: Wed, 7 Mar 2001 12:43:45 +0100 (CET)
Subject: CALL FOR PAPERS -- JOURNAL OF FUNCTIONAL PROGRAMMING
Message-ID:
CALL FOR PAPERS
SPECIAL ISSUE
JOURNAL OF FUNCTIONAL PROGRAMMING:
DEPENDENT TYPE THEORY MEETS PROGRAMMING PRACTICE
Modern programming languages rely on advanced type systems that detect
errors at compile-time. While the benefits of type systems have long been
recognized, there are some areas where the standard systems in programming
languages are not expressive enough. Language designers usually trade
expressiveness for decidability of the type system. Some interesting
programs will always be rejected (despite their semantical soundness) or
be assigned uninformative types.
There are several remedies to this situation. Dependent type systems,
which allow the formation of types that explicitly depend on other types
or values, are one of the most promising approaches. These systems are
well-investigated from a theoretical point of view by logicians and type
theorists. For example, dependent types are used in proof assistants to
implement various logics and there are sophisticated proof editors for
developing programs in a dependently typed language.
To the present day, the impact of these developments on practical
programming has been small, partially because of the level of
sophistication of these systems and of their type checkers. Only recently,
there have been efforts to integrate dependent systems into intermediate
languages in compilers and programming languages. Additional uses have
been identified in high-profile applications such as mobile code security,
where terms of a dependently typed lambda calculus to encode safety
proofs.
A special issue of the Journal of Functional Programming will be devoted
to the interplay between dependent type theory and programming practice.
We welcome technical contributions in the field, as well as position
papers that:
- make researchers in programming languages aware of new developments
and research directions on the theory side;
- point out to theorists practical uses of advanced type systems and
urge them to address theoretical problems arising in emerging
applications.
Authors who are concerned about the appropriateness of a topic are welcome
to contact the guest editors. Manuscripts should be unpublished works and
not submitted elsewhere. Revised and enhanced versions of papers published
in conference proceedings that have not appeared in archival journals are
eligible for submission. All submissions will be reviewed according to the
usual standards of scholarship and originality.
Submissions should be sent to Gilles Barthe (Gilles.Barthe@inria.fr), with
a copy to Nasreen Ahmad (nasreen@dcs.gla.ac.uk). Submitted articles should
be sent in postscript format preferably gzipped and uuencoded. In
addition, please send, as plain text, title, abstract, and contact
information.
The submission deadline is December 1st, 2001.
Guest Editors:
o Gilles Barthe, INRIA Sophia-Antipolis, France
o Peter Dybjer, Chalmers Tekniska Högskola, Sweden
o Peter Thiemann, Universität Freiburg, Germany
From rrt@dcs.gla.ac.uk Wed Mar 7 13:04:59 2001
From: rrt@dcs.gla.ac.uk (Reuben Thomas)
Date: Wed, 7 Mar 2001 13:04:59 +0000 (GMT)
Subject: GHC - Cygwin Installation and also DirectX (fwd)
Message-ID:
Sigbjorn says:
Link with -mwindows (if going via gcc to get at
the linker.) i.e., if using the std hello.lhs app
ghc -o hello hello.lhs -static -package win32 -optl-mwindows
that'll get you a non-console app with mingw. Think
it'll do the trick with cygwin too.
From N.Perry@massey.ac.nz Wed Mar 7 19:20:03 2001
From: N.Perry@massey.ac.nz (Nigel Perry)
Date: Thu, 8 Mar 2001 08:20:03 +1300
Subject: GHC - Cygwin Installation and also DirectX
In-Reply-To:
References:
Message-ID:
At 9:52 am +0000 7/3/01, Reuben Thomas wrote:
>(Even more confusing is that our advice has changed recently, and used to be
>much more similar to Nigel's...)
I have compiled up to 4.08.1 (or .2 not sure offhand), if Reuben's
advice has changed for later versions then follow them in preference
to my experience.
As to sed failing - it first happened on a PC in the room next to
Ruben's where I was visiting at the time... But these little things
are easy to forget in the huge job of compiling GHC - I keep
forgetting and wonder why it has broken!
Cheers,
Nigel
From miketh@brisbane.paradigmgeo.com Thu Mar 8 07:27:09 2001
From: miketh@brisbane.paradigmgeo.com (Mike Thomas)
Date: Thu, 8 Mar 2001 17:27:09 +1000
Subject: GHC - Cygwin Installation and also DirectX (fwd)
Message-ID: <000501c0a7a1$30d6f160$0cb4a8c0@brisbane.paradigmgeo.com>
Many thanks Reuben and Sigbjorn
> Sigbjorn says:
>
> Link with -mwindows (if going via gcc to get at
> the linker.) i.e., if using the std hello.lhs app
>
> ghc -o hello hello.lhs -static -package win32 -optl-mwindows
>
> that'll get you a non-console app with mingw. Think
> it'll do the trick with cygwin too.
The exe is 4270K, but I can live with that.
Cheers
Mike Thomas
From rrt@dcs.gla.ac.uk Thu Mar 8 08:46:28 2001
From: rrt@dcs.gla.ac.uk (Reuben Thomas)
Date: Thu, 8 Mar 2001 08:46:28 +0000 (GMT)
Subject: GHC - Cygwin Installation and also DirectX (fwd)
In-Reply-To: <000501c0a7a1$30d6f160$0cb4a8c0@brisbane.paradigmgeo.com>
Message-ID:
> The exe is 4270K, but I can live with that.
Even stripped? (Unfortunately GHC does give you big EXEs, and fundamentally
will until we get dynamic linking working again; however, I think I might b=
e
able to improve things drastically even before then by re-enabling object
splitting for the libraries under Windows.)
--=20
http://sc3d.org/rrt/
L'art des vers est de transformer en beaut=E9s les faiblesses (Aragon)
From i1083924@petra.euitio.uniovi.es Thu Mar 8 12:08:26 2001
From: i1083924@petra.euitio.uniovi.es (=?iso-8859-9?Q?Alba_Marina_Lopez_Arg=FCelles?=)
Date: Thu, 08 Mar 2001 13:08:26 +0100 (CET)
Subject: Just one question
Message-ID:
Hi! I'm a Spanish student who is 'trying' to do her final proyect
using Haskell; I don't want to bore you explaining what's the work
about but it has to do with internet and all that.Well,currently I'm just
trying to do a little code using sockets that (giving it an url) connects
to a remote machine and gets information from it.
I've checked a library called LibWWW,and I want to do something similar
to that, but in a lower level and that's why I'm using another library
called SocketPrim.
I've managed to get a socket,to connect it but I cannot managed it to
read.
And now here are the questions:
- There's a function in the library Socket called connectTo and I would
like to know how does it work 'from the inside'.
- I also would like to know what does the function readSocket (from
SocketPrim) return.
- If you know some site where I may get information related with
Haskell about TCP/IP,sockets and all that stuff,I would be very pleased if
you send it to me.
Well,that's all for now.I hope you can resolve my questions to keep
on with the proyect.Thank you very much!
Alba ;)
From simonmar@microsoft.com Thu Mar 8 17:26:57 2001
From: simonmar@microsoft.com (Simon Marlow)
Date: Thu, 8 Mar 2001 09:26:57 -0800
Subject: Just one question
Message-ID: <9584A4A864BD8548932F2F88EB30D1C60171F4EF@TVP-MSG-01.europe.corp.microsoft.com>
Alba Marina Lopez Arguelles writes:
> - There's a function in the library Socket called connectTo
> and I would
> like to know how does it work 'from the inside'.
connectTo is in the Socket library, and it is implemented in terms of
the lower level primitives from SocketPrim. It takes a hostname and
port, and returns a normal Haskell Handle, on which you can use hGetLine
and hPutStr as you would with a file or pipe. This is easiest way to
open up a connection to a server and communicate with it.
> - I also would like to know what does the function readSocket (from
> SocketPrim) return.
I don't recommend using readSocket. Using the normal Haskell I/O
functions with a socket Handle should be enough.
Cheers,
Simon
From miketh@brisbane.paradigmgeo.com Thu Mar 8 21:32:40 2001
From: miketh@brisbane.paradigmgeo.com (Mike Thomas)
Date: Fri, 9 Mar 2001 07:32:40 +1000
Subject: GHC - Cygwin Installation and also DirectX (fwd)
Message-ID: <001601c0a817$5167b880$0cb4a8c0@brisbane.paradigmgeo.com>
> > The exe is 4270K, but I can live with that.
>
> Even stripped?
Woops, sorry. That make it 1869K - a substantial improvement!
> (Unfortunately GHC does give you big EXEs, and
> fundamentally
> will until we get dynamic linking working again; however, I think
> I might be
> able to improve things drastically even before then by re-enabling object
> splitting for the libraries under Windows.)
Thanks. Even without this GHC now stands up very well from my perspective.
I no longer have an excuse for procrastination!
Cheers
Mike Thomas.
From gmu@hotmail.com Fri Mar 9 00:43:40 2001
From: gmu@hotmail.com (G Murali)
Date: Fri, 09 Mar 2001 00:43:40
Subject: newbie
Message-ID:
hi there,
I'm new to this monads stuff.. can you tell me what it is simply ?
an example would be highly appreciated.. i want it is very very simple terms
please..
help please!
gmu
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
From Tom.Pledger@peace.com Fri Mar 9 00:53:00 2001
From: Tom.Pledger@peace.com (Tom Pledger)
Date: Fri, 9 Mar 2001 13:53:00 +1300
Subject: newbie
In-Reply-To:
References:
Message-ID: <15016.10604.931769.647424@waytogo.peace.co.nz>
G Murali writes:
| hi there,
|
| I'm new to this monads stuff.. can you tell me what it is simply ?
| an example would be highly appreciated.. i want it is very very
| simple terms please..
|
| help please!
There are some introductions to monads in the "Books and Tutorials
about Programming in Haskell" section of the haskell.org website.
From franka@cs.uu.nl Fri Mar 9 14:56:02 2001
From: franka@cs.uu.nl (Frank Atanassow)
Date: Fri, 9 Mar 2001 15:56:02 +0100
Subject: newbie
In-Reply-To: ; from gmu@hotmail.com on Fri, Mar 09, 2001 at 12:43:40AM +0000
References:
Message-ID: <20010309155602.A972@cs.uu.nl>
G Murali wrote (on 09-03-01 00:43 +0000):
> I'm new to this monads stuff.. can you tell me what it is simply ?
> an example would be highly appreciated.. i want it is very very simple terms
> please..
A monad on category C is a monoid in the category of endofunctors on C.
Is that simple enough? ;)
No? Then see "Using Monads" at http://haskell.org/bookshelf/
(Sorry, I just couldn't resist!)
--
Frank Atanassow, Information & Computing Sciences, Utrecht University
Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands
Tel +31 (030) 253-3261 Fax +31 (030) 251-379
From thiemann@informatik.uni-freiburg.de Fri Mar 9 14:45:24 2001
From: thiemann@informatik.uni-freiburg.de (Peter Thiemann)
Date: Fri, 9 Mar 2001 15:45:24 +0100 (CET)
Subject: PEPM'02, Preliminary Call for Papers
Message-ID: <200103091445.PAA01568@informatik.uni-freiburg.de>
PRELIMINARY CALL FOR PAPERS
2002 ACM SIGPLAN Workshop on
Partial Evaluation and Semantics-Based Program Manipulation (PEPM'02)
Portland, Oregon, USA, January 14-15, 2002
(preceding POPL'02)
http://www.informatik.uni-freiburg.de/~thiemann/pepm02
Submission deadline: October, 2001
The PEPM'02 workshop will bring together researchers working in the
areas of semantics-based program manipulation, partial evaluation, and
program generation. The workshop focuses on techniques, supporting
theory, and applications of the analysis and manipulation of programs.
Technical topics include, but are not limited to:
* Program manipulation techniques: transformation, specialization,
normalization, reflection, rewriting, run-time code generation,
multi-level programming.
* Program analysis techniques: abstract interpretation, static
analysis, binding-time analysis, attribute grammars, constraints.
* Related issues in language design and models of computation:
imperative, functional, logical, object-oriented, parallel,
distributed, mobile, secure, domain-specific.
* Programs as data objects: staging, meta-programming, incremental
computation, mobility, tools and techniques, prototyping and
debugging.
* Applications: systems programming, scientific computing,
algorithmics, graphics, security checking, simulation, compiler
generation, compiler optimization, decompilation.
* Assessment: applicability of program manipulation techniques to
particular architectures and language paradigms, scalability,
benchmarking, portability.
Original results that bear on these and related topics are solicited.
Papers investigating novel uses and applications of program
manipulation in the broadest sense are especially encouraged. Authors
concerned about the appropriateness of a topic are welcome to consult
with the program chair prior to submission.
SUBMISSION INFORMATION
Papers should be submitted electronically via the workshop's Web
page. Exceptionally, submissions may be emailed to the program
chair: . Acceptable
formats are PostScript or PDF, viewable by gv.
Submissions should not exceed 5000 words, excluding bibliography and
figures. Excessively long submissions may be rejected outright.
Submitted papers will be judged on the basis of significance,
relevance, correctness, originality, and clarity. They should include
a clear identification of what has been accomplished and why it is
significant. They must describe work that has not previously been
published in a major forum. Authors must indicate if a closely
related paper is also being considered for another conference or
journal.
Proceedings will be published as a technical report at the University
of Freiburg. A special issue of the journal "Higher-Order and
Symbolic Computation" is
planned afterwards.
PROGRAM COMMITTEE
Maria Alpuente (Unversity of Valencia, Spain)
Evelyn Duesterwald (Hewlett-Packard Labs, USA)
Robert Glueck (DIKU, Denmark)
Michael Hanus (Christian-Albrecht-University of Kiel, Germany)
Zhenjiang Hu (University of Tokyo, Japan)
John Hughes (Chalmers Technical University, Sweden)
Mark Jones (OGI, USA)
Siau-Cheng Khoo (NUS, Singapore)
Jakob Rehof (Microsoft Research, USA)
Joao Saraiva (University of Minho, Portugal)
Ulrik Schultz (University of Aarhus, Denmark)
Peter Thiemann (University of Freiburg, Germany, chair)
David Walker (CMU, USA)
From ess_lli@cc.helsinki.fi Fri Mar 9 14:21:06 2001
From: ess_lli@cc.helsinki.fi (Ahti Pietarinen)
Date: Fri, 9 Mar 2001 16:21:06 +0200 (EET)
Subject: FG/MOL 2001 Second CFP
Message-ID:
***********************************************************************
[apologies if you receive this more than once]
FGMOL'01 FGMOL'01 FGMOL'01 FGMOL'01 FGMOL'01 FGMOL'01 FGMOL'01 FGMOL'01
FORMAL GRAMMAR/MATHEMATICS OF LANGUAGE CONFERENCE
August 10--12, 2001
Helsinki, Finland
SECOND CALL FOR PAPERS
We are pleased to announce the joint meeting of two conferences:
the sixth conferene on Formal Grammar and the seventh on the
Mathematics of Language. The joint meeting will be held just prior
to the European Summer School in Logic, Language, and Information.
AIMS and SCOPE
FGMOL'01 provides a forum for the presentation of new and original
research on formal grammar and mathematical aspects of language,
especially with regard to the application of formal methods to natural
language analysis.
Themes of interest include, but are not limited to,
* formal and computational syntax, semantics, pragmatics, and phonology;
* model-theoretic and proof-theoretic methods in linguistics;
* constraint-based and resource-sensitive approaches to grammar;
* foundational, methodological and architectural issues in grammar.
* mathematical properties of linguistic frameworks
* theories and models of natural language processing and generation
* parsing theory
* statistical and quantitative models of language
SPECIAL SESSION on MODEL-THEORETIC SYNTAX
There will be a special session of invited papers on model-theoretic
syntax. The speakers will be Geoffrey K. Pullum (keynote),
Patrick Blackburn, James Rogers, and Uwe Moennich.
ADDITIONAL INVITED SPEAKERS to be announced.
SUBMISSION DETAILS
We invite E-MAIL submissions of abstracts for 30-minute papers (including
questions, comments, and discussion).
A submission should consist of two parts:
- an information sheet (in ascii), containing the name of the author(s),
affiliation(s), e-mail and postal address(es) and a title;
- an abstract, consisting of a description of not more than 5 pages
(including figures and references). Abstracts may be either in plain
ASCII or in (unix-compatible encoded) postscript, PDF, or DVI.
Abstracts can be sent to
fgmol@cs.indiana.edu
ABSTRACT SUBMISSION DEADLINE
April 1, 2001
NOTIFICATION OF ACCEPTANCE
May 15, 2001
PROCEEDINGS
A full version of each accepted paper will be included in the conference
proceedings, to be distributed at the conference. Full papers are due
June 30, 2001.
PROGRAMME COMMITTEE
Anne Abeill'e (Paris)
Patrick Blackburn (INRIA)
Gosse Bouma (Groningen)
Mary Dalrymple (Xerox Parc)
Nissim Francez (Haifa)
Thilo Goetz (IBM)
David Johnson (IBM)
Mark Johnso (Brown)
Aravind Joshi (UPenn)
Gerhard J"ager (Utrecht)
Ruth Kempson (London)
Alain Lecomte (LORIA)
Uwe Moennich (T"ubingen)
Glyn Morrill (U.P. Catalunya)
Michael Moortgat (Utrecht)
Owen Rambo (Cogentex)
James Rogers (Earlham)
Giorgio Satta (Padova)
Mark Steedman (Edinburgh)
FURTHER INFORMATION
Web site for ESSLLI XIII: http://www.helsinki.fi/esslli/
Web site for FGMOL'01 :http://www.cis.upenn.edu/~ircs/mol/mol7.html
The organizers:
Geert-Jan Kruijff gj@cogsci.ed.ac.uk
Larry Moss lsm@cs.indiana.edu
Dick Oehrle oehrle@linc.cis.upenn.edu
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%[LaTeX2E Source File]%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}
\usepackage{tabularx}
\setlength{\textwidth}{7in}
\setlength{\oddsidemargin}{-.5in}
\setlength{\topmargin}{-36pt}
\pagestyle{empty}
\begin{document}
\begin{center}
{\em Please Post}\\[.1cm]
{\large{\bf Formal Grammar / Mathematics of Language Conference ---
FGMOL'01\\
CALL FOR PAPERS}}\\
{August 10--12, 2001}\qquad Helsinki\\
\end{center}
\begin{center}
\begin{tabular}{@{}p{.27\textwidth}|p{.70\textwidth}@{}}
%\small\ixpt\setlength{\baselineskip}{9pt}
\footnotesize
\begin{flushleft}
{\bf Programme Committee}
\end{flushleft}
\begin{tabular}{l@{}}
Anne Abeill\'{e} (Paris) \\
Patrick Blackburn (INRIA) \\
Gosse Bouma (Groningen) \\
Mary Dalrymple (Xerox Parc) \\
Nissim Francez (Haifa)\\
Thilo Goetz (IBM)\\
David Johnson (IBM) \\
Mark Johnson (Brown)\\
Aravind Joshi (UPenn)\\
Gerhard J\"{a}ger (Utrecht)\\
Ruth Kempson (London)\\
Alain Lecomte (LORIA)\\
Uwe M\"{o}nnich (T\"{u}bingen)\\
Glyn Morrill (U.P. Catalunya) \\
Michael Moortgat (Utrecht) \\
Owen Rambow (Cogentex)\\
James Rogers (Earlham) \\
Giorgio Satta (Padova) \\
Mark Steedman (Edinburgh)\\
[12pt]
{\bf Organizing Committee}\\
Geert-Jan Kruijff (Prague)\\
Larry Moss (Indiana)\\
Richard Oehrle (Ashford)
\end{tabular}
\medskip
{\bf Important Dates}
\smallskip
\begin{tabular}{l@{}}
Abstracts Due: March 31, 2001\\
Notification: May 15, 2001\\
Final Versions: June 30, 2001\\
Conference: August 10-12, 2001\\
\end{tabular}
\medskip
{\bf Addresses:\quad}
\smallskip
\begin{tabular}{l@{}}
ESSLLI XIII: \\
\texttt{http://www.helsinki.fi/esslli}\\
FGMOL'01:\\
\texttt{http://www.cis.upenn.edu/\ldots}\\
$\quad$ \texttt{\ldots $^{\sim}$ircs/mol/mol7.html}
\end{tabular}
&
\setlength{\parskip}{2pt}
We are pleased to announce the joint meeting of two conferences:
the sixth conferene on Formal Grammar and the seventh on the
Mathematics of Language. The joint meeting will be held just prior
to the European Summer School in Logic, Language, and Information.
\medskip
{\it Aims And Scope} FGMOL'01 provides a forum for the presentation of new
and
original research on formal grammar and mathematical aspects of language,
especially with regard to the application of formal methods to natural
language
analysis. Themes of interest include, but are not limited to,
\begin{itemize}
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}
\item formal and computational syntax, semantics, pragmatics, and
phonology;
\item model-theoretic and proof-theoretic methods in linguistics;
\item constraint-based and resource-sensitive approaches to grammar;
\item foundational, methodological and architectural issues in grammar.
\item mathematical properties of linguistic frameworks
\item theories and models of natural language processing and generation
\item parsing theory
\item statistical and quantitative models of language
\end{itemize}
\noindent We welcome papers from
a wide variety of frameworks.
\medskip
{\it Special session on model-theoretic syntax}
Invited speakers for this are
Geoffrey K. Pullum (keynote),
Patrick Blackburn, James Rogers, and Uwe Moennich.
\medskip
{\it Additional Invited Speakers} to be announced.
\medskip
{\it Submission Details} We invite E-MAIL submissions of abstracts
for 30-minute papers (including questions, comments, and discussion).
A submission should consist of two parts:
\begin{itemize}
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}
\item an information sheet (in ascii), containing the name of the
author(s),
affiliation(s), e-mail and postal address(es) and a title;
\item an abstract, consisting of a description of not more than 5 pages
(including figures and references). Abstracts may be either in plain
ASCII or in (unix-compatible encoded) postscript, PDF, or DVI.
\end{itemize}
\noindent Abstracts can be sent to {\tt fgmol@cs.indiana.edu} (Larry
Moss).
\medskip
{\it Abstract Submission Deadline} March 31, 2001
{\it Notification of Acceptance} May 15, 2001
{\it Proceedings} A full version of each accepted paper will be
included in the conference proceedings, to be distributed at the
conference. Full papers are due June 30, 2001.
\end{tabular}
\end{center}
\end{document}
From jans@numeric-quest.com Fri Mar 9 18:22:28 2001
From: jans@numeric-quest.com (Jan Skibinski)
Date: Fri, 9 Mar 2001 13:22:28 -0500 (EST)
Subject: Interesting application for RandomIOR
Message-ID:
Well, at least interesting for me ... Thinking a bit
about modelling of a standard interpretation of a measurement
in Quantum Mechanics I came up with this tiny addendum
to module QuantumVector:
http://www.numeric-quest.com/haskell/Observation.hs
which simulates apparently random choice of an eigenvalue
and collapses the state to its corresponding eigenvector.
Jan
From gmu@hotmail.com Fri Mar 9 18:32:11 2001
From: gmu@hotmail.com (G Murali)
Date: Fri, 09 Mar 2001 18:32:11
Subject: list of results monad
Message-ID:
hi,
I'm trying to build a monad that will give a list of results.
this is what i want to be able to do
I have
data M a = I [a]
instance Monad M where
return x = I [x]
I (x:xs) >>= f = ??
The type of >>= is m a -> (a -> m b) -> m b
but here the input is [a], now if I apply the input individually on f then i
can get a [m b] and if i extract at each step then I can get [b] and then if
i say return ([b]) i get m b.. right ??
Is this how I go about it .. if so can you give me a small code snippet of
how to do that.
Thanks,
gmu
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
From gmu@hotmail.com Fri Mar 9 23:15:19 2001
From: gmu@hotmail.com (G Murali)
Date: Fri, 09 Mar 2001 23:15:19
Subject: exception handling..
Message-ID:
Hi,
Is it possible to do/mimic exception handling in Haskell using monads.. if
so can you throw in some pointers on this please..
gmu
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
From edrx@inx.com.br Sat Mar 10 09:54:27 2001
From: edrx@inx.com.br (Eduardo Ochs)
Date: Sat, 10 Mar 2001 06:54:27 -0300 (BRT)
Subject: newbie
Message-ID: <20010310095427.E5E3C9FA56@angg>
Frank Atanassow wrote:
> G Murali wrote (on 09-03-01 00:43 +0000):
> > I'm new to this monads stuff.. can you tell me what it is simply ?
> > an example would be highly appreciated.. i want it is very very
> > simple terms please..
>
> A monad on category C is a monoid in the category of endofunctors on C.
>
> Is that simple enough? ;)
>
> No? Then see "Using Monads" at http://haskell.org/bookshelf/
>
> (Sorry, I just couldn't resist!)
Uh-oh. I'm a junior categorist and toposopher and I confess that all
my few attempts to understand what Haskell's monads have to do with
the categorical notion of a monad have failed more or less miserably.
Can someone point me to a relevant paper, or give a quick explanation?
Thanks in advance, and sorry for the dumb question,
Eduardo Ochs
http://angg.twu.net/
edrx@inx.com.br
From edrx@inx.com.br Sat Mar 10 10:08:37 2001
From: edrx@inx.com.br (Eduardo Ochs)
Date: Sat, 10 Mar 2001 07:08:37 -0300 (BRT)
Subject: newbie
Message-ID: <20010310100837.B6B629FA56@angg>
Frank Atanassow wrote:
> G Murali wrote (on 09-03-01 00:43 +0000):
> > I'm new to this monads stuff.. can you tell me what it is simply ?
> > an example would be highly appreciated.. i want it is very very
> > simple terms please..
>
> A monad on category C is a monoid in the category of endofunctors on C.
>
> Is that simple enough? ;)
>
> No? Then see "Using Monads" at http://haskell.org/bookshelf/
>
> (Sorry, I just couldn't resist!)
Uh-oh. I'm a junior categorist and toposopher and I confess that all
my few attempts to understand what Haskell's monads have to do with
the categorical notion of a monad have failed more or less miserably.
Can someone point me to a relevant paper, or give a quick explanation?
Thanks in advance, and sorry for the dumb question,
Eduardo Ochs
http://angg.twu.net/
edrx@inx.com.br
From len@mail.wplus.net Sat Mar 10 11:48:43 2001
From: len@mail.wplus.net (Leonid Bouriakovsky)
Date: Sat, 10 Mar 2001 14:48:43 +0300
Subject: newbie
Message-ID: <007b01c0a958$17622ca0$0d010101@len>
Perhaps, this paper will help:
http://citeseer.nj.nec.com/62964.html
>Eduardo Ochs wrote:
>
>>Frank Atanassow wrote:
>>
>> A monad on category C is a monoid in the category of endofunctors on C.
>>
>> Is that simple enough? ;)
>
>Uh-oh. I'm a junior categorist and toposopher and I confess that all
>my few attempts to understand what Haskell's monads have to do with
>the categorical notion of a monad have failed more or less miserably.
>Can someone point me to a relevant paper, or give a quick explanation?
From jenglish@flightlab.com Sat Mar 10 17:34:28 2001
From: jenglish@flightlab.com (Joe English)
Date: Sat, 10 Mar 2001 09:34:28 -0800
Subject: newbie
In-Reply-To: <20010310095427.E5E3C9FA56@angg>
References: <20010310095427.E5E3C9FA56@angg>
Message-ID: <200103101734.JAA12241@dragon.flightlab.com>
Eduardo Ochs wrote:
> Frank Atanassow wrote:
> > G Murali wrote (on 09-03-01 00:43 +0000):
> > > I'm new to this monads stuff.. can you tell me what it is simply ?
> > A monad on category C is a monoid in the category of endofunctors on C.
> > Is that simple enough? ;)
>
> Uh-oh. I'm a junior categorist and toposopher and I confess that all
> my few attempts to understand what Haskell's monads have to do with
> the categorical notion of a monad have failed more or less miserably.
> Can someone point me to a relevant paper, or give a quick explanation?
The relevant category for Haskell is the one in which
objects are types and arrows are functions. The identity
arrow for object 't' is 'id' instantiated at type 'id :: t -> t',
and composition of arrows is function composition.
Single-argument type constructors like '[]', Maybe, etc.,
map types to types (objects to objects). If equipped with a
suitable function 'fmap :: (a -> b) -> (T a -> T b)'
(i.e., taking arrows to arrows), they form a categorical
functor (specifically, an endofunctor), and can be made instances
of the Haskell Functor class.
Polymorphic functions are natural transformations: a function
'f :: forall a. F a -> G a' gives, for each object (type) 't'
an arrow from 'F t' to 'G t'.
One of the definitions of a monad is: a functor M equipped
with two natural transformations: eta : Id -> M and mu : MM -> M
(obeying certain laws). Translating this into Haskell,
this is a type constructor M along with polymorphic functions
'return :: forall a. a -> M a' and 'join :: forall a. M (M a) -> M a'
(again obeying certain laws).
The 'join' function makes intuitive sense for "container-like"
monads like List (join = concat :: [[a]] -> [a]) and Maybe
(join (Just (Just x)) = Just x ; join Just Nothing = join Nothing = Nothing).
For other monads like state transformers, parsers, and IO it's
less intuitive, so it's more common to define Haskell Monads
in terms of the "bind" operation ">>=",
(>>=) :: (M a) -> (a -> M b) -> M b
which is a close relative of the Kleisli composition operator.
Join, bind, and Kleisli composition are all interdefinable:
(>>=) :: (M a) -> (a -> M b) -> M b
join :: M (M a) -> M a
o :: (b -> M c) -> (a -> M b) -> (a -> M c)
m >>= k = join (fmap k m)
join mm = mm >>= id
f `o` g = join . fmap f . g
Wadler's "Comprehending Monads" gives a very good presentation
using the fmap/return/join formulation (called map/unit/join
in that paper). "The Essense of Functional Programming"
is another very good presentation using the return/>>=
formulation (there called "unitM/bindM"). See
--Joe English
jenglish@flightlab.com
From rjljr2@yahoo.com Sat Mar 10 20:20:48 2001
From: rjljr2@yahoo.com (Ronald Legere)
Date: Sat, 10 Mar 2001 12:20:48 -0800 (PST)
Subject: FFI tutorial??
In-Reply-To: <37DA476A2BC9F64C95379BF66BA269025EAE3C@red-msg-09.redmond.corp.microsoft.com>
Message-ID: <20010310202048.27616.qmail@web10012.mail.yahoo.com>
Does anyone know of a tutorial introduction to the
FFI? How does one go about getting started with this
thing? Any simple examples? I just want to be able
to do simple things (mostly access a c library from
haskell... ok maybe not trivial :) ) I would be
happy if I could just call c programs with simple
types and pointers (no way am I going to figure out
struct alignment! ).
I have had some success with Java Native methods,
so I believe such things can be done :0
Cheers!
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/
From thorinn@diku.dk Sat Mar 10 20:35:44 2001
From: thorinn@diku.dk (Lars Henrik Mathiesen)
Date: 10 Mar 2001 20:35:44 -0000
Subject: newbie
In-Reply-To: <200103101734.JAA12241@dragon.flightlab.com> (message from Joe
English on Sat, 10 Mar 2001 09:34:28 -0800)
Message-ID: <20010310203544.26193.qmail@tyr.diku.dk>
> From: Joe English
> Date: Sat, 10 Mar 2001 09:34:28 -0800
> The relevant category for Haskell is the one in which
> objects are types and arrows are functions. The identity
> arrow for object 't' is 'id' instantiated at type 'id :: t -> t',
> and composition of arrows is function composition.
>
> Single-argument type constructors like '[]', Maybe, etc.,
> map types to types (objects to objects). If equipped with a
> suitable function 'fmap :: (a -> b) -> (T a -> T b)'
> (i.e., taking arrows to arrows), they form a categorical
> functor (specifically, an endofunctor), and can be made instances
> of the Haskell Functor class.
>
> Polymorphic functions are natural transformations: a function
> 'f :: forall a. F a -> G a' gives, for each object (type) 't'
> an arrow from 'F t' to 'G t'.
>
> One of the definitions of a monad is: a functor M equipped
> with two natural transformations: eta : Id -> M and mu : MM -> M
> (obeying certain laws). Translating this into Haskell,
> this is a type constructor M along with polymorphic functions
> 'return :: forall a. a -> M a' and 'join :: forall a. M (M a) -> M a'
> (again obeying certain laws).
However, in some expositions of category theory, the usefulness of
monads is justified because they 'belong' to a certain adjunction.
In Haskell you can't express the adjunction, only the monad, which may
take a little getting used to.
But how about the related concept of an M-algebra? That is, a type T
and a function 'xi :: M T -> T' so that these laws hold:
xi . eta === id
xi . (fmap xi) === xi . mu
As it is, the List monad expresses the idea of the free monoid over a
set. A List-algebra is of course a general monoid:
e :: T
e = xi []
(#) :: T -> T -> T
(#) = \x y.xi [x y]
(And 'M a' is an M-algebra for any a, using xi = join).
And what you do every time you write 'foldl 0 +' in a program is to
give the xi of the additive monoid structure on the Num types.
Would it be useful to have functions that were polymorphic over
List-algebras? (Not that I have any idea how that might be possible to
express in Haskell).
Lars Mathiesen (U of Copenhagen CS Dep) (Humour NOT marked)
From chak@cse.unsw.edu.au Sun Mar 11 03:53:07 2001
From: chak@cse.unsw.edu.au (Manuel M. T. Chakravarty)
Date: Sun, 11 Mar 2001 14:53:07 +1100
Subject: FFI tutorial??
In-Reply-To: <20010310202048.27616.qmail@web10012.mail.yahoo.com>
References: <37DA476A2BC9F64C95379BF66BA269025EAE3C@red-msg-09.redmond.corp.microsoft.com>
<20010310202048.27616.qmail@web10012.mail.yahoo.com>
Message-ID: <20010311145307H.chak@cse.unsw.edu.au>
Ronald Legere wrote,
> Does anyone know of a tutorial introduction to the
> FFI? How does one go about getting started with this
> thing? Any simple examples?
Unfortunately, there is no tutorial style text about the FFI
yet - I agree that it is necessary to have one, but nobody
sat down and wrote one so far.
> I just want to be able
> to do simple things (mostly access a c library from
> haskell... ok maybe not trivial :) ) I would be
> happy if I could just call c programs with simple
> types and pointers (no way am I going to figure out
> struct alignment! ).
Have you had a look at the various tools that simplify
calling C code? (The do stuff like figuring out struct
alignment automatically.) There are four tools by now (in
order of increasing complexity and sophistication):
(1) hsc2hs: Comes with new versions of GHC.
(2) c2hs: http://www.cse.unsw.edu.au/~chak/haskell/c2hs/
(3) greencard: http://haskell.org/greencard/
(4) hdirect: http://haskell.org/hdirect/
You see - the Haskell developers believe in choice ;-)
Cheers,
Manuel
From khaliff@astercity.net Sun Mar 11 16:43:28 2001
From: khaliff@astercity.net (Wojciech Moczydlowski, Jr)
Date: Sun, 11 Mar 2001 17:43:28 +0100 (CET)
Subject: FFI tutorial??
In-Reply-To: <20010310202048.27616.qmail@web10012.mail.yahoo.com>
Message-ID:
On Sat, 10 Mar 2001, Ronald Legere wrote:
> Does anyone know of a tutorial introduction to the
> FFI? How does one go about getting started with this
> thing? Any simple examples? I just want to be able
> to do simple things (mostly access a c library from
> haskell... ok maybe not trivial :) ) I would be
> happy if I could just call c programs with simple
> types and pointers (no way am I going to figure out
> struct alignment! ).
> I have had some success with Java Native methods,
> so I believe such things can be done :0
>
> Cheers!
Try KDirect - it is relatively simple and the tutorial is present. On the
other hand, it isn't very powerful - yet it may satisfy you.
http://www.astercity.net/~khaliff/haskell/kdirect
Wojciech Moczydlowski, Jr
From uk1o@rz.uni-karlsruhe.de Mon Mar 12 01:28:11 2001
From: uk1o@rz.uni-karlsruhe.de (Hannah Schroeter)
Date: Mon, 12 Mar 2001 02:28:11 +0100
Subject: list of results monad
In-Reply-To: ; from gmu@hotmail.com on Fri, Mar 09, 2001 at 06:32:11PM +0000
References:
Message-ID: <20010312022810.M21762@rz.uni-karlsruhe.de>
Hello!
On Fri, Mar 09, 2001 at 06:32:11PM +0000, G Murali wrote:
> hi,
> I'm trying to build a monad that will give a list of results.
> this is what i want to be able to do
> I have
> data M a = I [a]
> instance Monad M where
> return x = I [x]
> I (x:xs) >>= f = ??
> The type of >>= is m a -> (a -> m b) -> m b
> but here the input is [a], now if I apply the input individually on f then i
> can get a [m b] and if i extract at each step then I can get [b] and then if
> i say return ([b]) i get m b.. right ??
> Is this how I go about it .. if so can you give me a small code snippet of
> how to do that.
Seems you have a different take on monads than me. For me that
which you give to "return" is to be threaded to the next action,
not to some end result of the whole computation.
I *did* do a result monad once (for data compression, in fact
the monad was combined for "imperatively" consuming input as well
as "imperatively" producing output).
In principle, a result monad is a state monad where the state
is the accumulated output. An input+result monad is a state monad
where the state is a tuple of remaining input and accumulated output.
So, I'd do something like this:
data ResultM r a = RM (r -> (r,a))
instance Monad (ResultM r) where
return x = RM $ \oldResult -> (oldResult, x)
(RM m1) >>= fm2 = RM$ \oldResult ->
case m1 oldResult of
(result', a) -> case fm2 a of
RM m2 -> m2 result'
-- (>>) is defaulted!
mfail s = error s
-- if you want to have "exception handling" for mfail, you'd
-- need to have RM (r -> Either String (r,a)) above
changeResult :: (r -> r) -> RM r ()
changeResult changeFn = RM $ \oldResult -> (changeFn oldResult, ())
runResultM :: ResultM r a -> r -> (r,a)
runResultM (RM f) initRes = f initRes
-- with Lists:
runListResultM m = runResultM m []
addResult :: r -> RM [r] ()
addResult element = RM $ \oldResult -> (oldResult ++ [element], ())
-- with functions to finally yield lists (like shows)
runListFnM :: ResultM ([r] -> [r]) a -> ([r], a)
runListFnM (RM m) = case m id of
(listFn, a) -> (listFn [], a)
addFnResult :: r -> RM ([r] -> [r]) ()
addFnResult x = RM $ \oldRes -> (oldRes . (x:), ())
Usage:
someComputation = do
somehow compute x
addFnResult x
...
addFnResult y
...
return z
... runListFnM someComputation === ([x,y], z)
Kind regards,
Hannah.
From Dominic.J.Steinitz@BritishAirways.com Mon Mar 12 11:43:23 2001
From: Dominic.J.Steinitz@BritishAirways.com (Steinitz, Dominic J)
Date: 12 Mar 2001 11:43:23 Z
Subject: newbie
Message-ID: <"02A2D3AACB65B012*/c=GB/admd=ATTMAIL/prmd=BA/o=British Airways PLC/ou=CORPLN1/s=Steinitz/g=Dominic/i=J/"@MHS>
Monads in Haskell use the Kleisli triple definition which is equivalent to the two natural transformations and functor definition (with the appropriate laws) - see Algebraic Theories by Manes. When using the do notation you are effectively working in the Kleisli category generated by the monad.
Dominic.
edrx@inx.com.br on 10/03/2001 10:13:00
To: haskell
cc:
bcc: Dominic Steinitz
Subject: Re: newbie
Frank Atanassow wrote:
> G Murali wrote (on 09-03-01 00:43 +0000):
> > I'm new to this monads stuff.. can you tell me what it is simply ?
> > an example would be highly appreciated.. i want it is very very
> > simple terms please..
>
> A monad on category C is a monoid in the category of endofunctors on C.
>
> Is that simple enough? ;)
>
> No? Then see "Using Monads" at http://haskell.org/bookshelf/
>
> (Sorry, I just couldn't resist!)
Uh-oh. I'm a junior categorist and toposopher and I confess that all
my few attempts to understand what Haskell's monads have to do with
the categorical notion of a monad have failed more or less miserably.
Can someone point me to a relevant paper, or give a quick explanation?
Thanks in advance, and sorry for the dumb question,
Eduardo Ochs
http://angg.twu.net/
edrx@inx.com.br
_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell
-------------------------------------------------------------------------------------------------
21st century air travel http://www.britishairways.com
From simonpj@microsoft.com Mon Mar 12 12:44:09 2001
From: simonpj@microsoft.com (Simon Peyton-Jones)
Date: Mon, 12 Mar 2001 04:44:09 -0800
Subject: exception handling..
Message-ID: <37DA476A2BC9F64C95379BF66BA2690260DC32@red-msg-09.redmond.corp.microsoft.com>
http://research.microsoft.com/~simonpj/papers/marktoberdorf.ps.gz
http://research.microsoft.com/~simonpj/Papers/except.ps.gz
http://research.microsoft.com/~simonpj/papers/asynch-exns.ps.gz
| -----Original Message-----
| From: G Murali [mailto:gmu@hotmail.com]
| Sent: 09 March 2001 23:15
| To: haskell@haskell.org
| Subject: exception handling..
|
|
| Hi,
|
| Is it possible to do/mimic exception handling in Haskell
| using monads.. if
| so can you throw in some pointers on this please..
|
| gmu
| ______________________________________________________________
| ___________
| Get Your Private, Free E-mail from MSN Hotmail at
| http://www.hotmail.com.
|
|
| _______________________________________________
| Haskell mailing list
| Haskell@haskell.org
| http://www.haskell.org/mailman/listinfo/haskell
|
From franka@cs.uu.nl Fri Mar 9 20:33:09 2001
From: franka@cs.uu.nl (Frank Atanassow)
Date: Fri, 9 Mar 2001 21:33:09 +0100
Subject: newbie
Message-ID: <20010309213309.A1440@cs.uu.nl>
> On Fri, 9 Mar 2001, Frank Atanassow wrote:
> > A monad on category C is a monoid in the category of endofunctors on C.
Surprisingly, my facetious little remark about monads elicited the following
response (whose author I will not disclose, as I haven't obtained
permission yet):
Somebody wrote (on 09-03-01 15:38 +0000):
> Hi Frank --- Believe it or not your one-liner actually *is* helpful to me.
> >From dim & distant algebra days I remember the definition of monoid (set,
> binary operation, associative, left & right unit) but being a Physics
> major/Maths minor, a long time ago, I was deprived of any introduction to
> Category Theory. I've read some of the papers Haskell monads section &
> also had a look at some category theory books --- but I can't remember
> seeing your nice one-line definition --- do you have a reference to the
> paper or book(s) that do it this way?
I think the monoidal characterization is well known. I first saw it in Asperti
& Longo [1] (p.75), but I'm sure it can be found in other texts. The
connection with monoids is not very evident in Haskell, but is worth keeping
in mind if you know a bit of category theory.
BTW, part of the reason I'm posting this to the Haskell list is to plug a
little project I have started on my home page. It's a small collection of useful
reference texts which deal with programming languages and semantics, all of
which have become available on the web. [1] is among these.
I occasionally see posts on this list from people who are not researchers or
educators (and consequently do not have ready access to such published
material) expressing some interest in exploring PL theory and other, related
formal topics further, if only the ``barrier-to-entry'' were not so
high. Indeed, there is a wealth of technical articles which are available
online, and could prove useful or at least interesting to many Haskell and ML
programmers, but even the ones directed at a relatively wide audience of PL
researchers can be hard to grasp for non-researchers. Personally, I think this
is one reason that Haskell and ML are still fairly marginalized languages. My
hope is that this list can grow into a useful resource for go-getters and
self-starters from other fields and communities, as well as the average PL
researcher.
OK, I am only a stupid PhD student with no publications under my belt, but
anyhow that is how I felt before I became a researcher. Over the space of a
few years, while I was still hacking C++ in the dungeons of our vast corporate
megacomplex, I laid out several hundred dollars of my own money to buy enough
texts to jumpstart my own education, and what started with one book soon
exploded into a mini-library of hardbacks and articles (because you know the
dependencies in any non-trivial bibliography resemble a large bowl of sticky
spaghetti), and I would have been deliriously happy to learn that, for
example, Barendregt's encyclopaedic book on lambda-calculus was actually
readable from the web. So here's to you, my comrades-in-arms.
As it states on my page, if any of you know of any other relevant texts
which might be added to the list, please contact me and I will augment the
list forthwith.
The list is available at:
http://www.cs.uu.nl/people/franka/
and here is the reference I promised:
[1] Andrea Asperti and Giussepe Longo. Categories, Types and Structures. An
introduction to Category Theory for the working computer
scientist. MIT Press, 1991.
URL: http://www.dmi.ens.fr/users/longo/download.html
Regards,
--
Frank Atanassow, Information & Computing Sciences, Utrecht University
Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands
Tel +31 (030) 253-3261 Fax +31 (030) 251-379
From franka@cs.uu.nl Mon Mar 12 14:10:09 2001
From: franka@cs.uu.nl (Frank Atanassow)
Date: Mon, 12 Mar 2001 15:10:09 +0100
Subject: newbie
In-Reply-To: <20010309213309.A1440@cs.uu.nl>; from franka@cs.uu.nl on Fri, Mar 09, 2001 at 09:33:09PM +0100
References: <20010309213309.A1440@cs.uu.nl>
Message-ID: <20010312151009.A3402@cs.uu.nl>
Frank Atanassow wrote (on 09-03-01 21:33 +0100):
> > On Fri, 9 Mar 2001, Frank Atanassow wrote:
> > > A monad on category C is a monoid in the category of endofunctors on C.
>
> Surprisingly, my facetious little remark about monads elicited the following
> response (whose author I will not disclose, as I haven't obtained
> permission yet):
So much for my attempt at discretion. Sorry, Phil. I Bcc'd the list, but maybe
my understanding of the way it works is wrong...
--
Frank Atanassow, Information & Computing Sciences, Utrecht University
Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands
Tel +31 (030) 253-3261 Fax +31 (030) 251-379
From qrczak@knm.org.pl Mon Mar 12 14:08:50 2001
From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk)
Date: 12 Mar 2001 14:08:50 GMT
Subject: list of results monad
References: <20010312022810.M21762@rz.uni-karlsruhe.de>
Message-ID:
Mon, 12 Mar 2001 02:28:11 +0100, Hannah Schroeter pisze:
> I *did* do a result monad once (for data compression, in fact
> the monad was combined for "imperatively" consuming input as well
> as "imperatively" producing output).
These monads are present in ghc >= 4.06, in -package lang, modules:
MonadReader
MonadWriter
MonadState
MonadRWS
The combination of state and output can be done as one of these:
WriterT w (State s)
StateT s (Writer w)
RWS () w s
where w is the type of output and must be a monoid (e.g. a list)
and s is the type of state.
> data ResultM r a = RM (r -> (r,a))
This is isomorphic to MonadState.State.
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK
From simonpj@microsoft.com Mon Mar 12 15:43:33 2001
From: simonpj@microsoft.com (Simon Peyton-Jones)
Date: Mon, 12 Mar 2001 07:43:33 -0800
Subject: Any in Haskell Report
Message-ID: <37DA476A2BC9F64C95379BF66BA2690260D8FA@red-msg-09.redmond.corp.microsoft.com>
Folks,
In the Haskell Report, Feliks points out:
| On pp. 5 and 120 the rule for "ANYseq" has a very strange
| structure: why the
| "{ANY}" at the beginning and end of the subtracted stuff? It
| seems it could
| be simplified, or at least explained.
I have no idea why it can't be just
ANYseq -> {ANY}_
Can anyone see why this simpler form would not work?
I propose to adopt this simplification.
Simon
From franka@cs.uu.nl Mon Mar 12 16:16:29 2001
From: franka@cs.uu.nl (Frank Atanassow)
Date: Mon, 12 Mar 2001 17:16:29 +0100
Subject: newbie
In-Reply-To: <20010310203544.26193.qmail@tyr.diku.dk>; from thorinn@diku.dk on Sat, Mar 10, 2001 at 08:35:44PM -0000
References: <200103101734.JAA12241@dragon.flightlab.com> <20010310203544.26193.qmail@tyr.diku.dk>
Message-ID: <20010312171629.C3402@cs.uu.nl>
Lars Henrik Mathiesen wrote (on 10-03-01 20:35 -0000):
> However, in some expositions of category theory, the usefulness of
> monads is justified because they 'belong' to a certain adjunction.
You can regard a monad as arising from a particular adjunction but, although
every adjunction determines a unique monad, the converse is not true. In fact,
the collection of resolutions for a monad forms a category with adjunctions as
objects and certain functors as arrows. The adjunction which gives rise to the
Kleisli category is initial in this category. The terminal object is called
the Eilenberg-Moore category and it has as objects M-algebras, like your `xi',
and as arrows M-algebra homomorphisms.
> In Haskell you can't express the adjunction, only the monad, which may
> take a little getting used to.
I've been looking at this recently to find some canonical way to express how
to `deconstruct' monadic terms (i.e., how to run them). The idea is that you
build up monadic terms in the Kleisli category, somehow describe a resolution,
then use the initiality property of the Kleisli category to map the terms to
the category of the resolution, where you can use the adjunction to
destructure them.
> But how about the related concept of an M-algebra? That is, a type T
> and a function 'xi :: M T -> T' so that these laws hold:
> xi . eta === id
> xi . (fmap xi) === xi . mu
If you reverse the sense of the last equation and regard the monad primitives
as constructors:
xi (Eta x) = x
xi (Mu m) = xi (fmap xi m)
then this starts to look like a pattern-matching definition for folding a
monad regarded as an algebra. In fact, you can express the operators this way
in Haskell if you use are willing to use a nested datatype:
data M a = Eta a | Mu (M (M a))
> Would it be useful to have functions that were polymorphic over
> List-algebras? (Not that I have any idea how that might be possible to
> express in Haskell).
I dunno if it is useful for List-algebras, but if you take your monad M as the
substitution monad generated by a term signature, then the the resolutions of
the monad can be regarded as a way of factoring M into a composition of
signatures which (I think) represent the values and redexes of the term
language. The Kleisli and E-M categories are extremal cases. In the Kleisli
category the redex functor is trivial; I think this is this is why you can use
it to pass around computations.
In the E-M category, the value functor is trivial, but I'm not sure what this
means precisely yet. For intermediate cases, you get a particular choice of
normal forms. What I'm thinking is that an M-algebra for a language M gives
you a way of extending a denotational description of the normal forms to one
for the entire language, which is automatically sound for the equational
theory.
Which sounds useful to me for writing interpreters.
--
Frank Atanassow, Information & Computing Sciences, Utrecht University
Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands
Tel +31 (030) 253-3261 Fax +31 (030) 251-379
From qrczak@knm.org.pl Mon Mar 12 16:33:53 2001
From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk)
Date: 12 Mar 2001 16:33:53 GMT
Subject: Any in Haskell Report
References: <37DA476A2BC9F64C95379BF66BA2690260D8FA@red-msg-09.redmond.corp.microsoft.com>
Message-ID:
Mon, 12 Mar 2001 07:43:33 -0800, Simon Peyton-Jones pisze:
> I have no idea why it can't be just
>
> ANYseq -> {ANY}_
This would mean: it's a sequence of characters which is not equal to
'{-' or '-}'. But it should mean: it's a sequence of characters which
doesn't contain '{-' or '-}'. The current definition is correct,
this one is not.
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK
From thorinn@diku.dk Tue Mar 13 00:12:02 2001
From: thorinn@diku.dk (Lars Henrik Mathiesen)
Date: 13 Mar 2001 00:12:02 -0000
Subject: newbie
In-Reply-To: <20010312171629.C3402@cs.uu.nl> (message from Frank Atanassow on
Mon, 12 Mar 2001 17:16:29 +0100)
Message-ID: <20010313001202.13842.qmail@tyr.diku.dk>
> Date: Mon, 12 Mar 2001 17:16:29 +0100
> From: Frank Atanassow
> Lars Henrik Mathiesen wrote (on 10-03-01 20:35 -0000):
> > However, in some expositions of category theory, the usefulness of
> > monads is justified because they 'belong' to a certain adjunction.
>
> You can regard a monad as arising from a particular adjunction but,
> although every adjunction determines a unique monad, the converse is
> not true. In fact, the collection of resolutions for a monad forms a
> category with adjunctions as objects and certain functors as arrows.
> The adjunction which gives rise to the Kleisli category is initial
> in this category. The terminal object is called the Eilenberg-Moore
> category and it has as objects M-algebras, like your `xi', and as
> arrows M-algebra homomorphisms.
Yes, I was aware of that --- I should perhaps have said that there's
typically a 'motivating' adjunction, often one involving a forgetful
functor. Which is generally different from the one into the Kleisli
category.
I read the rest of your post with great interest too, though I need to
work at it a bit before I think I understand all of it. MacLane is off
the shelf, and section IV.7 is scheduled to be worked though come the
weekend.
My own thoughts were a bit less ambitious, and I found out that
Haskell (at least hugs -98 +o) will in fact do what I had in mind:
> module Algebra () where
> class Monad m => Algebra m a where xi :: m a -> a
> instance (Num a) => Algebra [] a where
> xi = foldl (+) 0
> instance Algebra [] [a] where xi = concat
> unit :: Algebra [] a => a
> unit = xi []
> (#) :: Algebra [] a => a -> a -> a
> x # y = xi [x, y]
Prelude> :load Algebra.lhs
Reading file "Algebra.lhs":
Hugs session for:
/usr/local/share/hugs/lib/Prelude.hs
Algebra.lhs
Algebra> unit :: Int
0
Algebra> unit :: Float
0.0
Algebra> unit :: [Char]
""
Algebra> "foo" # "bar"
"foobar"
Algebra> (1::Int) # 2 # 3
6
But perhaps I'm just easily amused.
Lars Mathiesen (U of Copenhagen CS Dep) (Humour NOT marked)
From gmh@Cs.Nott.AC.UK Tue Mar 13 09:42:10 2001
From: gmh@Cs.Nott.AC.UK (Graham Hutton)
Date: Tue, 13 Mar 2001 09:42:10 +0000
Subject: fold and unfold
Message-ID: <20010313094315.03D5C255B2@www.haskell.org>
Dear all,
The following new paper may be of interest to some readers of this group:
When is a Function a Fold or an Unfold?
Jeremy Gibbons, Graham Hutton, and Thorsten Altenkirch
http://www.cs.nott.ac.uk/~gmh/when.pdf
http://www.cs.nott.ac.uk/~gmh/when.ps
We give a necessary and sufficient condition for when a set-theoretic
function can be written using the recursion operator fold, and a dual
condition for the recursion operator unfold. The conditions are
simple, practically useful, and generic in the underlying datatype.
(To appear in the Proceedings of the 4th International Workshop on
Coalgebraic Methods in Computer Science, Genova, Italy, April 2001.)
Best wishes,
Graham
+-----------------------------------------------------------------------------+
| Dr Graham Hutton Email : gmh@cs.nott.ac.uk |
| Languages and Programming Group Web : http://www.cs.nott.ac.uk/~gmh/ |
| School of Computer Science and IT |
| The University of Nottingham |
| Jubilee Campus, Wollaton Road |
| Nottingham NG8 1BB |
| United Kingdom |
+-----------------------------------------------------------------------------+
From andreas.marth@daimlerchrysler.com Tue Mar 13 14:16:00 2001
From: andreas.marth@daimlerchrysler.com (andreas.marth@daimlerchrysler.com)
Date: Tue, 13 Mar 2001 15:16:00 +0100
Subject: guiding strictness/lazyness through the program
Message-ID: <0057440010408455000002L452*@MHS>
Hallo!
Does anybody know of a paper that describes ways how to force strict ev=
aluation=20
at some places and lazy evaluation at others?
And I am also interested in a guideline when to use strict evaluation =
and when=20
lazy.
Any pointers appreciated!
Thanks,
Andreas
=
From nipkow@informatik.tu-muenchen.de Tue Mar 13 14:20:30 2001
From: nipkow@informatik.tu-muenchen.de (nipkow@informatik.tu-muenchen.de)
Date: Tue, 13 Mar 2001 15:20:30 +0100
Subject: Research Assistant/PhD Vacancy
Message-ID: <20010313142038Z147822-343+392@sunbroy49.informatik.tu-muenchen.de>
TOOL SUPPORT FOR LOGICAL CALCULI
Research Assistant/PhD Vacancy
Technical University Munich
The theorem proving group (http://www4.in.tum.de/~kleing/group/group.html) at
the Technical University Munich is looking for a research assistant to join a
DFG-funded project focussing on the development and application of the
theorem prover Isabelle (http://isabelle.in.tum.de). The position offers
exciting opportunities for scientifically challenging research leading to a
PhD. The appointment is initially for 2 years with an optional extension.
We seek a candidate with a strong background in at least one of the following
areas
- theorem proving
- logic
- semantics of programming languages
- functional/logic programming
- specification languages
who should like to work on the boundary between theory and practice.
Depending on the candidates interests and abilities, the work can focus an
either of the following areas:
- logical calculi for the development of (object oriented) programs
- structuring mechanisms for large theories
- tool support for automated reasoning
Informal inquiries and formal applications should be addressed to
nipkow@in.tum.de (http://www.in.tum.de/~nipkow).
From theo@engr.mun.ca Tue Mar 13 19:45:31 2001
From: theo@engr.mun.ca (Theodore Norvell)
Date: Tue, 13 Mar 2001 16:15:31 -0330
Subject: Laws for Monad and MonadPlus.
Message-ID: <3AAE78DB.F65A08E3@engr.mun.ca>
Hi all. I was revising a short article I've written about
Monads in Haskell and started wondering about the identities
associated with Monads.
I think it is generally agreed (and in the report) that the
following identities should be true of a Monad:
Left identity: return a >>= k = k a
Right identity: p >>= return = p
Associativity: (p >>= j) >= k = p >>= (\x->(j x >>= k))
[provided x is not free in j or k]
What about MonadPlus? By analogy with semirings, I came up with:
Zero: mzero >>= k = mzero = p >>= (\x -> mzero)
Identity: p `mplus` mzero = p = mzero `mplus` p
Commutativity: p `mplus` q = q `mplus` p
Right distributivity: (p `mplus` q) >>= k = (p >>= k) `mplus` (q >>= k)
Left distributivity: p >>= (\x->j x `mplus` k x) = (p >>= j) `mplus` (p >== k)
[provided x is not free in j or k]
But commutativity does not hold for Maybe or [], left distributivity
does not hold for Maybe and right distributivity does not hold for [],
so these can't be right.
Are the other identities I've listed ok?
Are there other identities that I've missed?
Cheers,
Theodore Norvell
----------------------------
Dr. Theodore Norvell theo@engr.mun.ca
Electrical and Computer Engineering http://www.engr.mun.ca/~theo
Engineering and Applied Science Phone: (709) 737-8962
Memorial University of Newfoundland Fax: (709) 737-4042
St. John's, NF, Canada, A1B 3X5
From dpt@math.harvard.edu Tue Mar 13 20:12:06 2001
From: dpt@math.harvard.edu (Dylan Thurston)
Date: Tue, 13 Mar 2001 15:12:06 -0500
Subject: Laws for Monad and MonadPlus.
In-Reply-To: <3AAE78DB.F65A08E3@engr.mun.ca>; from theo@engr.mun.ca on Tue, Mar 13, 2001 at 04:15:31PM -0330
References: <3AAE78DB.F65A08E3@engr.mun.ca>
Message-ID: <20010313151206.A731@math.harvard.edu>
On Tue, Mar 13, 2001 at 04:15:31PM -0330, Theodore Norvell wrote:
> Are there other identities that I've missed?
What about associativity of mplus:
(p `mplus` q) `mplus` r = p `mplus` (q `mplus` r)
Good question!
--Dylan Thurston
From dpt@math.harvard.edu Tue Mar 13 20:13:26 2001
From: dpt@math.harvard.edu (Dylan Thurston)
Date: Tue, 13 Mar 2001 15:13:26 -0500
Subject: Laws for Monad and MonadPlus.
In-Reply-To: <3AAE78DB.F65A08E3@engr.mun.ca>; from theo@engr.mun.ca on Tue, Mar 13, 2001 at 04:15:31PM -0330
References: <3AAE78DB.F65A08E3@engr.mun.ca>
Message-ID: <20010313151326.B731@math.harvard.edu>
On Tue, Mar 13, 2001 at 04:15:31PM -0330, Theodore Norvell wrote:
> What about MonadPlus? By analogy with semirings, I came up with:
>
> Zero: mzero >>= k = mzero = p >>= (\x -> mzero)
> Identity: p `mplus` mzero = p = mzero `mplus` p
> Commutativity: p `mplus` q = q `mplus` p
> Right distributivity: (p `mplus` q) >>= k = (p >>= k) `mplus` (q >>= k)
> Left distributivity: p >>= (\x->j x `mplus` k x) = (p >>= j) `mplus` (p >== k)
> [provided x is not free in j or k]
>
> But commutativity does not hold for Maybe or [], left distributivity
> does not hold for Maybe and right distributivity does not hold for [],
> so these can't be right.
Incidentally, a Set monad seems to do better: it would satisfy all
these laws.
Best,
Dylan
From jans@numeric-quest.com Tue Mar 13 20:28:50 2001
From: jans@numeric-quest.com (Jan Skibinski)
Date: Tue, 13 Mar 2001 15:28:50 -0500 (EST)
Subject: quantum search algorithm
Message-ID:
Directly from the oven :-):
http://www.numeric-quest.com/haskell/QuantumSearch.hs
Excerpt from a short module description is given below.
Jan
Grover's algorithm assumes that one is given a quantum function, also called
an oracle, that indicates, when confronted with any number between 0 and N-1,
whether this number is or is not the special number being sought.
The algorithm enables one to find a marked item in unstructured N-item database
in a time that scales not as N, as a classical computer would require, but only
as sqrt N.
Putting it another way: the maximum number of calls to oracle is proportional to
sqrt N. Think about a scenario when the oracle charges you per call, or
when its computations are very lengthy. The answer is probabilistic, but
given with very high degree of probability.
In our implementation the 'search' function is able to find specifically
marked number from the assemble of 8 numbers: 0..7 in just two calls to oracle,
with very high degree of probability. The 'test' performs m such searches.
Note that the final stage of the search is simulated as a quantum measurement
performed on the state vector.
From taha@cs.yale.edu Tue Mar 13 16:39:27 2001
From: taha@cs.yale.edu (Walid Taha)
Date: Tue, 13 Mar 2001 11:39:27 -0500
Subject: CFP: SAIG'01
In-Reply-To:
References:
Message-ID:
CALL FOR PAPERS
Semantics, Applications and Implementation of Program Generation (SAIG'01)
PLI Workshop, September 6th, 2001. (Deadline: May 20, 2001)
http://www.cs.yale.edu/~taha/saig/cfp01.html
Program generation has the prospect of being an integral part of a
wide range of software development processes. Many recent studies
investigate different aspects of program generation systems, including
their semantics, their applications, and their implementation.
Existing theories and systems address both high-level (source)
language and low-level (machine) language generation. A number of
programming languages now supports program generation and
manipulation, with different goals, implementation techniques, and
targeted at different applications. The goal of this workshop is to
provide a meeting place for researchers and practitioners interested
in this research area, and in program generation in general.
Scope: The workshop solicits submissions related to theoretical and
practical models and tools for building program generators systems,
Examples include:
* Semantics, type systems, and implementations for multi-stage
languages.
* Run-time specialization systems: e.g. compilers, operating systems.
* High-level program generation (applications, foundations,
environments).
* Program synthesis from high-level specifications.
* Symbolic computation, linking and explicit substitution, in-lining and
macros.
Reports on applications of these techniques to real-world problems are
especially encouraged, as are submissions that relate ideas and
concepts from several of these topics, or bridge the gap between
theory and practice. The program committee is happy to advise on the
appropriateness of a particular subject.
Format: The one-day workshop will contain slots for technical papers
(30 minutes) and position papers (20 minutes. Both times include
discussion.) In addition, there will be one hour allocated for open
discussions at the end of the workshop. Proceedings will be published
as an LNCS volume.
Invited Speakers:
* Krzysztof Czarnecki, University of Ilmenau and Daimler Chrysler
* Tim Sheard, Oregon Graduate Institute of Science and Technology
* Mitch Wand, Northeastern University
Submission Details: Authors are invited to submit papers of at most
5000 words (excluding figures), in postscript format (letter or A4),
using the electronic submission form by May 20th, 2001. This deadline
is not extensible. Both position and technical papers are welcome.
Please indicate at time of submission. Position papers are expected to
describe ongoing work, future directions, and/or survey previous
results. Technical papers are expected to contain novel results. All
papers will be reviewed by the program committee for the above
mentioned criteria, in addition to correctness and clarity. Authors
will be notified of acceptance by July 17th, 2001. Final version of
the papers must be submitted by July 15th, 2001.
Program Committee:
* Gilles Barthe, INRIA * David Basin, Freiburg
* Don Batory, Texas * Robert Glück, DIKU
* Nevin Heintze, Bell-Labs * Eugenio Moggi, DISI
* Greg Morrisett, Cornell * Flemming Nielson, Aarhus
* David Sands, Chalmers * Walid Taha,Yale (PC Chair)
From taha@cs.yale.edu Tue Mar 13 16:39:27 2001
From: taha@cs.yale.edu (Walid Taha)
Date: Tue, 13 Mar 2001 11:39:27 -0500 (EST)
Subject: CFP: SAIG'01
In-Reply-To:
References:
Message-ID:
CALL FOR PAPERS
Semantics, Applications and Implementation of Program Generation (SAIG'01)
PLI Workshop, September 6th, 2001. (Deadline: May 20, 2001)
http://www.cs.yale.edu/~taha/saig/cfp01.html
Program generation has the prospect of being an integral part of a
wide range of software development processes. Many recent studies
investigate different aspects of program generation systems, including
their semantics, their applications, and their implementation.
Existing theories and systems address both high-level (source)
language and low-level (machine) language generation. A number of
programming languages now supports program generation and
manipulation, with different goals, implementation techniques, and
targeted at different applications. The goal of this workshop is to
provide a meeting place for researchers and practitioners interested
in this research area, and in program generation in general.
Scope: The workshop solicits submissions related to theoretical and
practical models and tools for building program generators systems,
Examples include:
* Semantics, type systems, and implementations for multi-stage
languages.
* Run-time specialization systems: e.g. compilers, operating systems.
* High-level program generation (applications, foundations,
environments).
* Program synthesis from high-level specifications.
* Symbolic computation, linking and explicit substitution, in-lining and
macros.
Reports on applications of these techniques to real-world problems are
especially encouraged, as are submissions that relate ideas and
concepts from several of these topics, or bridge the gap between
theory and practice. The program committee is happy to advise on the
appropriateness of a particular subject.
Format: The one-day workshop will contain slots for technical papers
(30 minutes) and position papers (20 minutes. Both times include
discussion.) In addition, there will be one hour allocated for open
discussions at the end of the workshop. Proceedings will be published
as an LNCS volume.
Invited Speakers:
* Krzysztof Czarnecki, University of Ilmenau and Daimler Chrysler
* Tim Sheard, Oregon Graduate Institute of Science and Technology
* Mitch Wand, Northeastern University
Submission Details: Authors are invited to submit papers of at most
5000 words (excluding figures), in postscript format (letter or A4),
using the electronic submission form by May 20th, 2001. This deadline
is not extensible. Both position and technical papers are welcome.
Please indicate at time of submission. Position papers are expected to
describe ongoing work, future directions, and/or survey previous
results. Technical papers are expected to contain novel results. All
papers will be reviewed by the program committee for the above
mentioned criteria, in addition to correctness and clarity. Authors
will be notified of acceptance by July 17th, 2001. Final version of
the papers must be submitted by July 15th, 2001.
Program Committee:
* Gilles Barthe, INRIA * David Basin, Freiburg
* Don Batory, Texas * Robert Glück, DIKU
* Nevin Heintze, Bell-Labs * Eugenio Moggi, DISI
* Greg Morrisett, Cornell * Flemming Nielson, Aarhus
* David Sands, Chalmers * Walid Taha,Yale (PC Chair)
From ashley@semantic.org Wed Mar 14 03:36:42 2001
From: ashley@semantic.org (Ashley Yakeley)
Date: Tue, 13 Mar 2001 19:36:42 -0800
Subject: Contexts in Existential Types
Message-ID: <200103140336.TAA24338@mail4.halcyon.com>
Would it be appropriate for Haskell to be able to remember contexts in
existential types? For instance, currently this does not work in Hugs:
--
class Charable a where
obtainChar :: a -> Char
instance Charable Char where
obtainChar c = c
data AnyCharable = forall c. (Charable c) => MkAnyCharable c
anyA = MkAnyCharable 'a'
recoverA = obtainChar ((\(MkAnyCharable c) -> c) anyA)
--
I believe allowing it to work would not amount to storing dynamic type
information.
Is this an overlooked hole or would it break the spirit of the language?
--
Ashley Yakeley, Seattle WA
From ashley@semantic.org Wed Mar 14 04:21:49 2001
From: ashley@semantic.org (Ashley Yakeley)
Date: Tue, 13 Mar 2001 20:21:49 -0800
Subject: Contexts in Existential Types
Message-ID: <200103140421.UAA29130@mail4.halcyon.com>
At 2001-03-13 19:36, I wrote:
>Would it be appropriate for Haskell to be able to remember contexts in
>existential types? For instance, currently this does not work in Hugs:
>
>--
>class Charable a where
> obtainChar :: a -> Char
>
>instance Charable Char where
> obtainChar c = c
>
>data AnyCharable = forall c. (Charable c) => MkAnyCharable c
>
>anyA = MkAnyCharable 'a'
>recoverA = obtainChar ((\(MkAnyCharable c) -> c) anyA)
>--
Whoops, my error. It is possible to do this:
--
recoverA = (\(MkAnyCharable c) -> obtainChar c) anyA
--
Sorry...
--
Ashley Yakeley, Seattle WA
From fjh@cs.mu.oz.au Wed Mar 14 07:44:54 2001
From: fjh@cs.mu.oz.au (Fergus Henderson)
Date: Wed, 14 Mar 2001 18:44:54 +1100
Subject: Contexts in Existential Types
In-Reply-To: <200103140336.TAA24338@mail4.halcyon.com>
References: <200103140336.TAA24338@mail4.halcyon.com>
Message-ID: <20010314184454.A901@hg.cs.mu.oz.au>
On 13-Mar-2001, Ashley Yakeley wrote:
> Would it be appropriate for Haskell to be able to remember contexts in
> existential types?
I'm not sure exactly what you mean by that.
But your example requires existentially typed functions.
It would certainly be appropriate for Haskell to support
existentially typed functions.
> For instance, currently this does not work in Hugs:
>
> --
> class Charable a where
> obtainChar :: a -> Char
>
> instance Charable Char where
> obtainChar c = c
>
> data AnyCharable = forall c. (Charable c) => MkAnyCharable c
>
> anyA = MkAnyCharable 'a'
> recoverA = obtainChar ((\(MkAnyCharable c) -> c) anyA)
> --
You can write that kind of thing in Mercury. However, you need to use
a separate function rather than a lambda expression, since for this
to work the lambda expression has to have an existentially quantified
polymorphic type, and in Mercury (as in Haskell 98), lambda expressions
are always monomorphic.
fjh$ cat test.m
:- import_module char.
:- typeclass charable(A) where [
func obtainChar(A) = char
].
:- instance charable(char) where [
obtainChar(C) = C
].
% Note for Haskell readers:
% in Mercury the constructor name goes on the left of the `=>'
% and the type class constraints go on the right of it
:- type anyCharable ---> some [C] mkAnyCharable(C) => charable(C).
anyA = 'new mkAnyCharable'('a').
recoverA = obtainChar(x(anyA)).
x(mkAnyCharable(C)) = C.
fjh$ mmc -C --infer-all test.m
test.m:001: Warning: module should start with a `:- module' declaration.
test.m: 1: Warning: interface for module `test' does not export anything.
test.m:012: Inferred :- func anyA = (test:anyCharable).
test.m:013: Inferred :- func recoverA = character.
test.m:014: Inferred :- some [C] (func x((test:anyCharable)) = C => (test:charab
le(C))).
Note that the type inferred for `x' is an existentially quantified function
type.
--
Fergus Henderson | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: | -- the last words of T. S. Garp.
From simonpj@microsoft.com Wed Mar 14 10:10:27 2001
From: simonpj@microsoft.com (Simon Peyton-Jones)
Date: Wed, 14 Mar 2001 02:10:27 -0800
Subject: Contexts in Existential Types
Message-ID: <37DA476A2BC9F64C95379BF66BA2690260DC5B@red-msg-09.redmond.corp.microsoft.com>
Yes, with your modification, it works just fine in GHC, and I guess
therefore hbc. Documentatino in the user manual.
http://haskell.cs.yale.edu/ghc/
Simon
| -----Original Message-----
| From: Ashley Yakeley [mailto:ashley@semantic.org]
| Sent: 14 March 2001 04:22
| To: Haskell List
| Subject: Re: Contexts in Existential Types
|
|
| At 2001-03-13 19:36, I wrote:
|
| >Would it be appropriate for Haskell to be able to remember
| contexts in
| >existential types? For instance, currently this does not
| work in Hugs:
| >
| >--
| >class Charable a where
| > obtainChar :: a -> Char
| >
| >instance Charable Char where
| > obtainChar c = c
| >
| >data AnyCharable = forall c. (Charable c) => MkAnyCharable c
| >
| >anyA = MkAnyCharable 'a'
| >recoverA = obtainChar ((\(MkAnyCharable c) -> c) anyA)
| >--
|
| Whoops, my error. It is possible to do this:
|
| --
| recoverA = (\(MkAnyCharable c) -> obtainChar c) anyA
| --
|
| Sorry...
|
| --
| Ashley Yakeley, Seattle WA
|
|
| _______________________________________________
| Haskell mailing list
| Haskell@haskell.org
| http://www.haskell.org/mailman/listinfo/haskell
|
From ess_lli@cc.helsinki.fi Wed Mar 14 15:21:42 2001
From: ess_lli@cc.helsinki.fi (Ahti Pietarinen)
Date: Wed, 14 Mar 2001 17:21:42 +0200 (EET)
Subject: DEADLINE EXTENSION: Logic & Games ESSLLI'01 workshop
Message-ID:
- Apologies for multiple copies
- Please note:
DEADLINE EXTENSION for Logic & Games ESSLLI 2001 workshop
20-24 August, Helsinki University, Finland
!!!!! New Deadline is: April 9, 2001 !!!!!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%
%% Call for Papers %%
%% %%
%% ESSLLI Workshop on Logic and Games %%
%% %%
%% %%
%% August 20-24, 2001 %%
%% Helsinki, Finland %%
%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GENERAL INFORMATION:
Games have been utilized within logic for a variety of different
purposes such as semantic evaluation games, model comparison
games, and proof games. On the other hand, logic has become
increasingly important in game theory, in particular for the
epistemic foundation of game-theoretic solution concepts. As the
TARK (http://www.tark.org) and LOFT (http://www.econ.ucdavis.edu/
faculty/bonanno/loft4.html) conferences show, interaction between
logic and game theory has become more diverse in recent years,
exploring game logics, the use of game-theory in multi-agent
systems, game-theoretic accounts of natural language phenomena,
and the role of language in defining preferences.
The workshop is part of the 13th European Summer School in Logic,
Language and Information (ESSLLI) which takes place at the
University of Helsinki from August 13 until August 24, 2001
(http://www.helsinki.fi/esslli). The workshop aims to provide a
forum for advanced Ph.D. students and other researchers from
game theory and logic to present their research on (1) game-
theoretic techniques applied to logic, and (2) logical models or
analyses of games and game-theoretic problems. We specifically
invite presentations in any of the following areas:
1) Logical analysis of games, e.g. modeling knowledge, belief,
and information flow in games; applications of epistemic and
dynamic logic to games
2) Logic games, e.g. model comparison games, semantic evaluation
games, Independence-friendly logic
3) Game logics, e.g. extensions of program logics and modal logics
to investigate the structure of games in general
4) The role of language and logical definability in games,
and connections between natural language and games generally
5) Logical approaches to multi-agent systems with a special focus
on game-theoretic aspects
SUBMISSION GUIDELINES:
Papers should not exceed 15 pages in length. A postscript or pdf
version of the paper should be submitted by e-mail to BOTH
organizers before the deadline given below. Note that all workshop
contributors must register for the summer school.
ORGANISERS:
Marc Pauly Gabriel Sandu
CWI Department of Philosophy
P.O. Box 94079 P.O. 24 (Unioninkatu 40)
1090 GB Amsterdam 00014 University of Helsinki
The Netherlands Finland
E-mail: pauly@cwi.nl E-mail: Sandu@elo.helsinki.fi
IMPORTANT DATES:
Submission deadline: April 9, 2001
Notification of contributors: May 1, 2001
Final version due: June 1, 2001
Workshop Dates: August 20-24, 2001
================================================================
From nick@microsoft.com Wed Mar 14 17:51:19 2001
From: nick@microsoft.com (Nick Benton)
Date: Wed, 14 Mar 2001 09:51:19 -0800
Subject: CfP: Babel01 Workshop on Multi-Language Infrastructure and Interoperability
Message-ID: <0C682B70CE37BC4EADED9D375809768A48CFE7@red-msg-04.redmond.corp.microsoft.com>
BABEL'01
CALL FOR PAPERS
=20
First Workshop on Multi-Language
Infrastructure and Interoperability
=20
http://research.microsoft.com/~nick/babel01.htm
=20
Satellite to PLI'01
=20
Firenze, Italy, 8th September 2001
=20
=20
AIMS AND SCOPE
=20
Recent years have seen a resurgence of interest in multi-language
tools and intermediate languages, and in interoperability between
programs and components written in different programming
languages. Shared infrastructure such as code generators, analysis
tools and garbage collectors can greatly ease the task of producing a
high-quality implementation of a new programming language, whilst
being able to interoperate easily with code written in existing
languages is essential for such an implementation to be useful in
practice. This workshop aims to bring together researchers and
developers working on multi-language integration. Contributions are
welcome on topics including, but not limited to:=20
=20
=20
* Compilation of high level languages to common executable formats
such as Sun's Java Virtual Machine, the DRA's ANDF or Microsoft's
.NET Common Language Runtime.
=20
* Defining and using bindings for component middleware such as OMG's
CORBA or Microsoft's COM.
=20
* Language constructs to support interoperability between different
languages, particularly from different paradigms (e.g. OO/functional).
=20
* Multi-language backends for compilation and/or analysis
(e.g. MLRISC, FLINT, C--, TAL, SUIF). =20
=20
* Type theoretic and semantic foundations for multi-language work. =20
=20
* Multi-language development environments and tools (e.g. debuggers,
profilers).
=20
Submissions may address any programming paradigm. Experience papers
which describe the use of multiple languages in application
development are also welcome. Authors unsure of the appropriateness of
a potential submission should email the PC chair (nick@microsoft.com).
=20
=20
PROGRAMME COMMITTEE
=20
Nick Benton (chair) Microsoft Research
Fergus Henderson University of Melbourne
Andrew Kennedy (organiser) Microsoft Research
Greg Morrisett Cornell University
Martin Odersky Ecole Polytechnique Federale de Lausanne
John Reppy Bell Labs
Andrew Tolmach Portland State University
David Wakeling University of Exeter
=20
=20
INVITED SPEAKERS
=20
Zhong Shao Yale University
=20
=20
IMPORTANT DATES
=20
Deadline for submission 1st June 2001
Notification of acceptance 9th July 2001
Final version due 10th August 2001
=20
=20
SUBMISSION DETAILS
=20
Papers should be at most 14 pages and should be submitted in
Ghostscript-compatible PostScript or PDF format and be printable on
both US letter and A4 paper. Authors are strongly encouraged to use
ENTCS style files (see http://math.tulane.edu/~entcs/). Papers should
be submitted electronically from the workshop website given above.
Submissions should not overlap significantly with work which has
already been published or submitted to any other conference or
journal. An informal proceedings will be published as a technical
report and distributed at the workshop. It is intended that a final
proceedings will be published in a volume of ENTCS.
From wpd@uswest.net Thu Mar 15 22:15:13 2001
From: wpd@uswest.net (Grace Trigue White)
Date: Thu, 15 Mar 2001 15:15:13 -0700
Subject: Ghc / Hugs inconsistencty.
Message-ID: <004101c0ad9d$680e6b20$0200000a@DD442D01>
This is a multi-part message in MIME format.
------=_NextPart_000_003E_01C0AD62.BB93F4D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
The following program compiles under ghc, but hugs complains that there =
is an unexpected keyword "forall" on the line defining the type X. The =
type used is the type of the primitive runST, so it is a valid type. It =
seems that one should be able to create a type synonym for it. The =
situation is unchanged if the type X is given a parameter a, i.e. "type =
X a =3D (forall s. ST s a) -> a".
module Main where
import ST
type Module s a =3D ST s a
type X =3D (forall s. ST s a) -> a
f :: (forall s. ST s a) -> a
f x =3D undefined
--type ModuleConnect =3D forall s. (forall t. ST (s, t) a) -> ST s a
main :: IO ()
main =3D
do { putStrLn "Hello World!!!"
}
=20
------=_NextPart_000_003E_01C0AD62.BB93F4D0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
The following program compiles =
under ghc, but=20
hugs complains that there is an unexpected keyword "forall" on the line =
defining=20
the type X. The type used is the type of the primitive runST, so it is a =
valid=20
type. It seems that one should be able to create a type synonym for it. =
The=20
situation is unchanged if the type X is given a parameter a, i.e. "type =
X a =3D=20
(forall s. ST s a) -> a".
module Main =
where
import=20
ST
type Module s a =3D ST s a
type X =3D (forall s. ST s =
a) ->=20
a
f :: (forall s. ST s a) -> a
f x =3D undefined
--type =
ModuleConnect=20
=3D forall s. (forall t. ST (s, t) a) -> ST s a
main :: IO =
()
main=20
=3D
do { putStrLn =
"Hello=20
World!!!"
=20
}
------=_NextPart_000_003E_01C0AD62.BB93F4D0--
From ess_lli@cc.helsinki.fi Thu Mar 15 16:56:09 2001
From: ess_lli@cc.helsinki.fi (Ahti Pietarinen)
Date: Thu, 15 Mar 2001 18:56:09 +0200 (EET)
Subject: DEADLINE EXTENSION: ESSLLI'01 Workshop on Semantic Knowledge
Acquisition and Categorisation (Helsinki, Finland)
Message-ID:
*************** EXTENDED DEADLINE ****************
----- NEW DEADLINE: APRIL 23rd -----
----- Please check new dates below! -----
SEMANTIC KNOWLEDGE ACQUISITION AND CATEGORISATION
Workshop at ESSLLI XIII (Helsinki, Finland)
Helsinki, Finland, August 13th - 17th 2001
Workshop home page
http://www.ilc.pi.cnr.it/~esslli
ESSLLI 2001 home page
http://www.helsinki.fi/esslli
-------------------------------------------------------------------
Endorsed by SIGSEM, the ACL Special Interest Group on computational
semantics
-------------------------------------------------------------------
The sheer amount of knowledge necessary to shed light on the way word
meanings mutually relate in context or distribute in lexico-semantic
classes appears to exceed the limits of human conscious awareness and
descriptive capability. Particularly at this level of linguistic analysis,
then, we seem to be in need of automatic ways of filtering, structuring
and classifying semantic evidence through inspection of a large number of
word uses in context. Totally or partially unsupervised inductive methods
of knowledge acquisition from corpus data are credited with being able to
provide such ways. Yet, it remains to be seen how acquired information can
best be represented in current formal models for knowledge representation,
for it to be made available to mainstream NLP applications.
There are reasons to believe that this integration will require much more
than a simple extension of off-the-shelf machine learning technology. At
the same time, any major breakthrough in this area is bound to have
significant repercussions on the way word meanings and lexico-semantic
classes in general are formally represented and used for applications.
With these purposes in mind, the workshop intends to focus on the issue of
interaction between techniques for inducing semantic information from
corpus data and formal methods of linguistic knowledge representation. In
particular, we encourage in-depth analysis of underlying assumptions of
the proposed techniques and methods and discussion of possible relevant
connections with cognitive, linguistic,logical and philosophical issues.
TOPICS OF INTEREST
Possible themes for contributions are:
- development of 'data-driven' semantic type systems
- dynamic update and tuning of formal ontologies with text data
- 'hybrid models' of knowledge extraction, whereby machine learning
methods are integrated with formal structures of knowledge representation
- creation of dynamic lexical knowledge-bases
- formal representation and structuring of the flow of information
extracted from texts.
WORKSHOP ORGANISATION
The workshop will be held on five subsequent days, August 13th-17th 2001.
It will take place during the ESSLLI-Summer School in Helsinki, and will
be open to all members of the LLI-community, computational linguistics and
cognitive science as well. Each session will consist of two talks plus
discussion (30mins + 15mins each). The workshop language will be English.
----------------------------------------------------------------------------
GUIDELINES FOR SUBMISSIONS
The organizers welcome contributions from different fields of
computational linguistics, logic and cognitive science.
1. Submissions will consist of full papers reporting on original,
unpublished works. Papers should not exceed 5000 words
(including references), must contain a 5-10 lines abstract, and must
be submitted in postscript format
2. The reviewing of papers will be blind. Hence the paper
should not include the authors' names and affiliations.
Furthermore, self-references that reveal the author's identity
should be avoided.
3. Identification information will be put in a separate file
consisting of:
Title of the paper:
Author(s):
Affiliation(s):
E-mail(s):
Abstract:
4. Submitted papers and identification information must be sent
to the following address by APRIL 23rd 2001:
esslli2001@ilc.pi.cnr.it
Accepted papers will be notified by MAY 15th, together with the comments
of the reviewers.
The final version of the papers will be prepared in LaTeX by JUNE 15th,
for publication in the Workshop proceedings. The stylesheet will be
circulated in due time.
Note that all workshop participants must register as participants of
ESSLLI. The early registration fees apply to authors of accepted papers.
---------------------------------------------------------------------------
IMPORTANT DATES
April 23rd 2001 - Deadline for submitting papers
May 15th 2001 - Notification of acceptance
June 15th 2001 - Preparation of the final version of the paper
June 30th 2001 - Final program of the workshop
August 13th 2001 - The workshop begins
---------------------------------------------------------------------------
PROGRAM COMMITEE
Ted Briscoe (Cambridge University, Cambridge, United Kingdom)
Nicoletta Calzolari (Istituto di Linguistica Computazionale, CNR, Pisa, Italy)
Christiane Fellbaum (Princeton University, Princeton, USA)
Ed Hovy (USC, Marina del Rey CA, USA)
Dekang Lin (University of Alberta, Edmonton, Canada)
Antonio Sanfilippo (LingoMotors Inc., Cambridge MA, USA)
Piek Vossen (SAILLABS, Antwerpen, The Netherlands)
ORGANISING COMMITEE
Alessandro Lenci
Simonetta Montemagni
Vito Pirrelli
Istituto di Linguistica Computazionale (ILC) - CNR
Area della Ricerca CNR
Via Alfieri 1 (San Cataldo)
I-56010 PISA
Italy
WORKSHOP CONTACT ADDRESS
esslli2001@ilc.pi.cnr.it
http://www.ilc.pi.cnr.it/~esslli
ESSLLI 2001 CONTACT ADDRESS
esslli@helsinki.fi
http://www.helsinki.fi/esslli
--------------------------------------------------------------------------
From minihaskell@hotmail.com Fri Mar 16 12:32:35 2001
From: minihaskell@hotmail.com (Mini Haskell)
Date: Fri, 16 Mar 2001 12:32:35 -0000
Subject: Please help us with our research....
Message-ID:
Hi
We are a small group of undergraduate computer science students from the
University of Nottingham. As part of our second year we have been
assigned to do a software engineering group project. The project put us
together as a group and we were told what we had to do, our instructions
were as follows:
Mini Haskell
------------
The aim of this project is to build an interpreter for a small
functional programming language called Mini Haskell. For simplicity, the
only values in the language will be integers, lists, and functions. As
well as allowing expressions to be evaluated to a final result, the
interpreter should also allow the individual steps in the evaluation
process to be seen.
------------
AS part of our research we have developed an on-line questionnaire which
looks at the importance of some of the ideas we have had for the
project. The questionnaire is found on our website and asks some very
simple multiple choice questions which should take no longer than 2
minutes to complete. Please help us by looking at the site and by
filling in our questionnaire in the feedback section.
Please go to
questionnaire: http://quest.minihaskell.com
website: http://www.minihaskell.com
thankyou for your time
Dave - minihaskell
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
From bcpierce@cis.upenn.edu Fri Mar 16 14:33:31 2001
From: bcpierce@cis.upenn.edu (Benjamin C. Pierce)
Date: Fri, 16 Mar 2001 09:33:31 EST
Subject: TACS 2001 call for papers (deadline April 1)
Message-ID: <23064.984753211@saul.cis.upenn.edu>
Call For Papers
Fourth International Symposium on
Theoretical Aspects of Computer Science (TACS 2001)
October 29-31, 2001
Tohoku University, Sendai, Japan
http://tacs2001.ito.ecei.tohoku.ac.jp/tacs2001/
The TACS Symposium will focus on the theoretical foundations of
programming and their applications. The topics of interest include...
Theoretical aspects of the design, semantics, analysis, and
implementation of programming languages and systems; logics of
programs; calculi and models of concurrency and parallel
computation; theories of mobile computation and system security;
categories and types in computer science; formalisms, methods, and
systems for program specification, verification, synthesis, and
optimization; constructive, linear, and modal logics in computer
science.
The scientific program will consist of invited lectures, contributed
talks, and demo sessions. A proceedings containing the full papers of
the invited and contributed talks will be published by Springer-Verlag
as a volume of Lecture Notes in Computer Science.
IMPORTANT DATES
Submission deadline: April 1, 2001
Notification to authors: June 15, 2001
Deadline for final versions: July 20, 2001
INVITED SPEAKERS
Luca Cardelli Microsoft Research
Daniel Jackson Massachusetts Institute of Technology
Christine Paulin-Mohring Universite Paris Sud & INRIA
Andrew Pitts University of Cambridge
Jon Riecke Lucent Technologies
Kazunori Ueda Waseda University
CONFERENCE CHAIR:
Takayasu Ito
Tohoku University
PROGRAM CO-CHAIRS:
Naoki Kobayashi
Tokyo Institute of Technology
kobayasi@cs.titech.ac.jp
Benjamin Pierce
University of Pennsylvania
bcpierce@cis.upenn.edu
PROGRAM COMMITTEE:
Zena Ariola University of Oregon
Cedric Fournet Microsoft Research
Jacques Garrigue Kyoto University
Masami Hagiya University of Tokyo
Robert Harper Carnegie Mellon University
Masahito Hasegawa Kyoto University
Nevin Heintze Lucent Technologies
Martin Hofmann Edinburgh University
Zhenjiang Hu University of Tokyo
Naoki Kobayashi Tokyo Institute of Technology
Martin Odersky Ecole Polytechnique Federale de Lausanne
Catuscia Palamidessi Pennsylvania State University
Benjamin Pierce University of Pennsylvania
Francois Pottier INRIA
Andre Scedrov University of Pennsylvania
Natarajan Shankar SRI International
Ian Stark Edinburgh University
Makoto Tatsuta Kyoto University
SUBMISSION INFORMATION
Authors are invited to submit full papers (up to 6000 words, including
figures and bibliographies). Papers must be unpublished and not submitted
for publication elsewhere. Submissions should be in Postscript or PDF
format, on A4 or US letter pages. They must be printable on common
printers and viewable with ghostview or acroread. The first page of each
submission should include the email address, telephone, and fax numbers
of the corresponding author. Accepted papers must be presented at the
symposium, and the final manuscript must be prepared in the LNCS format.
All submissions should be done electronically through the TACS submission
page http://saul.cis.upenn.edu:8086/.
From harald@cs.mu.OZ.AU Fri Mar 16 15:44:41 2001
From: harald@cs.mu.OZ.AU (Harald Sondergaard)
Date: Sat, 17 Mar 2001 02:44:41 +1100
Subject: PPDP'01 deadline extension to 23 March
Message-ID: <200103161544.CAA30609@mundook.cs.mu.OZ.AU>
PPDP'01
Principles and Practice of Declarative Programming
Florence, Italy, 5-7 September 2001
http://music.dsi.unifi.it/pli01/ppdp/
EXTENSION OF DEADLINE FOR SUBMISSIONS
The deadline for paper submissions
has been extended to 23 March 2001.
Harald Sondergaard
PPDP'01 Program Chair
From mthomas@gil.com.au Sat Mar 17 02:20:34 2001
From: mthomas@gil.com.au (Mike Thomas)
Date: Sat, 17 Mar 2001 12:20:34 +1000
Subject: Greencard, GHC and FFI.
Message-ID: <002901c0ae88$ecda7920$b6332fca@snowpea>
Hi all.
I'm having trouble with using green-card 2 on Windows
with GHC-4.08.2. As the default output for -target ghc seems
to be for the C back-end rather than native code, I thought I would
try the FFI target.
Using the example from the green-card doc:
---------------------------------------------
module GCTest where
import StdDIS
%fun my_sin :: Double -> Double
%code res1=sin(arg1);
---------------------------------------------
Compiling for target FFI:
---------------------------------------------
green-card -c GCTest.gc -o GCTest.hs --target ffi
ghc -c GCTest.hs -fglasgow-exts
---------------------------------------------
Linking with this main module:
---------------------------------------------
module Main(main) where
import GCTest
main :: IO()
main = putStrLn (show (my_sin (20.0)))
---------------------------------------------
I get:
---------------------------------------------
$ ghc main.hs -o main.exe GCTest.o StdDIS.o -package lang -package greencard
Compilation IS NOT required
GCTest.o(.text+0x7f):fake: undefined reference to `prim_my_sin'
StdDIS.o(.text+0x549):fake: undefined reference to `prim_free'
StdDIS.o(.text+0x600):fake: undefined reference to `prim_allocCharStar'
StdDIS.o(.text+0x731):fake: undefined reference to `prim_readCharAddr'
StdDIS.o(.text+0xc84):fake: undefined reference to `prim_malloc'
StdDIS.o(.text+0xd38):fake: undefined reference to `access_prim_malloc_res1'
StdDIS.o(.text+0xdec):fake: undefined reference to
`access_prim_malloc_gc_failed
'
StdDIS.o(.text+0xea0):fake: undefined reference to
`access_prim_malloc_gc_failst
ring'
StdDIS.o(.text+0x1206):fake: undefined reference to `prim_writeCharAddr'
collect2: ld returned 1 exit status
---------------------------------------------
Where have I gone wrong?
Cheers
Mike Thomas.
From sigbjorn_finne@hotmail.com Sat Mar 17 09:01:12 2001
From: sigbjorn_finne@hotmail.com (Sigbjorn Finne)
Date: Sat, 17 Mar 2001 10:01:12 +0100
Subject: Greencard, GHC and FFI.
Message-ID:
Mike Thomas mthomas@gil.com.au writes:
>
> I'm having trouble with using green-card 2 on Windows
> with GHC-4.08.2. As the default output for -target ghc seems
> to be for the C back-end rather than native code, I thought I would
> try the FFI target.
>
.... example code deleted
>
> I get
>
> $ ghc main.hs -o main.exe GCTest.o StdDIS.o -package lang -package
greencard
> ---------------------------------------------
> Compilation IS NOT required
> GCTest.o(.text+0x7f):fake: undefined reference to `prim_my_sin'
> ....
Hi,
Greencard lets you write C and Haskell in one source file. When using GHC's
C back end, it is possible to combine the two in one source file (via GHC's
_casm_s.) The FFI doesn't let you do this, but requires you to provide
the C bits separately, and link the Haskell code to it via 'foreign'
declarations.
So, when using GC's FFI backend, it generates two source files for you
(and some header files) - in your case, GCTest.hs and GCTest_stub.c.
To achieve linker happiness, you need to compile up the latter and include
it on the link line *and* drop StdDIS.o from that link line.
hth
--sigbjorn
From mthomas@gil.com.au Sat Mar 17 22:30:40 2001
From: mthomas@gil.com.au (Mike Thomas)
Date: Sun, 18 Mar 2001 08:30:40 +1000
Subject: Greencard, GHC and FFI.
References:
Message-ID: <008201c0af31$eaf113e0$5d332fca@snowpea>
Hi again.
> So, when using GC's FFI backend, it generates two source files for you
> (and some header files) - in your case, GCTest.hs and GCTest_stub.c.
> To achieve linker happiness, you need to compile up the latter and include
> it on the link line *and* drop StdDIS.o from that link line.
Thanks for that - I've achieved linker happiness.
FYI, I notice that the GCTest stub file has a do..while(0), which I suppose
should be optimised away by GCC, but still makes the code less
palatable:
--------------------------------------------------------
/* Auto generated GreenCard 2 code for FFI */
double prim_my_sin(double arg1)
{ double res1;
do { res1=sin(arg1);
return((double)(res1));} while(0);
}
--------------------------------------------------------
Cheers
Mike Thomas
From johnjohnjohn64@hotmail.com Mon Mar 19 07:59:03 2001
From: johnjohnjohn64@hotmail.com (john xxx)
Date: Mon, 19 Mar 2001 18:59:03 +1100
Subject: question does haskell have a something like a wild character
Message-ID:
i want to know if HAskell has an inbuilt function in the prelude a function
that allows me to use wild character like so:
ie. if a list of strings contains a word or a combination of words that do
not necessarily have to be side by side. someting that works like so [..
"hello" ..] == ["my", "tie" , "egg", "hello", "good"] would return True.
where .. represents other elements of the list it counld be 1element or a
hundred elements.
please reply urgently to johnjohnjohn64@hotmail.com
if haskell does not provide such a function can you please give me
information on how to create one that would do such a thing that i need.
THANKYOU FOR YOUR TIME.
please reply! i need this function for an assignment for university.
p.s if you're interested in the question visit.
http://www.cse.unsw.edu.au/~cs1711/ass1/spec-ass1.html
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
From Christian.Brolin@carmen.se Mon Mar 19 08:28:15 2001
From: Christian.Brolin@carmen.se (Christian Brolin)
Date: Mon, 19 Mar 2001 09:28:15 +0100
Subject: question does haskell have a something like a wild character
References:
Message-ID: <3AB5C31F.97BB6207@carmen.se>
john xxx wrote:
>
> i want to know if HAskell has an inbuilt function in the prelude a function
> that allows me to use wild character like so:
>
> ie. if a list of strings contains a word or a combination of words that do
> not necessarily have to be side by side. someting that works like so [..
> "hello" ..] == ["my", "tie" , "egg", "hello", "good"] would return True.
> where .. represents other elements of the list it counld be 1element or a
> hundred elements.
> whatis elem;
elem :: (Prelude.Eq b) => b -> [b] -> Bool
> elem "hello" ["my", "tie" , "egg", "hello", "good"];
True
--
Christian Brolin
From white_ghost8@hotmail.com Mon Mar 19 15:16:27 2001
From: white_ghost8@hotmail.com (The Ghost)
Date: Mon, 19 Mar 2001 16:16:27 +0100
Subject: knight's tour - please help
Message-ID:
Hello everyone,
I have a little problem with implementing the knight's tour in haskell.
My goal is to print out all possible solutions for the knight's tour.
Allthough finding one path (with given startinposition (x,y) of the horse
and dimension of the bord M*N) is not enough. I have to find all of them.
(the printing out may be very simpel)
I've wrote this problem is several other languages and there they work
perfect. But I'm searching for an implementation in Haskell. The
implementation may also be simpel (I think it can be solved only by using
lists and backtracking).
If I have the implementation I can go one with my project, I should use it
to explain the differences between a functional language and the others
(effiency, speed,..)
Is ther someone who has such an implementation (that is not too complicated
and not too lang).
Would you be so kind to send it to me?
I should be very thankfull.
Greetings,
The White Ghost.
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
From martin@meltin.net Tue Mar 20 04:25:45 2001
From: martin@meltin.net (Martin Schwenke)
Date: Tue, 20 Mar 2001 15:25:45 +1100
Subject: ANNOUNCE: HasChorus - some modules for Haskore
Message-ID: <20010320041040.69A3C659859@au2.samba.org>
HasChorus:
A set of Haskell (http://haskell.org/) modules written on top of
Haskore (http://haskell.org/haskore/) to make it easier to sequence
simple, repetitive music.
HasChorus is available via:
http://meltin.net/hacks/haskell/
----------------------------------------------------------------------
HasChorus *has* a bunch of useful modules:
HasChords.lhs: Build (diatonic) chords from scales and scale degrees.
HasDrums.lhs: Sequence drums in a similar manner to a drum machine.
HasEasyMusic.lhs: Allow simple specification of simple music sequences.
HasGroove.lhs: Modify Haskore performances via normal distributions.
HasPatterns.lhs: Sequence patterns by playing chords in different ways.
HasScales.lhs: Build scales and pick notes by scale degree.
HasSounds.lhs: Some boring ways of playing some instruments.
HaskoreExtras.lhs: Some useful functions that aren't in Haskore.
BubbleSort.lhs: An implementation of bubble sort. Used by HasGroove.lhs.
Normal.lhs: Generate normal distributions. Used by HasGroove.lhs.
TwelveBar.lhs: An example song.
Many of the modules can be used without requiring all of the others.
The dependencies look something like:
HasEasyMusic -> HasChords -> HasScales
HasDrums -> HaskoreExtras
HasSounds -> HasPatterns
HasGroove -> BubbleSort, Normal
TwelveBar -> HasChorus -> *EVERTHING ELSE*
----------------------------------------------------------------------
HasChorus has been tested under:
* Hugs: Currently I use Hugs 98, February 2000. I use -h1000000 so
that HasGroove doesn't melt down... :-)
* GHC: 4.08 (previously under 4.07) under x86 Linux.
----------------------------------------------------------------------
I use HasChorus to sequence up simple backing tracks for my own
compositions.
Enjoy...
peace & happiness,
martin
Martin Schwenke
p.s. Several people who have expressed interest in this project during
the last few years have received this announcement via a BCC.
They haven't been secretly subscribed to the Haskell mailing
list. :-)
From thiemann@informatik.uni-freiburg.de Tue Mar 20 16:55:39 2001
From: thiemann@informatik.uni-freiburg.de (Peter Thiemann)
Date: 20 Mar 2001 17:55:39 +0100
Subject: modules and re-export
Message-ID:
I have a little question about the following two modules. Suppose you
want to write your own variant of the prelude that redefines a couple
of names but leaves all the rest unchanged. The Haskell report says
that the following should work:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
module BUG2A (module BUG2A, module Prelude) where
import Prelude hiding (head)
head = "HEAD"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This overrides the definition of head and should reexport head along
with everything imported from the Prelude. Hugs98/feb2001 loads it
happily and says head :: [Char]
Now, I want to use this module as an alternative prelude:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
module BUG2B where
import qualified Prelude
import BUG2A
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unfortunately, this does not behave as (I think) it should:
Reading file "BUG2B.hs":
Parsing........................................................................
ERROR "BUG2B.hs": Entity "head" imported from module "BUG2A" already defined in module "Prelude"
However, this should be legal from my reading of the report.
Any help appreciated.
-Peter
From mthomas@gil.com.au Tue Mar 20 22:14:03 2001
From: mthomas@gil.com.au (Mike Thomas)
Date: Wed, 21 Mar 2001 08:14:03 +1000
Subject: GHC Mingw32 build
Message-ID: <000901c0b18b$13e4b4e0$ea332fca@snowpea>
Hi all..
What is the recommended way of making the Mingw32 build of GHC and all
associated tools, eg HDirect, Green-card etc from the CVS?
Cheers
Mike Thomas
From ru@river.org Wed Mar 21 07:40:28 2001
From: ru@river.org (Richard Uhtenwoldt)
Date: Tue, 20 Mar 2001 23:40:28 -0800 (PST)
Subject: Coroutines
In-Reply-To:
References: <20010319225645.A25257@rz.uni-karlsruhe.de>
Message-ID: <200103210740.XAA13592@ohio.river.org>
Andreas Gruenbacher writes:
>It's not what I had in mind, though. Simon's MVars (in the Awkward Squad)
>come pretty close, but they're still not the sort of (cooperative)
>multitasking that I'm thinking of.
I hope I'm not being too fussy, but seems to me that the CVar is what
is needed, not the MVar:
>main=
> newCVar >>= \l0 ->
> newCVar >>= \l1 ->
> newCVar >>= \l2 ->
> forkIO readInputLineAtATime l0 >>
> forkIO printHeader "silly header" l0 l1 >>
> forkIO numberLines 0 l1 l2 >>
> printOutputLineAtATime l2
(untested code.)
From fis@ssh.com Wed Mar 21 10:01:20 2001
From: fis@ssh.com (Matthias Fischmann)
Date: 21 Mar 2001 12:01:20 +0200
Subject: modules and re-export
In-Reply-To: Peter Thiemann's message of "20 Mar 2001 17:55:39 +0100"
References:
Message-ID: <877l1jmoen.fsf@dengue.local>
Peter Thiemann writes:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> module BUG2A (module BUG2A, module Prelude) where
> import Prelude hiding (head)
> head = "HEAD"
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> module BUG2B where
> import qualified Prelude
> import BUG2A
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Unfortunately, this does not behave as (I think) it should:
> [...]
ghc-4.08.1 compiles it without complaining. A Hugs98 bug?
-Matthias
From richard_adams@non.hp.com Wed Mar 21 19:24:15 2001
From: richard_adams@non.hp.com (ADAMS,RICHARD (Non-HP-Roseville,ex1))
Date: Wed, 21 Mar 2001 12:24:15 -0700
Subject: Question concerning ftp and GHC binaries for HP-UX
Message-ID: <499DC368E25AD411B3F100902740AD655A7CD6@xrose03.rose.hp.com>
I would like to download the GHC binaries to our HP 9000 machine (HP-UX
11.0), but have access only to ftp (i.e., no Web browser is available).
Does anyone know what ftp address to use? Also, does anyone know whether
the GHC binaries for the HP-UX operating system will work on HP-UX 11.0?
I am not sure whether it is relevant, but I use Reflection terminal
emulation to telnet from my PC to the HP 9000 machine. Truly 'hi-tech' :) .
Thank you.
Sincerely,
Richard E. Adams
Softmatrix, Inc.
Roseville, CA
Email: richard_adams@non.hp.com
From sigbjorn_finne@hotmail.com Wed Mar 21 21:14:58 2001
From: sigbjorn_finne@hotmail.com (Sigbjorn Finne)
Date: Wed, 21 Mar 2001 22:14:58 +0100
Subject: modules and re-export
Message-ID:
Peter Thiemann thiemann@informatik.uni-freiburg.de writes:
>
> I have a little question about the following two modules. Suppose you
> want to write your own variant of the prelude that redefines a couple
> of names but leaves all the rest unchanged. The Haskell report says
> that the following should work:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> module BUG2A (module BUG2A, module Prelude) where
>
> import Prelude hiding (head)
>
> head = "HEAD"
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
....
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> module BUG2B where
>
> import qualified Prelude
> import BUG2A
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Unfortunately, this does not behave as (I think) it should:
>
> Reading file "BUG2B.hs":
>
Parsing.....................................................................
...
> ERROR "BUG2B.hs": Entity "head" imported from module "BUG2A" already
> defined in module "Prelude"
>
> However, this should be legal from my reading of the report.
Hi Peter,
yep, that's right, and it is a known wrinkle in Hugs' implementation of
modules.
I submitted a source fix which addresses just this a couple of weeks ago,
http://haskell.cs.yale.edu/pipermail/hugs-bugs/2001-March/000184.html
hopefully it will be included in future releases of Hugs98.
hth
--sigbjorn
From nordland@cse.ogi.edu Wed Mar 21 22:26:56 2001
From: nordland@cse.ogi.edu (Johan Nordlander)
Date: Wed, 21 Mar 2001 14:26:56 -0800
Subject: modules and re-export
References:
Message-ID: <3AB92AB0.1DCEF3C3@cse.ogi.edu>
Sigbjorn Finne wrote:
>
> Peter Thiemann thiemann@informatik.uni-freiburg.de writes:
> >
> > I have a little question about the following two modules. Suppose you
> > want to write your own variant of the prelude that redefines a couple
> > of names but leaves all the rest unchanged. The Haskell report says
> > that the following should work:
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > module BUG2A (module BUG2A, module Prelude) where
> >
> > import Prelude hiding (head)
> >
> > head = "HEAD"
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ....
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > module BUG2B where
> >
> > import qualified Prelude
> > import BUG2A
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > Unfortunately, this does not behave as (I think) it should:
> >
> > Reading file "BUG2B.hs":
> >
> Parsing.....................................................................
> ...
> > ERROR "BUG2B.hs": Entity "head" imported from module "BUG2A" already
> > defined in module "Prelude"
> >
> > However, this should be legal from my reading of the report.
>
> Hi Peter,
>
> yep, that's right, and it is a known wrinkle in Hugs' implementation of
> modules.
> I submitted a source fix which addresses just this a couple of weeks ago,
>
> http://haskell.cs.yale.edu/pipermail/hugs-bugs/2001-March/000184.html
>
> hopefully it will be included in future releases of Hugs98.
>
> hth
> --sigbjorn
Hi all,
The fix will indeed be included in the next Hugs release (thanks
Sigbjorn!); in fact it can be tried right away by checking out the
latest revision from the cvs repository. See http://cvs.haskell.org/
for further details.
Cheers,
Johan
From ltaesch@europemail.com Thu Mar 22 06:39:02 2001
From: ltaesch@europemail.com (luc)
Date: Thu, 22 Mar 2001 06:39:02 +0000
Subject: Welcome to the "Haskell" mailing list
References: <20010321203800.7DBE1255AB@www.haskell.org>
Message-ID: <3AB99E06.C7B3A158@europemail.com>
haskell-request@haskell.org wrote:
> Welcome to the Haskell@haskell.org mailing list!
>
> To post to this list, send your email to:
>
> c
>
hi. im just a newcomer to haskell (www.taesch.com). quite impressed till now
!
im trying to have haxml lib running with hugs and had the following problem
:
1) under win, quite an issue to tun the cpp stuff. did it under linux, (for
info)
2) then i had a "maybeA" which is unknown. some lib i had to add ? ("maybe"
doesnt seems to work)
3) a module declare a "with" function, which hugs doenst seem to like .
renamed it withlt for now.
this make me thinks that this lib is probably not tested under hugs98. could
someone confirm that ? as im too newbies, im maybe missing something
obvious. Id better asking, i thought.
thanks
Luc
From Malcolm.Wallace@cs.york.ac.uk Thu Mar 22 21:19:45 2001
From: Malcolm.Wallace@cs.york.ac.uk (Malcolm Wallace)
Date: Thu, 22 Mar 2001 21:19:45 +0000
Subject: HaXml (was: Re: Welcome to the "Haskell" mailing list)
In-Reply-To: <3AB99E06.C7B3A158@europemail.com>
Message-ID: <4GcAAHJsujpELAIA@cs.york.ac.uk>
> im trying to have haxml lib running with hugs and had the following problem
> 1) under win, quite an issue to tun the cpp stuff. did it under linux, (for
> info)
Thanks for the report. I'll think some more about how to package
HaXml to make things easier for Hugs users.
> 2) then i had a "maybeA" which is unknown. some lib i had to add ? ("maybe"
> doesnt seems to work)
The only use of "maybeA" is in a comment containing some example
code for documentation purposes. It appears that this example is
now out of date, for which, apologies. If you want to use the
example, you need to rename "maybeA" to "maybeToAttr".
> 3) a module declare a "with" function, which hugs doenst seem to like.
> renamed it withlt for now.
"with" is a perfectly valid Haskell function name, but Hugs may have
stolen it for a language extension. Try giving Hugs the +98 option
at startup, to ensure that all extensions are turned off. [Note to
users of the implicit parameter extension: I believe in future the
pseudo-keyword "with" will be removed and replaced by "let".]
> this make me thinks that this lib is probably not tested under hugs98. could
> someone confirm that ? as im too newbies, im maybe missing something
> obvious. Id better asking, i thought.
HaXml is occasionally tested with Hugs98, but not as often as we
test it with other compilers. Soon however, we are hoping to have
a grand hierarchy of standard libraries for Haskell (including HaXml
amongst many others), which will be completely compiler-independent,
and tested regularly with all three or four currently-available
compilers/interpreters. This should greatly improve the portability
of a lot of publically-available Haskell code.
Regards,
Malcolm
From jens-ulrik.petersen@nokia.com Fri Mar 23 03:26:41 2001
From: jens-ulrik.petersen@nokia.com (Jens-Ulrik Petersen)
Date: 23 Mar 2001 12:26:41 +0900
Subject: url update for Asperti & Longo: "Categories, Types and Structures"
In-Reply-To: "Frank Atanassow"'s message of "Fri, 9 Mar 2001 21:33:09 +0100"
References: <20010309213309.A1440@cs.uu.nl>
Message-ID:
Hi Frank,
Thanks for making . Good
idea!
"Frank Atanassow" writes:
> [1] Andrea Asperti and Giussepe Longo. Categories, Types and Structures. An
> introduction to Category Theory for the working computer
> scientist. MIT Press, 1991.
> URL: http://www.dmi.ens.fr/users/longo/download.html
It seems ENS's DMI bifurcated... the current url is now
http://www.di.ens.fr/users/longo/download.html
Maybe you could update the link on your page too.
Thanks, Jens
From sambat_101@yahoo.com Fri Mar 23 12:46:44 2001
From: sambat_101@yahoo.com (Bark Fook)
Date: Fri, 23 Mar 2001 04:46:44 -0800 (PST)
Subject: Question concerning ftp and GHC binaries for HP-UX
In-Reply-To: <20010322170103.8E2B7255C0@www.haskell.org>
Message-ID: <20010323124644.3094.qmail@web5505.mail.yahoo.com>
> Message: 1
> From: "ADAMS,RICHARD (Non-HP-Roseville,ex1)"
>
> To: "'haskell@haskell.org'"
> Subject: Question concerning ftp and GHC binaries
> for HP-UX
> Date: Wed, 21 Mar 2001 12:24:15 -0700
>
> I would like to download the GHC binaries to our HP
> 9000 machine (HP-UX
> 11.0), but have access only to ftp (i.e., no Web
> browser is available).
> Does anyone know what ftp address to use? Also,
> does anyone know whether
> the GHC binaries for the HP-UX operating system will
> work on HP-UX 11.0?
>
> I am not sure whether it is relevant, but I use
> Reflection terminal
> emulation to telnet from my PC to the HP 9000
> machine. Truly 'hi-tech' :) .
>
> Thank you.
>
> Sincerely,
>
> Richard E. Adams
> Softmatrix, Inc.
> Roseville, CA
> Email: richard_adams@non.hp.com
>
I encountered the same problem of downloading with
ftp. However, even if you succeeded in downloading, I
guess it would not work as we wish:(. The system I use
is HP-UX 11.00 (64-bit) HPPA 2.0. And I downloaded the
version 4.08.2 for hppa1.1-hp-hpux with HTTP. It ran
(without explicit errors) and output sth when input
sth.hs. However, each time when I ran the sth, I got
core dump. I tried to recompile the compiler (or even
Happy), of course, failed with the same symptom (or
unHappy). If I know anyone has successfully run GHC
without incurring core dumps in HP-UX 11.00 (64-bit),
I'll be very happy if Happy works too:). If I have
enough time, I wish I could port it to HP-UX 11.00
(64-bit). I'm very glad to know if there exists
somebody who will aid me or play together with me over
64-bit ghc for 64-bit HPUXes. Should I attack the
problem from HBC or nhc98?
One more bad news, SMLNJ works on HP-UX 10.20, not on
HP-UX 11.00, either:-(. I've tried and failed too.
One more good news, Hugs98-Feb2001 does work in HP-UX
11.00 (64-bit). I swear, where only very few tweaks
are needed. But I guess it's running in 32-bit
mode:-).
The last kisstion: Can I build ghc from Hugs, my god?
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
From Malcolm.Wallace@cs.york.ac.uk Fri Mar 23 16:24:18 2001
From: Malcolm.Wallace@cs.york.ac.uk (Malcolm Wallace)
Date: Fri, 23 Mar 2001 16:24:18 +0000
Subject: Question concerning ftp and GHC binaries for HP-UX
In-Reply-To: <20010323124644.3094.qmail@web5505.mail.yahoo.com>
Message-ID:
> I'm very glad to know if there exists
> somebody who will aid me or play together with me over
> 64-bit ghc for 64-bit HPUXes. Should I attack the
> problem from HBC or nhc98?
> The last kisstion: Can I build ghc from Hugs
Ghc can only be built by itself, not with any other Haskell system.
The only Haskell compiler that is truly written in Haskell'98 and
can be built by all other compilers is nhc98. Unfortunately nhc98
only works (currently) on 32-bit machines, not on 64-bits.
By the way, if someone wanted to donate a login on an 64-bit machine
accessible over the net, I would be interested to try to patch nhc98
to work under a 64-bit architecture.
Regards,
Malcolm
From khaliff@astercity.net Fri Mar 23 18:45:25 2001
From: khaliff@astercity.net (Wojciech Moczydlowski, Jr)
Date: Fri, 23 Mar 2001 19:45:25 +0100 (CET)
Subject: Announce: Haskell libpq binding
Message-ID:
The Haskell libpq (client-side PostgreSQL programming library) binding is
now available to download, along with a simple DBI for Haskell, similar to
this in Perl, allowing a programmer to write a database-independent
code.
It can be found at http://www.astercity.net/~khaliff/haskell/dbi/dbi.tgz. To
compile, KDirect (http://www.astercity.net/~khaliff/kdirect) and the latest
version of QForeign (http://sourceforge.net/projects/qforeign) is needed. It
should compile both under ghc and nhc, yet only ghc was tested. It is no
end-user product, though - there is no "install" rule in Makefile and
Makefile editing is necessary, I'm afraid.
If someone finds it useful or has any suggestions, I would love to hear
them.
Wojciech Moczydlowski, Jr
From tobi.haeberlein@gmx.de Tue Mar 27 09:38:55 2001
From: tobi.haeberlein@gmx.de (Tobias Haeberlein)
Date: Tue, 27 Mar 2001 11:38:55 +0200 (MEST)
Subject: the constant functor
Message-ID: <24765.985685935@www18.gmx.net>
I am trying to make all polynomial functors (in the
categorical sense) an instance of the class Functor.
Consider a datatype (corresponsing to a constant functor):
data ConstInt a = Const Int
ConstInt is clearly a functor in the categorical sense,
but is 'ConstInt' also a functor in Haskell??
Any ideas how to make 'ConstInt' an instance of class Functor?
-Tobi
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
From tobi.haeberlein@gmx.de Tue Mar 27 10:09:59 2001
From: tobi.haeberlein@gmx.de (Tobias Haeberlein)
Date: Tue, 27 Mar 2001 12:09:59 +0200 (MEST)
Subject: the constant functor
References:
Message-ID: <16008.985687799@www18.gmx.net>
> What is wrong with:
>
> class Functor ConstInt where
> map f (Const n) = Const n
Ups - absolutely nothing.
I actually tried it with
data ConstInt a = Int
and didnt manage to make this an instance of
class Functor. Sorry for giving the wrong
example.
-Tobi
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
From rms@it-c.dk Tue Mar 27 11:37:13 2001
From: rms@it-c.dk (rms)
Date: Tue, 27 Mar 2001 13:37:13 +0200
Subject: Regarding open positions at IT-C
Message-ID: <3AC07B68.B1EDF550@it-c.dk>
Regarding open positions at The IT-University of Copenhagen,
Via the following URL you will find a detailed description of 13 positions as
Associate or Assistant Professor currently open at The IT-University of
Copenhagen.
http://www.it-c.dk/pub_uk/db_363.html
Kind Regards
Personnel Department/ The IT-University of Copenhagen
From aw@free.elogica.com.br Wed Mar 28 05:35:11 2001
From: aw@free.elogica.com.br (Andre W B Furtado)
Date: Wed, 28 Mar 2001 02:35:11 -0300
Subject: Duvidas
Message-ID: <000801c0b748$dded0400$a8dbf9c8@windows9>
This is a multi-part message in MIME format.
------=_NextPart_000_0005_01C0B72F.B655DC00
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
In Hugs Graphics Library, many procedures call the function getEvent =
with a Window as the parameter. But getEvent is defined as below:
getEvent :: Events -> IO Event
How does this work? I've tryied to do something similar and got the =
following error message (in GHC):
Couldn't match `Events' against `Window'
Expected type: Events
Inferred type: Window
In the first argument of `getEvent', namely `w'
In a do statement: e <- getEvent w
In time: my "Window" is defined as following
data Window =3D MkWindow {=20
win :: GLUT.Window, -- the real window
events :: Events -- the event stream
}
And in Hugs Graphics Library the "Window" is defined as:
data Window =3D MkWindow {
wnd :: WND, -- the real window
events :: Events, -- the event stream
graphic :: IORef (Draw ()) -- the current graphic
}
Thanks,
Andre
------=_NextPart_000_0005_01C0B72F.B655DC00
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
In Hugs Graphics Library, many procedures call =
the function=20
getEvent with a Window as the parameter. But getEvent is =
defined=20
as below:
getEvent :: Events -> IO Event
How does this work? I've tryied to do something similar and =
got the=20
following error message (in GHC):
Couldn't match `Events' against=20
`Window'
Expected type:=20
Events
Inferred type:=20
Window
In the first argument of `getEvent', namely =
`w'
In a do statement: e <- getEvent =
w
In time: my "Window" is defined as following
data Window =3D MkWindow {
=
win =20
:: GLUT.Window, -- the real window
=
events ::=20
Events -- the event stream
}
And in Hugs Graphics Library the "Window" is defined as:
data Window =3D MkWindow {
wnd ::=20
WND, -- the real=20
window
events :: =
Events, --=20
the event stream
graphic :: IORef (Draw ()) =
-- the=20
current graphic
}
Thanks,
Andre
------=_NextPart_000_0005_01C0B72F.B655DC00--
From aw@free.elogica.com.br Wed Mar 28 05:37:05 2001
From: aw@free.elogica.com.br (Andre W B Furtado)
Date: Wed, 28 Mar 2001 02:37:05 -0300
Subject: getEvent Doubts
Message-ID: <001301c0b749$20d06dc0$a8dbf9c8@windows9>
This is a multi-part message in MIME format.
------=_NextPart_000_0010_01C0B72F.FA8770A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
[Sorry about the previous email subject :) ]
In Hugs Graphics Library, many procedures call the function getEvent =
with a Window as the parameter. But getEvent is defined as below:
getEvent :: Events -> IO Event
How does this work? I've tryied to do something similar and got the =
following error message (in GHC):
Couldn't match `Events' against `Window'
Expected type: Events
Inferred type: Window
In the first argument of `getEvent', namely `w'
In a do statement: e <- getEvent w
In time: my "Window" is defined as following
data Window =3D MkWindow {=20
win :: GLUT.Window, -- the real window
events :: Events -- the event stream
}
And in Hugs Graphics Library the "Window" is defined as:
data Window =3D MkWindow {
wnd :: WND, -- the real window
events :: Events, -- the event stream
graphic :: IORef (Draw ()) -- the current graphic
}
Thanks,
Andre
------=_NextPart_000_0010_01C0B72F.FA8770A0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
[Sorry about the previous email subject :) ]
In Hugs Graphics Library, many procedures call =
the function=20
getEvent with a Window as the parameter. But getEvent is =
defined=20
as below:
getEvent :: Events -> IO Event
How does this work? I've tryied to do something similar and =
got the=20
following error message (in GHC):
Couldn't match `Events' against=20
`Window'
Expected type:=20
Events
Inferred type:=20
Window
In the first argument of `getEvent', namely =
`w'
In a do statement: e <- getEvent =
w
In time: my "Window" is defined as following
data Window =3D MkWindow {
=
win =20
:: GLUT.Window, -- the real window
=
events ::=20
Events -- the event stream
}
And in Hugs Graphics Library the "Window" is defined as:
data Window =3D MkWindow {
wnd ::=20
WND, -- the real=20
window
events :: =
Events, --=20
the event stream
graphic :: IORef (Draw ()) =
-- the=20
current graphic
}
Thanks,
Andre
------=_NextPart_000_0010_01C0B72F.FA8770A0--
From christian.lescher@icn.siemens.de Wed Mar 28 09:30:04 2001
From: christian.lescher@icn.siemens.de (Lescher Christian)
Date: Wed, 28 Mar 2001 11:30:04 +0200
Subject: Difficulties compiling hmake / HaXml
Message-ID: <353063C297A9D3118F760008C791E26901F864F3@MCHH263E>
I want to use HaXml, and since hmake is required first, I'm currently trying to build hmake with GHC. Unfortunately "make" fails; I get the above errors message.
What am I doing wrong here?
I use GHC4.08.2 (InstallShield version) under WinNT4/Cygwin1.1.8.
Christian
make[1]: Entering directory `/test-hmake/hmake-2.02/src/interpreter'
mkdir -p /test-hmake/hmake-2.02/targets/ix86-CYGWIN_NT-4.0/obj/interpreter
/test-hmake/hmake-2.02/script/hmake -ghc HInteractive -d/test-hmake/hmake-2.02/t
argets/ix86-CYGWIN_NT-4.0/obj/interpreter
Fail: Can't find module Posix in
.
Or in standard libraries at
/ghc/ghc-4.08.2/lib/imports/std
/ghc/ghc-4.08.2/lib/imports/data
/ghc/ghc-4.08.2/lib/imports/lang
/ghc/ghc-4.08.2/lib/imports/posix
/ghc/ghc-4.08.2/lib/imports/net
/ghc/ghc-4.08.2/lib/imports/num
/ghc/ghc-4.08.2/lib/imports/text
/ghc/ghc-4.08.2/lib/imports/util
/ghc/ghc-4.08.2/lib/imports/win32
/ghc/ghc-4.08.2/lib/imports/concurrent
Asked for by: HmakeConfig.hs
[Check settings of -I or -P flags?]
Stop - hmake dependency error.
make[1]: *** [/test-hmake/hmake-2.02/lib/ix86-CYGWIN_NT-4.0/HInteractive.exe] Er
ror 1
make[1]: Leaving directory `/test-hmake/hmake-2.02/src/interpreter'
make: *** [targets/ix86-CYGWIN_NT-4.0/hmake_g] Error 2
From rjljr2@yahoo.com Wed Mar 28 12:17:39 2001
From: rjljr2@yahoo.com (Ronald Legere)
Date: Wed, 28 Mar 2001 04:17:39 -0800 (PST)
Subject: getEvent Doubts
In-Reply-To: <001301c0b749$20d06dc0$a8dbf9c8@windows9>
Message-ID: <20010328121739.66543.qmail@web10001.mail.yahoo.com>
--- Andre W B Furtado wrote:
> [Sorry about the previous email subject :) ]
>
> In Hugs Graphics Library, many procedures call the
> function getEvent with a Window as the parameter.
> But getEvent is defined as below:
>
> getEvent :: Events -> IO Event
>
> How does this work? I've tryied to do something
> similar and got the following error message (in
> GHC):
Actually, this can't work (can it?).
So there must be another
getEvent :: Window -> IO Event.
(.i.e. Its sort of overloaded).
And so , there is at least one, in SOEGraphics.hs
getEvent window = getWindowEvent window
where getWindowEvent pulls out the Events from
a window and calls Events.getEvent :: Events-> IO
Event
(The getEvent :: Events-> IO Event is imported
qualified from GraphicsEvents.hs. I guess this was
done to avoid defining a type class, and probably
also because the end user doesnt need the
Events.getEvent, or at least very much)
Of course I am just speculating. I didnt write it :)
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/?.refer=text
From reid@cs.utah.edu Wed Mar 28 19:21:24 2001
From: reid@cs.utah.edu (Alastair Reid)
Date: Wed, 28 Mar 2001 12:21:24 -0700
Subject: getEvent Doubts
In-Reply-To: <20010328121739.66543.qmail@web10001.mail.yahoo.com>
Message-ID:
> Actually, this can't work (can it?).
> So there must be another
> getEvent :: Window -> IO Event.
> (.i.e. Its sort of overloaded).
> And so , there is at least one, in SOEGraphics.hs
> getEvent window = getWindowEvent window
Absolutely correct.
The SOEGraphics interface was frozen at the time that the School of Expression (SOE) book went to the printers. The HGL interface
has been updated (cleaned up and extended) since and SOEGraphics.hs is used to bridge the gap between the two interfaces. If you're
using SOE, you should rely on the book as your primary source of information about the interface. If you're not using SOE, I'd
recommend the HGL interface.
> where getWindowEvent pulls out the Events from
> a window and calls Events.getEvent :: Events-> IO Event
> (The getEvent :: Events-> IO Event is imported
> qualified from GraphicsEvents.hs. I guess this was
> done to avoid defining a type class, and probably
> also because the end user doesnt need the
> Events.getEvent, or at least very much)
More the latter than the former.
Hope this helps,
--
Alastair Reid
From ashley@semantic.org Thu Mar 29 09:46:59 2001
From: ashley@semantic.org (Ashley Yakeley)
Date: Thu, 29 Mar 2001 01:46:59 -0800
Subject: Parameterising Class Constraints in Existential Types
Message-ID: <200103290946.BAA23045@mail4.halcyon.com>
Is this valid (extended) Haskell?
--
class MyClass a b where
foo :: a -> b -> Int
data Special = forall b. (MyClass Int b)=> MkSpecial b
data General a = forall b. (MyClass a b)=> MkGeneral b
--
Hugs complains about the 'General' line but has no problem with the
'Special' line...
--
Ashley Yakeley, Seattle WA
From nozone@sbox.tu-graz.ac.at Thu Mar 29 16:54:01 2001
From: nozone@sbox.tu-graz.ac.at (Andreas Leitner)
Date: Thu, 29 Mar 2001 18:54:01 +0200
Subject: constants and functions without arguments
Message-ID: <3AC368A9.5BE8721F@sbox.tu-graz.ac.at>
Hi,
I hope this is the right forum to post my question to.
Given a lazy pure functional language do we need to differntiate (in
syntax) between constants and functions without agruments? And if we
don't need to, does Haskell make a difference?
In a language with eager evaluation (let's take SML) we must
differentiat. Given we have a function that takes one argument of type
int, is different than a function that takes unit->int. Because of
that in SML, whenever I have a function (say "h") that takes an int,
and I want to apply a function (without arguments), let's call it g)
on it I need to add "()" at the end.
h g()
but for any constant i of type int I write:
h i
Now, this leads to my question: In a lazy language do I need to write
those "()", or could the compiler tell the difference and always do
the correct thing?
many thanks in advance,
Andreas
From Tom.Pledger@peace.com Thu Mar 29 22:15:00 2001
From: Tom.Pledger@peace.com (Tom Pledger)
Date: Fri, 30 Mar 2001 10:15:00 +1200
Subject: constants and functions without arguments
In-Reply-To: <3AC368A9.5BE8721F@sbox.tu-graz.ac.at>
References: <3AC368A9.5BE8721F@sbox.tu-graz.ac.at>
Message-ID: <15043.46052.112130.797961@waytogo.peace.co.nz>
Andreas Leitner writes:
:
| Given a lazy pure functional language do we need to differntiate
| (in syntax) between constants and functions without agruments? And
| if we don't need to, does Haskell make a difference?
Haskell always treats a declaration of the form
foo = ...
as a pattern binding, not as a function binding. Sections 4.4.3 and
4.5 of the Haskell 98 report give more details.
So, in that sense, every function in Haskell takes an argument.
There's nothing to prevent you from adding a dummy parameter to turn a
constant (i.e. a simple pattern binding) into a function. The only
reason I've heard for doing so, is to work around the monomorphism
restriction.
HTH.
Tom
From dario.bahena@correo.unam.mx Fri Mar 30 05:33:05 2001
From: dario.bahena@correo.unam.mx (dario.bahena@correo.unam.mx)
Date: Thu, 29 Mar 2001 23:33:05 -0600
Subject: ffi & recursive data types
Message-ID: <985930385.3ac41a91480f3@oxigeno.servidores.unam.mx>
hi ...
I'm new in ffi stuff and tools like greencard.
Everything was working ok, until I wanted to:
translate a haskell recursive data type(list,trees,etc) into
a corresponding C type and back again.
How can I do this?
Thanks in advance
saludos
dario estepario ...
-------------------------------------------------
Obtén tu correo en www.correo.unam.mx
UNAMonos Comunicándonos
From simonpj@microsoft.com Fri Mar 30 07:57:16 2001
From: simonpj@microsoft.com (Simon Peyton-Jones)
Date: Thu, 29 Mar 2001 23:57:16 -0800
Subject: Parameterising Class Constraints in Existential Types
Message-ID: <37DA476A2BC9F64C95379BF66BA269029F4176@red-msg-09.redmond.corp.microsoft.com>
It seems reasonable to me, and GHC is happy.=20
Here's a working example:
Simon
class MyClass a b where
foo :: a -> b -> Int
data Special =3D forall b. (MyClass Int b)=3D> MkSpecial b
data General a =3D forall b. (MyClass a b)=3D> MkGeneral b
instance MyClass Int Bool where
foo x False =3D -x
foo x True =3D x
xs :: [General Int]
xs =3D [MkGeneral True, MkGeneral False]
main =3D print [foo (3::Int) x | MkGeneral x <- xs]
| -----Original Message-----
| From: Ashley Yakeley [mailto:ashley@semantic.org]
| Sent: 29 March 2001 10:47
| To: Haskell List
| Subject: Parameterising Class Constraints in Existential Types
|=20
|=20
| Is this valid (extended) Haskell?
|=20
| --
| class MyClass a b where
| foo :: a -> b -> Int
|=20
| data Special =3D forall b. (MyClass Int b)=3D> MkSpecial b
| data General a =3D forall b. (MyClass a b)=3D> MkGeneral b
| --
|=20
| Hugs complains about the 'General' line but has no problem with the=20
| 'Special' line...
|=20
| --=20
| Ashley Yakeley, Seattle WA
|=20
|=20
| _______________________________________________
| Haskell mailing list
| Haskell@haskell.org
| http://www.haskell.org/mailman/listinfo/haskell
|=20
From nozone@sbox.tu-graz.ac.at Fri Mar 30 10:25:16 2001
From: nozone@sbox.tu-graz.ac.at (Andreas Leitner)
Date: Fri, 30 Mar 2001 12:25:16 +0200
Subject: constants and functions without arguments
Message-ID: <3AC45F0C.4D5FC6F1@sbox.tu-graz.ac.at>
This is a multi-part message in MIME format.
--------------9A5E4CE57464CF0630C36C5F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Tom Pledger wrote:
>
> Andreas Leitner writes:
> :
> | Given a lazy pure functional language do we need to differntiate
> | (in syntax) between constants and functions without agruments? And
> | if we don't need to, does Haskell make a difference?
>
> Haskell always treats a declaration of the form
>
> foo = ...
>
> as a pattern binding, not as a function binding. Sections 4.4.3 and
> 4.5 of the Haskell 98 report give more details.
>
> So, in that sense, every function in Haskell takes an argument.
> There's nothing to prevent you from adding a dummy parameter to turn a
> constant (i.e. a simple pattern binding) into a function. The only
> reason I've heard for doing so, is to work around the monomorphism
> restriction.
Exactly thats' the reason for my question: Overcome ther monomorphism.
I come from an Eiffel background and there we have the uniform access
principle, which is a very important thing in that world. It means
that you access an attribute just like a function with no parameters.
This is actually a form of information hiding as you can change the
underlying implementation (an attribute to a function and vice versa).
The classic examlple for this is class POINT, which has an interface
like that:
--
POINT
-- group 1
x: DOUBLE
y: DOUBLE
-- group 2
rho: DOUBLE
abs: DOUBLE
--
Now, you can choose to either implement group 1 as attributes, or
group 2 and calculate the other one. With the uniform access
principle, which says that accessing attributes and functions with no
arguments happen in the same syntactic way, you can change the
implementaion without notice. No user of this class needs to know.
I am to new to FP to say whether this is equaly important in
FP-languages, since the semantics are different (constants vs.
attributes and immutable values vs. objects), but for now I am just
currious wether it is possible theoretically.
I mean couldn't one say that there are no constants, just functions
with no arguments or the Void/Unit argument that return an expression.
Since we have lazy evaluation, there won't be a problem at runtime,
but would the type system allow such a thing?
tia,
Andreas
--------------9A5E4CE57464CF0630C36C5F
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
X-Mozilla-Status2: 00000000
Message-ID: <3AC45E6E.AC2DC3C2@sbox.tu-graz.ac.at>
Date: Fri, 30 Mar 2001 12:22:38 +0200
From: Andreas Leitner
X-Mailer: Mozilla 4.75 [en] (X11; U; Linux 2.2.17 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: Tom Pledger
Subject: Re: constants and functions without arguments
References: <3AC368A9.5BE8721F@sbox.tu-graz.ac.at> <15043.46052.112130.797961@waytogo.peace.co.nz>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Tom Pledger wrote:
>
> Andreas Leitner writes:
> :
> | Given a lazy pure functional language do we need to differntiate
> | (in syntax) between constants and functions without agruments? And
> | if we don't need to, does Haskell make a difference?
>
> Haskell always treats a declaration of the form
>
> foo = ...
>
> as a pattern binding, not as a function binding. Sections 4.4.3 and
> 4.5 of the Haskell 98 report give more details.
>
> So, in that sense, every function in Haskell takes an argument.
> There's nothing to prevent you from adding a dummy parameter to turn a
> constant (i.e. a simple pattern binding) into a function. The only
> reason I've heard for doing so, is to work around the monomorphism
> restriction.
Exactly thats' the reason for my question: Overcome ther monomorphism.
I come from an Eiffel background and there we have the uniform access
principle, which is a very important thing in that world. It means
that you access an attribute just like a function with no parameters.
This is actually a form of information hiding as you can change the
underlying implementation (an attribute to a function and vice versa).
The classic examlple for this is class POINT, which has an interface
like that:
--
POINT
-- group 1
x: DOUBLE
y: DOUBLE
-- group 2
rho: DOUBLE
abs: DOUBLE
--
Now, you can choose to either implement group 1 as attributes, or
group 2 and calculate the other one. With the uniform access
principle, which says that accessing attributes and functions with no
arguments happen in the same syntactic way, you can change the
implementaion without notice. No user of this class needs to know.
I am to new to FP to say whether this is equaly important in
FP-languages, since the semantics are different (constants vs.
attributes and immutable values vs. objects), but for now I am just
currious wether it is possible theoretically.
I mean couldn't one say that there are no constants, just functions
with no arguments or the Void/Unit argument that return an expression.
Since we have lazy evaluation, there won't be a problem at runtime,
but would the type system allow such a thing?
tia,
Andreas
--------------9A5E4CE57464CF0630C36C5F--
From jigg@ugr.es Fri Mar 30 10:42:02 2001
From: jigg@ugr.es (Juan Ignacio =?iso-8859-1?Q?Garc=EDa=20Garc=EDa?=)
Date: Fri, 30 Mar 2001 12:42:02 +0200
Subject: communication between thread
Message-ID: <3AC462FA.1E82A18D@ugr.es>
Hello,
I am using the library oncurrent of GHC. I'd like to know how two
different threads can communicate each other.
To solve the problem I thought in something like a global variable. If
there any method to avoid the use of that kind of variables in haskell.
Thanks in advance
J. I. García
From simonmar@microsoft.com Fri Mar 30 11:47:20 2001
From: simonmar@microsoft.com (Simon Marlow)
Date: Fri, 30 Mar 2001 12:47:20 +0100
Subject: communication between thread
Message-ID: <9584A4A864BD8548932F2F88EB30D1C60171F58F@TVP-MSG-01.europe.corp.microsoft.com>
> I am using the library oncurrent of GHC. I'd like to know how two
> different threads can communicate each other.=20
> To solve the problem I thought in something like a global variable. If
> there any method to avoid the use of that kind of variables=20
> in haskell.
You can use the various concurrent data structures in the Concurrent
library. See:
=20
http://www.haskell.org/ghc/docs/latest/set/sec-concurrency-abstractions.
html
The simplest form of communication is through an MVar, which is a
thread-safe mutable variable.
Cheers,
Simon
From lennart@mail.augustsson.net Fri Mar 30 12:18:44 2001
From: lennart@mail.augustsson.net (Lennart Augustsson)
Date: Fri, 30 Mar 2001 07:18:44 -0500
Subject: constants and functions without arguments
References: <3AC368A9.5BE8721F@sbox.tu-graz.ac.at>
Message-ID: <3AC479A4.44FAF5F2@mail.augustsson.net>
Andreas Leitner wrote:
> Hi,
>
> I hope this is the right forum to post my question to.
>
> Given a lazy pure functional language do we need to differntiate (in
> syntax) between constants and functions without agruments? And if we
> don't need to, does Haskell make a difference?
From a pedantic point of view your question makes no sense. The definition
of a function is something that takes an argument and transforms it to a
result. So a function always has exactly one argument. Period.
But from a practical point of view, yes you can regard constants as functions
with no arguments. And it makes sense from a syntactic point of view:
f0 = e0
f1 x = e1
f2 x y = e2
f3 x y z = e3
...
-- Lennart
From ltaesch@europemail.com Fri Mar 30 13:01:32 2001
From: ltaesch@europemail.com (Luc taecsh)
Date: Fri, 30 Mar 2001 08:01:32 -0500
Subject: beginners silly question
Message-ID: <3ACC1E56@MailAndNews.com>
Ive just decided to start with haskell (after a decade of OO, and a few month
of erlang (already impressive))
despite i love linux, id like to stay with wintel, to be able to use it at the
office, and try to slot it in my daily job, slowly.
(doing some modeling, should be useful)
1)are there a full package of haskell over there ?
2)ive installed hugs, SOE libs, haxml, frantk, tcl/tk, g/hood, hdoc, and
jcreator
what am i missing ?
any incompatiblities +98 -98, and so on ?
3)if i get some good stuff done, id like to compile them , as small
utilitaries. (best way to turn H in my daily job)
my first try at ghc was not that fun (deppendencies on gcc, libs, and so on)
as a alternative, ive tried under linux (m7.2),where ghc is installed by
default, but even here , were i was expecting fluentness, its not cristal
clear, hangs, missing bits i dont understand. no samples/ demo ? or is it a
packaging issue ?
4) generally, are there any project to have some ready to use all-included
package ? i understans some effort are under way on the great lib side, but
are there anything avaialble now (its still farther than for me)
for info, in the eiffel world, some guy (elj) once tried to put all the stuff
together in a click and install package, and it really helped the gnu eiffel
stuff starting in win world, (where things are not so simple , when unix is
assumed with gnu stuffs...)
(if some think answering DIY, just think its what effectivelly happen^s
everytime, everywhere in the world someone goes beyong haskell.org front
page... but all u haskell people are too smart for me to mention that.. ;-)
From karczma@info.unicaen.fr Fri Mar 30 15:01:25 2001
From: karczma@info.unicaen.fr (Jerzy Karczmarczuk)
Date: Fri, 30 Mar 2001 16:01:25 +0100
Subject: constants and functions without arguments
References: <3AC45F0C.4D5FC6F1@sbox.tu-graz.ac.at>
Message-ID: <3AC49FC5.119640E7@info.unicaen.fr>
Andreas Leitner wrote at the end of his discussion about
constants/functions sans arguments:
> I mean couldn't one say that there are no constants, just functions
> with no arguments or the Void/Unit argument that return an expression.
> Since we have lazy evaluation, there won't be a problem at runtime,
> but would the type system allow such a thing?
Lennart Augustsson:
> From a pedantic point of view your question makes no sense.
> The definition of a function is something that takes an argument
> and transforms it to a result. So a function always has exactly
> one argument. Period.
>
> But from a practical point of view, yes you can regard constants
> as functions with no arguments. And it makes sense from a syntactic
> point of view:
...
There are different kinds of pedantry.
In Clean there are constants-constants, and constants-functions,
or rather unevaluated graphs, and an assignment
x = expr
may mean something different from
x =: expr
If expr produces a loooong lazy structure, sometimes treating it
as an unevaluated thunk (or not reduced graph) is better than
having the "final" result, although in a pure functional language
there are no differences.
This is another problem, most probably beyond what interests A. L.,
but as you see, people think about such things.
Jerzy Karczmarczuk
Caen, France
From nordland@cse.ogi.edu Fri Mar 30 20:07:55 2001
From: nordland@cse.ogi.edu (Johan Nordlander)
Date: Fri, 30 Mar 2001 12:07:55 -0800
Subject: Parameterising Class Constraints in Existential Types
In-Reply-To: <200103290946.BAA23045@mail4.halcyon.com>
Message-ID: <200103302007.MAA02922@church.cse.ogi.edu>
Hi Ashley,
Hugs currently restricts the way constrained existential types
may be formed, for entirely internal, technical reasons. We're
currently looking over the implementation to see if it's
possible to lift the restriction without rewriting substantial
parts of the type checker.
-- Johan
On Thursday, March 29, 2001, at 01:46 AM, Ashley Yakeley wrote:
> Is this valid (extended) Haskell?
>
> --
> class MyClass a b where
> foo :: a -> b -> Int
>
> data Special = forall b. (MyClass Int b)=> MkSpecial b
> data General a = forall b. (MyClass a b)=> MkGeneral b
> --
>
> Hugs complains about the 'General' line but has no problem with the
> 'Special' line...
>
> --
> Ashley Yakeley, Seattle WA
>
>
> _______________________________________________
> Haskell mailing list
> Haskell@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell
>
From 2003250@mail.escuelaing.edu.co Fri Mar 30 22:26:53 2001
From: 2003250@mail.escuelaing.edu.co (Maldonado Castiblanco Camilo Ernesto)
Date: Fri, 30 Mar 2001 17:26:53 -0500 (COT)
Subject: question class tree
Message-ID:
I need a class tree for haskell. where can i find it?
From fis@ssh.com Sat Mar 31 09:20:18 2001
From: fis@ssh.com (Matthias Fischmann)
Date: 31 Mar 2001 12:20:18 +0300
Subject: question class tree
In-Reply-To: Maldonado Castiblanco Camilo Ernesto's message of "Fri, 30 Mar 2001 17:26:53 -0500 (COT)"
References:
Message-ID: <87d7ayl2gd.fsf@dengue.local>
Cris Okasaki [http://www.cs.columbia.edu/~cdo] has written tons of
papers on functional data structures, I guess you can steal code from
there. There was also a file containing all the examples from his
book `Purely Functional Data Structures' (Cambridge University Press,
1998, and everybody sais it's a must although I haven't seen it yet).
Unfortunately, I could not find it any more.
Matthias
Maldonado Castiblanco Camilo Ernesto <2003250@mail.escuelaing.edu.co> writes:
> I need a class tree for haskell. where can i find it?
>
>
> _______________________________________________
> Haskell mailing list
> Haskell@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell
>
--
Matthias Fischmann | Research Engineer | +358 (9) 8565 7474
fis@ssh.fi | SSH Communication Security Corp | +358 (40) 752 5291
From rjljr2@yahoo.com Sat Mar 31 14:44:59 2001
From: rjljr2@yahoo.com (Ronald Legere)
Date: Sat, 31 Mar 2001 06:44:59 -0800 (PST)
Subject: FFI tutorial??
In-Reply-To: <20010311145307H.chak@cse.unsw.edu.au>
Message-ID: <20010331144459.53707.qmail@web10004.mail.yahoo.com>
--- "Manuel M. T. Chakravarty"
wrote:
** about the various interface generators
> You see - the Haskell developers believe in choice
> ;-)
>
> Cheers,
> Manuel
I guess I have mixed feelings about all the choices.
Choices mean you can pick the best one for the job,
but it also means more to learn. Which also is good
and bad :):)
I suppose for the moment I will try to HDirect
and KDirect, as I would like to get a bit into
understanding how TCLhaskell is implemented. Cheers!
Thanks again for the pointers,Wojciech and Manuel !
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/?.refer=text
From rjljr2@yahoo.com Sat Mar 31 14:48:16 2001
From: rjljr2@yahoo.com (Ronald Legere)
Date: Sat, 31 Mar 2001 06:48:16 -0800 (PST)
Subject: A GUI toolkit looking for a friend
In-Reply-To: <37DA476A2BC9F64C95379BF66BA2690260D8DE@red-msg-09.redmond.corp.microsoft.com>
Message-ID: <20010331144816.71033.qmail@web10001.mail.yahoo.com>
--- Simon Peyton-Jones wrote:
> Gentle Haskellers
Did Clean IO ever find a friend? I wish I had the
time and abilities myself, as it does sound
interesting. I am still trying to get FFI stuff
working.
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/?.refer=text
From qrczak@knm.org.pl Sat Mar 31 20:18:23 2001
From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk)
Date: 31 Mar 2001 20:18:23 GMT
Subject: HaXml (was: Re: Welcome to the "Haskell" mailing list)
References: <4GcAAHJsujpELAIA@cs.york.ac.uk>
Message-ID:
Thu, 22 Mar 2001 21:19:45 +0000, Malcolm Wallace pisze:
> "with" is a perfectly valid Haskell function name, but Hugs may have
> stolen it for a language extension. Try giving Hugs the +98 option
> at startup, to ensure that all extensions are turned off. [Note to
> users of the implicit parameter extension: I believe in future the
> pseudo-keyword "with" will be removed and replaced by "let".]
I would like to replace "with" with "let" too. But SimonPJ said he
won't do it in ghc unless Hugs does it too, and Mark P Jones said
he won't do it in Hugs now (without deep reasons: no people/hours
to do that, and no plans to release next Hugs version this year).
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK
From senganb@ia.nsc.com Thu Mar 1 00:07:43 2001
From: senganb@ia.nsc.com (senganb@ia.nsc.com)
Date: Wed, 28 Feb 2001 17:07:43 -0700 (MST)
Subject: My stack overflow was due to addListToFM
Message-ID: <200103010007.RAA25137@ia.nsc.com>
Hi,
Interestingly given the recent discussion about foldl versus foldl'
I'd like to report that the stack overflow I was seeing was due to
addListToFM which is defined using foldl although addToFM is strict
in FiniteMap according to ghc:
addToFM :: ... {PrelBase.Ord key} -> FiniteMap key elt -> key -> elt -> FiniteMap key elt {-## __A 4 __S LSLL __U ...
So, I'd like to request that FiniteMap be changed to use foldl'.
Compiler implementors, I'd also like to request that your compiler
emit a warning in such cases if at all possible given that this has
since even the best haskell programmers seem to miss this case
(the authors of FiniteMap).
---------------------------------------------------------------------------------
For those of you wondering how I found this, I used the following heuristic:
1 Build your program with -prof -auto-all -caf-all
2 Run your program with -h so that Main.hp is created.
3 Then look at the various functions that are reported to use a lot of heap.
4 Grep through Main.hp for the function that happens to have a recent rapid increase of heap.
5 Then look at its code.
In my case I got
find_atoms/add_atom_equalities 33808
find_atoms/add_atom_equalities 186128
find_atoms/add_atom_equalities 338448
find_atoms/add_atom_equalities 490768
find_atoms/add_atom_equalities 643088
find_atoms/add_atom_equalities 795408
find_atoms/add_atom_equalities 947728
find_atoms/add_atom_equalities 1100048
find_atoms/add_atom_equalities 1233976
find_atoms/add_atom_equalities 1302328
find_atoms/add_atom_equalities 1370680
find_atoms/add_atom_equalities 1439032
find_atoms/add_atom_equalities 1507384
find_atoms/add_atom_equalities 1575736
find_atoms/add_atom_equalities 1644088
find_atoms/add_atom_equalities 1697552
just before the crash.
Reasoning
---------
Since GHC optimizes tail recursion, the cause of a stack overflow must be something else, eg:
a you've got a non-tail recursive function
b your tail recursive function has built a long spine on the heap of functions that are strict in their 2cd argument
so that you need to evaluate the bottom-most element of the spine (which causes you to push the address
of all the functions along the spine onto the stack)
c or...
I assumed b since I know my code doesn't contain many cases of a.
If b is the case, since the function that is overflowing is being evaluated,
we know that it's going to build up its spine quickly and then try to evalute it,
find that each function on the spine is strict in its second argument and then die. Therefore heuristic step 4.
You also need it to use a fair bit of heap to actually be bad enough to overflow the stack (therefore heuristic step 3).
Sengan
From proff@iq.org Thu Mar 1 02:25:46 2001
From: proff@iq.org (Julian Assange)
Date: 01 Mar 2001 13:25:46 +1100
Subject: interesting example of lazyness/ghc optimisation
Message-ID:
Brian Gregor wrote a haskell entrant for the random number
generation in Doug's language shootout
(http://www.bagley.org/~doug/shootout). Which is as follows:
module Main where
import System
import Numeric
iMi :: Int
iMi = 139968
iMd :: Double
iMd = 139968.0
iA ::Int
iA = 3877
iC ::Int
iC = 29573
nrRandom :: Int -> Double -> (Int,Double)
nrRandom last max = (newlast,(max * (fromIntegral newlast)/iMd))
where newlast = (last*iA+iC) `mod` iMi
runRandom :: Int -> Double -> Int -> Double
runRandom last max num
| num > 1 = runRandom (fst new) max (num-1)
| otherwise = snd new
where
new = nrRandom last max
main = do
~[n] <- getArgs
putStrLn (showFFloat (Just 12) (runRandom 42 100.0 (read n::Int)) "")
Noticing the use of tuples and normalisation at each step of
the iteration, I re-wrote this as:
module Main(main) where
import System(getArgs)
import Numeric(showFFloat)
main = do
~[n] <- getArgs
putStrLn (showFFloat (Just 12) (random 42 (read n::Int) 100.0) "")
return 1
random :: Int -> Int -> Double -> Double
random seed n max = norm (rand n seed) max
where norm x max = (fromIntegral x) * (max / imd)
rand n x = if n > 0 then rand (n-1) ((x * ia + ic) `mod` im) else x
im = 139968
imd = fromIntegral im
ia = 3877
ic = 29573
Interestingly, ghc / lazyness is able to detect that Brian's
normalisation etc at each step is uneeded, and only perform it at the
end. Consequently both of these programs are the the same speed (well,
almost; bizarrely, Brian's seems to be about 2% faster).
Julian.
From ketil@ii.uib.no Thu Mar 1 07:13:47 2001
From: ketil@ii.uib.no (Ketil Malde)
Date: 01 Mar 2001 08:13:47 +0100
Subject: interesting example of lazyness/ghc optimisation
In-Reply-To: Julian Assange's message of "01 Mar 2001 13:25:46 +1100"
References:
Message-ID:
There's something that I've been wanting to ask sombody about, since
it isn't terribly clear to me. Blatantly hijacking a function from
Julian's code:
> runRandom last max num
> | num > 1 = runRandom (fst new) max (num-1)
> | otherwise = snd new
While ifs are perhaps more intuitive when there are only two choices
(like here!), and pattern matching matches on the type of arguments
and not (only) their values,
What's the difference between the pipe-syntax, and a case statement,
i.e. writing the function as
runRandom last max num = case num of
1 -> runRandom ....
otherwise -> snd new
Is there a practical difference, and if not, why are there two ways to
skin this particular cat?
Apologies for coming up with a terribly naive question, but I've
looked in the HR without gaining much wisdom (beyond the recipe for
translating if to case).
-kzm
--
If I haven't seen further, it is by standing in the footprints of giants
From laszlo@ropas.kaist.ac.kr Thu Mar 1 07:37:58 2001
From: laszlo@ropas.kaist.ac.kr (Laszlo Nemeth)
Date: Thu, 1 Mar 2001 16:37:58 +0900 (KST)
Subject: interesting example of laziness/ghc optimisation
In-Reply-To: (message from Ketil
Malde on 01 Mar 2001 08:13:47 +0100)
References:
Message-ID: <200103010737.QAA16627@ropas.kaist.ac.kr>
* * * Ketil Malde wrote:
> > runRandom last max num
> > | num > 1 = runRandom (fst new) max (num-1)
> > | otherwise = snd new
>
> What's the difference between the pipe-syntax, and a case statement,
> i.e. writing the function as
>
> runRandom last max num = case num of
> 1 -> runRandom ....
> otherwise -> snd new
There is no difference. The 'pipe-syntax' (or pattern guards) gets
desugared (by the pattern matching compiler) to case statements i.e.:
runRandom = \ last max num.case (num > 1) of
True -> runRandom (fst new) max (num-1)
False -> snd new
For a more detailed discussion see SPJ's book, Augustsson original
paper, or M Pettersen't thesis (LNCS 1549).
HTH,
--laszlo
From ketil@ii.uib.no Thu Mar 1 08:40:48 2001
From: ketil@ii.uib.no (Ketil Malde)
Date: 01 Mar 2001 09:40:48 +0100
Subject: Pattern guards vs. case (was, unfortunately :Re: interesting example of laziness/ghc optimisation)
In-Reply-To: Laszlo Nemeth's message of "Thu, 1 Mar 2001 16:37:58 +0900 (KST)"
References:
<200103010737.QAA16627@ropas.kaist.ac.kr>
Message-ID:
(Apologies, I forgot to change the subject)
Laszlo Nemeth writes:
> * * * Ketil Malde wrote:
> There is no difference. The 'pipe-syntax' (or pattern guards) gets
> desugared (by the pattern matching compiler) to case statements i.e.:
> runRandom = \ last max num.case (num > 1) of
> True -> runRandom (fst new) max (num-1)
> False -> snd new
But - the converse is not true, is it? I can write
... = case foo of
(Foo f) -> ...
(Bar b) -> ...
but I can't express that as a pattern-guarded expression, can I? My
impression here is that the PG syntax adds nothing, and is hardly any
more readable, and less intuitive for migrators from more traditional
language. Why is it there at all? Is there a (rough) guideline for
when to use one or the other?
> For a more detailed discussion see SPJ's book, Augustsson original
> paper, or M Pettersen't thesis (LNCS 1549).
Okay, I'll try to look them up.
-kzm
--
If I haven't seen further, it is by standing in the footprints of giants
From john@foo.net Thu Mar 1 09:06:36 2001
From: john@foo.net (John Meacham)
Date: Thu, 1 Mar 2001 01:06:36 -0800
Subject: Pattern guards vs. case (was, unfortunately :Re: interesting example of laziness/ghc optimisation)
In-Reply-To: ; from ketil@ii.uib.no on Thu, Mar 01, 2001 at 09:40:48AM +0100
References: <200103010737.QAA16627@ropas.kaist.ac.kr>
Message-ID: <20010301010636.B21799@mark.ugcs.caltech.edu>
On Thu, Mar 01, 2001 at 09:40:48AM +0100, Ketil Malde wrote:
>
> (Apologies, I forgot to change the subject)
>
> Laszlo Nemeth writes:
>
> > * * * Ketil Malde wrote:
>
> > There is no difference. The 'pipe-syntax' (or pattern guards) gets
> > desugared (by the pattern matching compiler) to case statements i.e.:
>
> > runRandom = \ last max num.case (num > 1) of
> > True -> runRandom (fst new) max (num-1)
> > False -> snd new
>
> But - the converse is not true, is it? I can write
>
> ... = case foo of
> (Foo f) -> ...
> (Bar b) -> ...
>
> but I can't express that as a pattern-guarded expression, can I? My
> impression here is that the PG syntax adds nothing, and is hardly any
> more readable, and less intuitive for migrators from more traditional
> language. Why is it there at all? Is there a (rough) guideline for
> when to use one or the other?
this is because pattern guards are not the same as case statements, they
do not do matching and deconstruction of values, but rather are boolean
expressions to be checked _in order_ to determine whether to use that
function body or not.
imagine
f n | n < 0 = -1
f n | n < 5 = 1
f n = 2
this cannot be expressed as a single case statement because you cannot
match 'n' against an expression. (just like you cannot deconstruct a
value in a boolean expression as your above example demonstrates)
this translates to nested if statements rather than a single case
statement. what is confusing is that if statements can be constructed
from case statements too... the above translates to
f n = if n < 0 then -1 else if n < 5 then 1 else 2
or in case notation
case n < 0 of
True -> -1
False -> case n < 5 of
True -> 1
False -> 2
note you will need many nested case statements to deal with patter
guards, they are not equivalent to a single case statement.
in the core language 'case' is the ONLY alternation primitive so
everything can translate to it at some point. pattern guards are useful
because otherwise you end up with heavily nested if or case statements
which are definately less readable than the pattern-guard syntax.
hint: read '|' as 'such that' so
f n | n < 0 = ... reads "f of n such that n is less than zero is
..."
note also that the vertical bar interpreted in this way also
has mathematical precident so its not completely arbitrary.
Hope this helps and that I am not utterly wrong :)
John
--
--------------------------------------------------------------
John Meacham http://www.ugcs.caltech.edu/~john/
California Institute of Technology, Alum. john@foo.net
--------------------------------------------------------------
From Malcolm.Wallace@cs.york.ac.uk Thu Mar 1 09:13:44 2001
From: Malcolm.Wallace@cs.york.ac.uk (Malcolm Wallace)
Date: Thu, 1 Mar 2001 09:13:44 +0000
Subject: Pattern guards vs. case
In-Reply-To:
Message-ID:
> runRandom last max num
> | num > 1 = runRandom (fst new) max (num-1)
> | otherwise = snd new
> What's the difference between the pipe-syntax, and a case statement,
> i.e. writing the function as
> runRandom last max num = case num of
> 1 -> runRandom ....
> otherwise -> snd new
Eeek! This is not the same function! (num>1) =/= (num==1)
Oh, and it isn't type-correct either.
Try:
runRandom last max num = case num>1 of
True -> runRandom ....
otherwise -> snd new
Oops. No. Try again:
runRandom last max num = case num>1 of
True -> runRandom ....
False -> snd new
That's better. These transformations by hand can be tricky, huh?
Regards,
Malcolm
From laszlo@ropas.kaist.ac.kr Thu Mar 1 10:43:04 2001
From: laszlo@ropas.kaist.ac.kr (Laszlo Nemeth)
Date: Thu, 1 Mar 2001 19:43:04 +0900 (KST)
Subject: Pattern guards vs. case (was, unfortunately :Re: interesting example of laziness/ghc optimisation)
In-Reply-To: (message from Ketil
Malde on 01 Mar 2001 09:40:48 +0100)
References:
<200103010737.QAA16627@ropas.kaist.ac.kr>
Message-ID: <200103011043.TAA17620@ropas.kaist.ac.kr>
* * * Ketil Malde wrote:
> ut - the converse is not true, is it? I can write
>
> ... = case foo of
> (Foo f) -> ...
> (Bar b) -> ...
>
> ut I can't express that as a pattern-guarded expression, can I?
You probably have already seen John's reply which pretty much says
everything. But if you want to be really weird you can write something
like (I haven't typed this in):
f x | (Foo _) == x =
f x | (Bar _) == x =
which doesn't buy you anything because it doesn't bind the argument of
Foo to anything. There were a couple of messages a year or so ago
about what can be done with pattern matching and I recall Simon Marlow
posted a few puzzling examples.
> Why is it there at all? Is there a (rough) guideline for when to
> use one or the other?
Sugar ... but I think in this case is not the 'unhealthy' variety. As
John noted, without it you would have to write nested case statements
which is cumbersome and may lead to suboptimal code i.e. code
duplication and repeated tests (assuming later stages of your compiler
doesn't rearrange the code). In fact, the entire issue of compilation
of pattern matching arises from the desire to select the appropriate
rhs with the minimum number of tests.
Rough guideline? I use guards whenever I can (which means not at all
these days since SML sadly lacks guards (for a good reason!)), because
I find it easy to read it and I hope that a clever pattern matching
compiler takes advantage of the extra information.
--laszlo
From joe@isun.informatik.uni-leipzig.de Thu Mar 1 10:52:33 2001
From: joe@isun.informatik.uni-leipzig.de (Johannes Waldmann)
Date: Thu, 1 Mar 2001 11:52:33 +0100 (MET)
Subject: Pattern guards vs. case (was, unfortunately :Re: interesting example
of laziness/ghc optimisation)
In-Reply-To: <200103011043.TAA17620@ropas.kaist.ac.kr> from Laszlo Nemeth at
"Mar 1, 2001 07:43:04 pm"
Message-ID: <200103011052.LAA18219@isun11.informatik.uni-leipzig.de>
> But if you want to be really weird you can write something
> like (I haven't typed this in):
>
> f x | (Foo _) == x =
> f x | (Bar _) == x =
no, you can't, e. g. hugs (Feb 2000) says
Prelude> let f x | Just 4 == x = 0 in f (Just 4)
0
Prelude> let f x | Just _ == x = 0 in f (Just 4)
ERROR: Illegal `_' in expression
--
-- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ --
-- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 --
From laszlo@ropas.kaist.ac.kr Thu Mar 1 11:25:28 2001
From: laszlo@ropas.kaist.ac.kr (Laszlo Nemeth)
Date: Thu, 1 Mar 2001 20:25:28 +0900 (KST)
Subject: Pattern guards vs. case (was, unfortunately :Re: interesting example
of laziness/ghc optimisation)
In-Reply-To: <200103011052.LAA18219@isun11.informatik.uni-leipzig.de> (message
from Johannes Waldmann on Thu, 1 Mar 2001 11:52:33 +0100 (MET))
References: <200103011052.LAA18219@isun11.informatik.uni-leipzig.de>
Message-ID: <200103011125.UAA17785@ropas.kaist.ac.kr>
* * * Johannes Waldmann wrote:
> > But if you want to be really weird you can write something
> > like (I haven't typed this in):
> >
> > f x | (Foo _) == x =
> > f x | (Bar _) == x =
>
> no, you can't, e. g. hugs (Feb 2000) says
>
> Prelude> let f x | Just 4 == x = 0 in f (Just 4)
> 0
> Prelude> let f x | Just _ == x = 0 in f (Just 4)
> ERROR: Illegal `_' in expression
So it works with (Just 4), but it doesn't with (Just _)? I can't see
anything in the syntax (Haskell report pg 127, 128) which rules the
second one out. Though, I'd try it with parenthesis. Shall we call it
a bug (unless I am missing something obvious)?
--laszlo
From Christian.Brolin@carmen.se Thu Mar 1 15:41:15 2001
From: Christian.Brolin@carmen.se (Christian Brolin)
Date: Thu, 01 Mar 2001 16:41:15 +0100
Subject: interesting example of lazyness/ghc optimisation
References:
Message-ID: <3A9E6D9B.B7987AE8@carmen.se>
Ketil Malde wrote:
>
> There's something that I've been wanting to ask sombody about, since
> it isn't terribly clear to me. Blatantly hijacking a function from
> Julian's code:
>
> > runRandom last max num
> > | num > 1 = runRandom (fst new) max (num-1)
> > | otherwise = snd new
>
> While ifs are perhaps more intuitive when there are only two choices
> (like here!), and pattern matching matches on the type of arguments
> and not (only) their values,
>
> What's the difference between the pipe-syntax, and a case statement,
> i.e. writing the function as
>
> runRandom last max num = case num of
> 1 -> runRandom ....
> otherwise -> snd new
>
> Is there a practical difference, and if not, why are there two ways to
> skin this particular cat?
You shouldn't compare case expressions with guards. Guards are used
together with patterns, while case expressions are using patterns.
Hence, it is possible to use guards in case expressions. The question is
why *patterns* are allowed with function definitions. I guess the answer
is syntax sugar.
example:
f [a] | a>0 = 1
| a<0 = 2
f _ = 3 -- [], [0], [a:as]
Can be written as:
f x = case x of
[a] | a>0 -> 1
| a<0 -> 2
_ -> 3
--
Christian Brolin
From ger@tzi.de Thu Mar 1 15:58:53 2001
From: ger@tzi.de (George Russell)
Date: Thu, 01 Mar 2001 16:58:53 +0100
Subject: interesting example of lazyness/ghc optimisation
Message-ID: <3A9E71BD.94B53C1C@tzi.de>
I hope nobody actually uses this random number generator. It appears
to be linear congruential with period less than 140000. The author
of these benchmarks seem to have got this algorithm from "Numerical
Recipes", whose code (at least, in the early editions)
has come in for some very heavy criticism:
http://math.jpl.nasa.gov/nr/nr.html
I would take these benchmarks more seriously if "random" implied
a slightly more modern algorithm, like the Mersenne Twister
(which has been implemented in Haskell I believe).
Julian Assange wrote:
> Noticing the use of tuples and normalisation at each step of
> the iteration, I re-wrote this as:
>
> module Main(main) where
> import System(getArgs)
> import Numeric(showFFloat)
>
> main = do
> ~[n] <- getArgs
> putStrLn (showFFloat (Just 12) (random 42 (read n::Int) 100.0) "")
> return 1
>
> random :: Int -> Int -> Double -> Double
> random seed n max = norm (rand n seed) max
> where norm x max = (fromIntegral x) * (max / imd)
> rand n x = if n > 0 then rand (n-1) ((x * ia + ic) `mod` im) else x
> im = 139968
> imd = fromIntegral im
> ia = 3877
> ic = 29573
From ralf@informatik.uni-bonn.de Thu Mar 1 09:31:20 2001
From: ralf@informatik.uni-bonn.de (Ralf Hinze)
Date: Thu, 01 Mar 2001 10:31:20 +0100
Subject: 2001 Haskell Workshop: 1st call for papers
Message-ID: <3A9E16E8.B696DEAD@informatik.uni-bonn.de>
============================================================================
FIRST CALL FOR PAPERS
[Deadline for submission: 1st June 2001]
2001 Haskell Workshop
Firenze, Italy, 2nd September 2001
The Haskell Workshop forms part of the PLI 2001 colloquium
on Principles, Logics, and Implementations of high-level
programming languages, which comprises the ICFP/PPDP conferences
and associated workshops. Previous Haskell Workshops have been
held in La Jolla (1995), Amsterdam (1997), Paris (1999), and
Montreal (2000).
http://www.cs.uu.nl/people/ralf/hw2001.{html,pdf,ps,txt}
============================================================================
Scope
-----
The purpose of the Haskell Workshop is to discuss experience with
Haskell, and possible future developments for the language. The scope
of the workshop includes all aspects of the design, semantics, theory,
application, implementation, and teaching of Haskell. Submissions that
discuss limitations of Haskell at present and/or propose new ideas for
future versions of Haskell are particularly encouraged. Adopting an
idea from ICFP 2000, the workshop also solicits two special classes of
submissions, application letters and functional pearls, described
below.
Application Letters
-------------------
An application letter describes experience using Haskell to solve
real-world problems. Such a paper might typically be about six pages,
and may be judged by interest of the application and novel use of
Haskell.
Functional Pearls
-----------------
A functional pearl presents - using Haskell as a vehicle - an idea that
is small, rounded, and glows with its own light. Such a paper might
typically be about six pages, and may be judged by elegance of
development and clarity of expression.
Submission details
------------------
Deadline for submission: 1st June 2001
Notification of acceptance: 1st July 2001
Final submission due: 1st August 2001
Haskell Workshop: 2nd September 2001
Authors should submit papers of at most 12 pages, in postscript format,
formatted for A4 paper, to Ralf Hinze (ralf@cs.uu.nl) by 1st June
2001. The use of the ENTCS style files is strongly recommended.
Application letters and functional pearls should be labeled as such on
the first page. They may be any length up to twelve pages, though
shorter submissions are welcome. The accepted papers will be published
as a University of Utrecht technical report.
Programme committee
-------------------
Manuel Chakravarty University of New South Wales
Jeremy Gibbons University of Oxford
Ralf Hinze (chair) University of Utrecht
Patrik Jansson Chalmers University
Mark Jones Oregon Graduate Institute
Ross Paterson City University, London
Simon Peyton Jones Microsoft Research
Stephanie Weirich Cornell University
============================================================================
From slucas@dsic.upv.es Fri Mar 2 10:13:45 2001
From: slucas@dsic.upv.es (Salvador Lucas Alba)
Date: Fri, 02 Mar 2001 11:13:45 +0100
Subject: WRS'2001 - Extended deadline
Message-ID: <3A9F7258.AB3BC9D9@dsic.upv.es>
[Apologies for multiple copies of this announcement]
**************************************************************************
******* Last call for papers - extended deadline: March 12, 2001 *******
**************************************************************************
International Workshop on Reduction Strategies in Rewriting and
Programming (WRS 2001)
held in conjunction with RTA 2001
Utrecht, The Netherlands, May 26, 2001
--------------------------------------------------------------------------
BACKGROUND AND AIMS
Reduction strategies in rewriting and programming have attracted an
increasing attention within the last years. New types of reduction
strategies have been invented and investigated, and new results on
rewriting / computation under particular strategies have
been obtained. Research in this field ranges from primarily theoretical
questions about reduction strategies to very practical application and
implementation issues. The need for a deeper understanding of reduction
strategies in rewriting and programming, both in theory and practice,
is obvious, since they bridge the gap between unrestricted general
rewriting (computation) and (more deterministic) rewriting with
particular strategies (programming). Moreover, reduction strategies
provide a natural way to go from operational principles (e.g., graph
and term rewriting, narrowing, lambda-calculus) and semantics (e.g.,
normalization, computation of values, infinitary normalization,
head-normalization) to implementations of programming languages.
Therefore any progress in this area is likely to be of interest not
only to the rewriting community, but also to neighbouring fields like
functional programming, functional-logic programming, and termination
proofs of algorithms.
The workshop wants to provide a forum for the presentation and
discussion of new ideas and results, recent developments, new research
directions, as well as of surveys on existing knowledge in this
area. Furthermore we aim at fostering interaction and exchange between
researchers and students actively working on such topics.
The workshop will be held in conjunction with RTA 2001 in Utrecht (The
Netherlands) on May 26, 2001. It will feature 2 invited talks, a panel
discussion, and contributed presentations selected from the
submissions, with ample time for discussion.
The workshop is (co-)organized by U Utrecht, TU Valencia and TU Wien.
TOPICS OF INTEREST
Topics of interest include, but are not restricted to,
- theoretical foundations for the definition and semantic description
of reduction strategies
- strategies in different frameworks (term rewriting, graph rewriting,
infinitary rewriting, lambda calculi, higher order rewriting,
conditional rewriting, rewriting with built-ins, narrowing,
constraint solving, etc.) and their application in (equational,
functional, functional-logic) programming (languages)
- properties of reduction strategies / computations under
strategies (e.g., completeness, computability, decidability,
complexity, optimality, (hyper-)normalization, cofinality,
fairness, perpetuality, context-freeness, neededness, laziness,
eagerness, strictness)
- interrelations, combinations and applications of
reduction under different strategies (e.g., equivalence
conditions for fundamental properties like termination and
confluence, applications in modularity analysis, connections
between strategies of different frameworks, etc.)
- program analysis and other semantics-based optimization techniques
dealing with reduction strategies
- rewrite systems / tools / implementations with flexible /
programmable strategies as essential concept / ingredient
- specification of reduction strategies in (real) languages
- data structures and implementation techniques for reduction
strategies.
SUBMISSIONS
We solicit papers on all aspects of reduction strategies in
rewriting and programming. Submissions should describe unpublished
work, except for survey papers which are explicitly welcome,
too. Submissions should not exceed 10 pages (however, survey papers
may be longer) and be sent in postscript format to the PC co-chairs
(wrs01@logic.at) by March 12, 2001. Selection of papers by the PC
will be based on originality, significance, and correctness.
Accepted papers will be included in the workshop proceedings that will
be available at the workshop, and electronically on the web.
Depending on the number and quality of submissions, formal publication
of the proceedings is envisaged.
Researchers just interested in attending the workshop may send a
corresponding email to wrs01@logic.at by March 12, 2001, preferably
together with a brief position paper (up to two pages in postscript)
describing their interest and/or work in the area. However, we will
also consider late requests for attendance.
INVITED TALKS
Sergio Antoy (U Portland State):
Evaluation Strategies for Functional Logic Programming
Eelco Visser (U Utrecht, The Netherlands):
A Survey of Strategies in Program Transformation Systems
PANEL DISCUSSION on ``Hot Topics in Reduction Strategies'' with
Michael Hanus U Kiel (Germany)
Tetsuo Ida U Tsukuba (Japan)
Paul Klint CWI & U Amsterdam (The Netherlands)
PROGRAM COMMITTEE
Maria Alpuente TU Valencia (Spain)
Rachid Echahed IMAG Grenoble (France)
Bernhard Gramlich (co-chair) TU Wien (Austria)
Salvador Lucas (co-chair) TU Valencia (Spain)
Vincent van Oostrom U Utrecht (The Netherlands)
Rinus Plasmeijer KU Nijmegen (The Netherlands)
Manfred Schmidt-Schauss U Frankfurt a.M. (Germany)
Yoshihito Toyama U Tohoku (Japan)
LOCAL ORGANIZATION
Vincent van Oostrom U Utrecht (The Netherlands)
IMPORTANT DATES
Submission March 12, 2001 (extended deadline)
Notification March 31, 2001
Final version April 30, 2001
Workshop May 26, 2001
FURTHER INFORMATION
workshop website http://www.logic.at/wrs01/
workshop email address wrs01@logic.at
**************************************************************************
From doaitse@cs.uu.nl Thu Mar 1 11:25:33 2001
From: doaitse@cs.uu.nl (S. Doaitse Swierstra)
Date: Thu, 1 Mar 2001 12:25:33 +0100
Subject: strictness question
Message-ID:
I ran into a difference between GHC and Hugs. The following code:
f (P p) ~(P q) = P (\ k -> \inp -> let (((pv, (qv, r)), m), st) =
p (q k) inp
in (((pv qv , r ), m), st))
runs fine with Hugs but blows up with GHC, whereas:
f (P p) ~(P q) = P (\ k -> \inp -> let ~(~(~(pv, ~(qv, r)), m),
st) = p (q k) inp
in (((pv qv , r ), m), st))
runs fine with GHC too.
From the Haskell manual I understand that pattern matching in "let"'s
should be done lazily, so the addition of a collection of ~'s should
not make a difference. Am I right with this interpretation?
A possible source of this problem may be origination from the smarter
GHC optimiser, but in that case the optimiser is not doing its work
well.
Doaitse Swierstra
--
__________________________________________________________________________
S. Doaitse Swierstra, Department of Computer Science, Utrecht University
P.O.Box 80.089, 3508 TB UTRECHT, the Netherlands
Mail: mailto:doaitse@cs.uu.nl
WWW: http://www.cs.uu.nl/
PGP Public Key: http://www.cs.uu.nl/people/doaitse/
tel: +31 (30) 253 3962, fax: +31 (30) 2513791
__________________________________________________________________________
From qrczak@knm.org.pl Fri Mar 2 18:58:16 2001
From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk)
Date: 2 Mar 2001 18:58:16 GMT
Subject: strictness question
References:
Message-ID:
Thu, 1 Mar 2001 12:25:33 +0100, S. Doaitse Swierstra pisze:
> From the Haskell manual I understand that pattern matching in "let"'s
> should be done lazily, so the addition of a collection of ~'s should
> not make a difference.
Toplevel ~ in let doesn't change anything. But nested ~'s do make
a difference. When a variable of a pattern is evaluated, the whole
pattern is matched. When you protect a subpattern by ~ deferring its
matching and a variable from the subpattern is evaluated, again the
whole subpattern is matched, unless its subsubpatterns are protected
with their own ~'s etc.
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK
From qrczak@knm.org.pl Fri Mar 2 19:00:17 2001
From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk)
Date: 2 Mar 2001 19:00:17 GMT
Subject: Pattern guards vs. case (was, unfortunately :Re: interesting example of laziness/ghc optimisation)
References: <200103011052.LAA18219@isun11.informatik.uni-leipzig.de> <200103011125.UAA17785@ropas.kaist.ac.kr>
Message-ID:
Thu, 1 Mar 2001 20:25:28 +0900 (KST), Laszlo Nemeth pisze:
> > Prelude> let f x | Just _ == x = 0 in f (Just 4)
> > ERROR: Illegal `_' in expression
>
> So it works with (Just 4), but it doesn't with (Just _)?
'Just _ == x' must be an exppression. '_' is a pattern but not an
expression.
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK
From doaitse@cs.uu.nl Fri Mar 2 20:08:45 2001
From: doaitse@cs.uu.nl (S. Doaitse Swierstra)
Date: Fri, 2 Mar 2001 21:08:45 +0100
Subject: strictness question
In-Reply-To: <37DA476A2BC9F64C95379BF66BA2690260D8EC@red-msg-09.redmond.corp.microsoft.
com>
References: <37DA476A2BC9F64C95379BF66BA2690260D8EC@red-msg-09.redmond.corp.microsoft.
com>
Message-ID:
Thanks for the prompt reply. Hugs apparently is more lazy and
performs all the matching lazily, and that really makes a difference
in my case.
Doaitse
At 8:11 AM -0800 3/2/01, Simon Peyton-Jones wrote:
>Strange. You don't supply a complete program, so it's hard to
>test.
>
>Nevertheless, the Haskell Report (Sect 3.12) specifies that
>a let adds a single twiddle. Thus
>
> let (x, (y,z)) = e in b
>
>means
>
> let x = case e of (x,(y,z)) -> x
> y = case e of (x,(y,z)) -> y
> z = case e of (x,(y,z)) -> z
> in b
>
>And that is what GHC implements. You get something different if you
>add twiddles inside:
>
> let (x, ~(y,z)) = e in b
>
>means
> let x = case e of (x,_) -> x
> y = case e of (_,(y,_)) -> y
> etc
>
>Adding more twiddles means less eager matching. I don't know whether
>Hugs implements this.
>
>Simon
>
>| -----Original Message-----
>| From: S. Doaitse Swierstra [mailto:doaitse@cs.uu.nl]
>| Sent: 01 March 2001 11:26
>| To: haskell@haskell.org
>| Subject: strictness question
>|
>|
>| I ran into a difference between GHC and Hugs. The following code:
>|
>| f (P p) ~(P q) = P (\ k -> \inp -> let (((pv, (qv, r)), m), st) =
>| p (q k) inp
>| in (((pv qv , r ), m), st))
>|
>| runs fine with Hugs but blows up with GHC, whereas:
>|
>| f (P p) ~(P q) = P (\ k -> \inp -> let ~(~(~(pv, ~(qv, r)), m),
>| st) = p (q k) inp
>| in (((pv qv , r ), m), st))
>|
>| runs fine with GHC too.
>|
>| From the Haskell manual I understand that pattern matching
>| in "let"'s
>| should be done lazily, so the addition of a collection of ~'s should
>| not make a difference. Am I right with this interpretation?
>|
>| A possible source of this problem may be origination from the smarter
>| GHC optimiser, but in that case the optimiser is not doing its work
>| well.
>|
>| Doaitse Swierstra
>|
>|
>|
>|
>| --
>| ______________________________________________________________
>| ____________
>| S. Doaitse Swierstra, Department of Computer Science, Utrecht
>| University
>| P.O.Box 80.089, 3508 TB UTRECHT, the
>| Netherlands
>| Mail: mailto:doaitse@cs.uu.nl
>| WWW: http://www.cs.uu.nl/
>| PGP Public Key:
>http://www.cs.uu.nl/people/doaitse/
> tel: +31 (30) 253 3962, fax: +31 (30) 2513791
>__________________________________________________________________________
>
>_______________________________________________
>Haskell mailing list
>Haskell@haskell.org
>http://www.haskell.org/mailman/listinfo/haskell
--
__________________________________________________________________________
S. Doaitse Swierstra, Department of Computer Science, Utrecht University
P.O.Box 80.089, 3508 TB UTRECHT, the Netherlands
Mail: mailto:doaitse@cs.uu.nl
WWW: http://www.cs.uu.nl/
PGP Public Key: http://www.cs.uu.nl/people/doaitse/
tel: +31 (30) 253 3962, fax: +31 (30) 2513791
__________________________________________________________________________
From dpt@math.harvard.edu Fri Mar 2 20:27:03 2001
From: dpt@math.harvard.edu (Dylan Thurston)
Date: Fri, 2 Mar 2001 15:27:03 -0500
Subject: strictness question
In-Reply-To: ; from qrczak@knm.org.pl on Fri, Mar 02, 2001 at 06:58:16PM +0000
References:
Message-ID: <20010302152703.A15504@math.harvard.edu>
On Fri, Mar 02, 2001 at 06:58:16PM +0000, Marcin 'Qrczak' Kowalczyk wrote:
> Toplevel ~ in let doesn't change anything. But nested ~'s do make
> a difference. When a variable of a pattern is evaluated, the whole
> pattern is matched. When you protect a subpattern by ~ deferring its
> matching and a variable from the subpattern is evaluated, again the
> whole subpattern is matched, unless its subsubpatterns are protected
> with their own ~'s etc.
Is the behaviour of Hugs incorrect in this case?
Best,
Dylan Thurston
From dduggan@cs.stevens-tech.edu Fri Mar 2 21:55:10 2001
From: dduggan@cs.stevens-tech.edu (Dominic Duggan)
Date: Fri, 02 Mar 2001 16:55:10 -0500
Subject: question re hugs and func dependencies
Message-ID: <3AA016BE.DFA4C85D@cs.stevens-tech.edu>
This is a multi-part message in MIME format.
--------------330C6A4F811AE17438D91FD6
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Dear all, I haven't got a reply from hugs-bugs,
so I'll see if anyone here can answer the question.
class foo a b | a |-> b where foo :: a -> b -> Int
instance foo Int Float where foo x y = 0
instance foo [a] [b] where foo [x] [y] = foo x y
g x y = (foo [x] y) + (foo [y] x)
It is my conjecture that Hugs terminates on type-checking
g because of a depth bound in the type-checker
(although there is no indication from the type-checker
that this is what is going on).
Can anyone confirm or refute this conjecture?
FWIW this is as part of the related work section
for a paper that has been accepted to JFP:
"Type-Checking Multi-Parameter Type Classes,"
by D. Duggan and J. Ophel.
I'd appreciate cc-ing any replies to me, I'm not
sure that I'm still on this mailing list.
Cheers
--dd
--------------330C6A4F811AE17438D91FD6
Content-Type: text/x-vcard; charset=us-ascii;
name="dduggan.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Dominic Duggan
Content-Disposition: attachment;
filename="dduggan.vcf"
begin:vcard
n:Duggan;Dominic
tel;fax:(201) 216-8249
tel;work:(201) 216-8042
x-mozilla-html:FALSE
url:http://guinness.cs.stevens-tech.edu/~dduggan/index.html
org:Stevens Institute of Technology;Computer Science
version:2.1
email;internet:dduggan@cs.stevens-tech.edu
title:Associate Professor
note:Web page: http://guinness.cs.stevens-tech.edu/~dduggan/index.html
adr;quoted-printable:;;Department of Computer Science=0D=0AStevens Institute of Technology;Hoboken;New Jersey;07030;USA
x-mozilla-cpt:;10656
fn:Dominic Duggan
end:vcard
--------------330C6A4F811AE17438D91FD6--
From volker.wysk@student.uni-tuebingen.de Fri Mar 2 23:34:28 2001
From: volker.wysk@student.uni-tuebingen.de (Volker Wysk)
Date: Sat, 3 Mar 2001 00:34:28 +0100 (CET)
Subject: Announce: Mysql-HS 0.10.0
Message-ID:
MySQL-HS is an interface to the MySQL database. This is a maintaince
release.
Changes:
- Ported to GHC 4.08 and H/Direct 0.17
- Inproved documentation
- General polishment
This version is considered to be stable. If there don't show any bugs, the
next version will be 1.0.0 and probably the conclusive one. (Except for support
of new versions of GHC, H/Direct, MySQL).
The homepage is at
http://www.volker-wysk.de/mysql-hs
From simonpj@microsoft.com Fri Mar 2 16:11:41 2001
From: simonpj@microsoft.com (Simon Peyton-Jones)
Date: Fri, 2 Mar 2001 08:11:41 -0800
Subject: strictness question
Message-ID: <37DA476A2BC9F64C95379BF66BA2690260D8EC@red-msg-09.redmond.corp.microsoft.com>
Strange. You don't supply a complete program, so it's hard to
test.
Nevertheless, the Haskell Report (Sect 3.12) specifies that
a let adds a single twiddle. Thus
let (x, (y,z)) = e in b
means
let x = case e of (x,(y,z)) -> x
y = case e of (x,(y,z)) -> y
z = case e of (x,(y,z)) -> z
in b
And that is what GHC implements. You get something different if you
add twiddles inside:
let (x, ~(y,z)) = e in b
means
let x = case e of (x,_) -> x
y = case e of (_,(y,_)) -> y
etc
Adding more twiddles means less eager matching. I don't know whether
Hugs implements this.
Simon
| -----Original Message-----
| From: S. Doaitse Swierstra [mailto:doaitse@cs.uu.nl]
| Sent: 01 March 2001 11:26
| To: haskell@haskell.org
| Subject: strictness question
|
|
| I ran into a difference between GHC and Hugs. The following code:
|
| f (P p) ~(P q) = P (\ k -> \inp -> let (((pv, (qv, r)), m), st) =
| p (q k) inp
| in (((pv qv , r ), m), st))
|
| runs fine with Hugs but blows up with GHC, whereas:
|
| f (P p) ~(P q) = P (\ k -> \inp -> let ~(~(~(pv, ~(qv, r)), m),
| st) = p (q k) inp
| in (((pv qv , r ), m), st))
|
| runs fine with GHC too.
|
| From the Haskell manual I understand that pattern matching
| in "let"'s
| should be done lazily, so the addition of a collection of ~'s should
| not make a difference. Am I right with this interpretation?
|
| A possible source of this problem may be origination from the smarter
| GHC optimiser, but in that case the optimiser is not doing its work
| well.
|
| Doaitse Swierstra
|
|
|
|
| --
| ______________________________________________________________
| ____________
| S. Doaitse Swierstra, Department of Computer Science, Utrecht
| University
| P.O.Box 80.089, 3508 TB UTRECHT, the
| Netherlands
| Mail: mailto:doaitse@cs.uu.nl
| WWW: http://www.cs.uu.nl/
| PGP Public Key:
http://www.cs.uu.nl/people/doaitse/
tel: +31 (30) 253 3962, fax: +31 (30) 2513791
__________________________________________________________________________
_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell
From ashley@semantic.org Sat Mar 3 01:36:15 2001
From: ashley@semantic.org (Ashley Yakeley)
Date: Fri, 2 Mar 2001 17:36:15 -0800
Subject: Extensible Algebraic Data Types
Message-ID: <200103030136.RAA24813@mail4.halcyon.com>
I think it would be useful to extend Haskell so that one could create
algebraic data types in one module that could be union-extended in
another. Something like this:
data Thing = CharThing Char | IntThing Int | _
...later...
data Thing |= StringThing String
This would be useful for two reasons:
1. You could do something akin to dynamic typing without unreasonably
stressing the ideas behind the Haskell type system:
data BaseExtension = _
data Base = MkBase (Char,Int,BaseExtension)
...later...
data Derived = MkDerived (Char,Int,Int,Int)
data BaseExtension |= MkDerivedExtension (Int,Int)
upcast :: Derived -> Base
upcast (MkDerived (a,b,c,d)) = MkBase (a,b,MkDerivedExtension(c,d))
downcast :: Base -> Maybe Derived
downcast MkBase (a,b,MkDerivedExtension(c,d)) = Just (MkDerived (a,b,c,d))
downcast MkBase (a,b,_) = Nothing
2. You'd have a way of autogenerating values similar to LISP's gensym:
data Token = _ deriving Eq
...later...
data Token |= ThisToken
data Token |= ThatToken
data Token |= BunchOfTokens Int
Of course this extension to Haskell begs another, virtual or generic
functions. I'm not sure how to do this properly while maintaining the
principle that an expression has the same value regardless of other
modules loaded.
data Thing = CharThing Char | IntThing Int | _
f1 :: Thing -> Int
f1 (CharThing c) = ord c
f1 (IntThing i) = i
-- somehow allow cases to be inserted later here
f1 _ = 0
-- multiple dispatch
f2 :: Thing -> Thing -> Int
f2 (IntThing i) (IntThing j) = i + j
-- might want cases inserted here,
-- provided they don't cause trouble
f2 (IntThing i) _ = i
-- or here
f2 _ (IntThing i) = i + 1
-- or here
f2 _ _ = 0
Are these ideas something worth thinking about? Or would such extensions
compromise important principles behind Haskell?
--
Ashley Yakeley, Seattle WA
From shlomif@vipe.technion.ac.il Sun Mar 4 15:48:35 2001
From: shlomif@vipe.technion.ac.il (Shlomi Fish)
Date: Sun, 4 Mar 2001 17:48:35 +0200 (IST)
Subject: Circular Data Types - a directory tree abstraction
Message-ID:
I want to implement a directory data type where each directory may contain
other directories, as well as end documents. I declared the following
file for managing it:
------------------------------
module Contents_Abs where
data Contents_Image url mime = MakeContents_Image url mime
get_image_url (MakeContents_Image url mime) = url
get_image_mime_type (MakeContents_Image url mime) = mime
make_image url mime = (MakeContents_Image url mime)
data Contents_Node url title subs images is_dir =
MakeContents_Node url title subs images is_dir
get_url (MakeContents_Node url title subs images is_dir) = url
get_title (MakeContents_Node url title subs images is_dir) = title
get_subs (MakeContents_Node url title subs images is_dir) = subs
get_is_dir (MakeContents_Node url title subs images is_dir) = is_dir
make_contents_doc url title = (MakeContents_Node url title [] [] False)
make_contents_dir url title subs = (MakeContents_Node url title subs []
True)
make_contents_dir_with_images url title subs images = (MakeContents_Node
url title subs images True)
--------------------------------------------
Now, I have the following example file:
--------------------------------------------
module Contents where
import Contents_Abs
contents = (make_contents_dir_with_images "" "Contents"
[
(make_contents_doc "intro.html" "Introduction"),
(make_contents_doc "properties.html" "Properties"),
(make_contents_dir "recursion" "Recursion"
[
(make_contents_doc "fib1.html" "Fibonnaci (Take 1)"),
(make_contents_doc "qsort.html" "Quick Sort")
]
),
(make_contents_dir "lazy_eval" "Lazy Evaluation"
[
(make_contents_doc "primes1.html" "Primes (Take 1)"),
(make_contents_doc "fib2.html" "Fibonnaci (Take 2)")
]
)
]
[
(make_image "style.css" "text/css")
]
)
-------------------------------------------
I would like to be able to traverse this tree, so I defined the following
script:
---------------------
import Contents_Abs
import Contents
mytraverse contents = trav contents where
trav branch =
(get_url branch) ++ (trav_subs (get_subs branch)) where
trav_subs [] = ""
trav_subs (a:as) = (trav a) ++ (trav_subs as)
result = mytraverse contents
-----------------------
However, when trying to load it hugs reports the following error:
Reading file "Z:\Download\unpack\hugs98\lib\Prelude.hs":
Reading file "print_cont.hs":
Reading file "Contents_Abs.hs":
Reading file "Contents.hs":
Reading file "print_cont.hs":
Type checking
ERROR "print_cont.hs" (line 5): Type error in function binding
*** Term : trav
*** Type : Contents_Node [Char] b [a] c d -> [Char]
*** Does not match : a -> [Char]
*** Because : unification would give infinite type
Contents>
I would like to know how I can define a data structure that will contain a
list of references to its own types (I don't need circular data
structures). I would also like to know how I can define such an
abstraction inside a type.
Regards,
Shlomi Fish
----------------------------------------------------------------------
Shlomi Fish shlomif@vipe.technion.ac.il
Home Page: http://t2.technion.ac.il/~shlomif/
Home E-mail: shlomif@techie.com
The prefix "God Said" has the extraordinary logical property of
converting any statement that follows it into a true one.
From tom-list-haskell@moertel.com Sun Mar 4 19:28:26 2001
From: tom-list-haskell@moertel.com (Tom Moertel)
Date: Sun, 04 Mar 2001 14:28:26 -0500
Subject: Circular Data Types - a directory tree abstraction
References:
Message-ID: <3AA2975A.D1D8A839@moertel.com>
Shlomi Fish wrote:
>
> I would like to know how I can define a data structure that will contain a
> list of references to its own types (I don't need circular data
> structures). I would also like to know how I can define such an
> abstraction inside a type.
Here's one way that uses Haskell's Either type to differentiate between
directory entries that represent documents and those the represent
directories.
module URITree
where
-- some type synonynms to make things easier to remember
type URI = String
type MimeType = String
type Title = String
-- here is the type the represents a directory entry
newtype DirectoryEntry = DE (URI, Title, (Either [DirectoryEntry] {- Directory -}
MimeType)) {- Document -}
deriving (Show, Read, Eq)
-- a few helper functions to create entries
mkDirectory :: URI -> Title -> [DirectoryEntry] -> DirectoryEntry
mkDirectory uri title subs = DE (uri, title, (Left subs))
mkDocument :: URI -> Title -> MimeType -> DirectoryEntry
mkDocument uri title mtype = DE (uri, title, (Right mtype))
mkHTMLDocument :: URI -> Title -> DirectoryEntry
mkHTMLDocument uri title = DE (uri, title, (Right "text/html"))
-- here is a sample directory entry for a small hierarchy of documents
contents = mkDirectory "" "Contents" $
[ mkHTMLDocument "intro.html" "Introduction"
, mkHTMLDocument "properties.html" "Properties"
, mkDirectory "recursion/" "Recursion" $
[ mkHTMLDocument "fib1.html" "Fibonnaci (Take 1)"
, mkHTMLDocument "qsort.html" "Quick Sort"
]
, mkDirectory "lazy_eval/" "Lazy Evaluation" $
[ mkHTMLDocument "primes1.html" "Primes (Take 1)"
, mkHTMLDocument "fib2.html" "Fibonnaci (Take 2)"
]
, mkDocument "style.css" "Style sheet" "text/css"
]
-- traverse a directory entry, generating an indented set of titles
-- that represents its contents
traverse :: DirectoryEntry -> String
traverse d = tr 0 d
where tr n (DE (uri,title,ent)) = (indent n)++title++"\n"++(content (n+1) ent)
content n (Left subs) = foldr (++) "" (map (tr n) subs)
content n (Right _) = ""
indent n = foldr (++) "" (replicate n " ")
Hugs98 session using the above:
> :load uri-tree.hs
Reading file "uri-tree.hs":
Hugs session for:
C:\hugs98\lib\Prelude.hs
uri-tree.hs
URITree> putStr (traverse contents)
Contents
Introduction
Properties
Recursion
Fibonnaci (Take 1)
Quick Sort
Lazy Evaluation
Primes (Take 1)
Fibonnaci (Take 2)
Style sheet
From simonpj@microsoft.com Mon Mar 5 08:42:59 2001
From: simonpj@microsoft.com (Simon Peyton-Jones)
Date: Mon, 5 Mar 2001 00:42:59 -0800
Subject: question re hugs and func dependencies
Message-ID: <37DA476A2BC9F64C95379BF66BA2690260DBCB@red-msg-09.redmond.corp.microsoft.com>
I replied last week:
-----Original Message-----
From: Simon Peyton-Jones
Sent: 28 February 2001 16:51
To: 'Dominic Duggan'; hugs-bugs@haskell.org
Subject: RE: please confirm that this is a feature
GHC infers the type
g :: (Foo [[a]] [b], Foo [[b]] [a]) => [a] -> [b] -> Int
As you imply, if GHC used the instance decl to simplify
the first constraint to Foo [a] b, for example, then the functional
dependency would kick in, and there would be an infinite loop.
But GHC's constraint simplification is (now) lazy, unless forced
to be eager by supplying a type signature.
I think Hugs is the same, and I think that's probably why it
terminates.
Interesting example!
Simon
| -----Original Message-----
| From: Dominic Duggan [mailto:dduggan@cs.stevens-tech.edu]
| Sent: 02 March 2001 21:55
| To: haskell@haskell.org
| Subject: question re hugs and func dependencies
|
|
| Dear all, I haven't got a reply from hugs-bugs,
| so I'll see if anyone here can answer the question.
|
| class foo a b | a |-> b where foo :: a -> b -> Int
| instance foo Int Float where foo x y = 0
| instance foo [a] [b] where foo [x] [y] = foo x y
| g x y = (foo [x] y) + (foo [y] x)
|
| It is my conjecture that Hugs terminates on type-checking
| g because of a depth bound in the type-checker
| (although there is no indication from the type-checker
| that this is what is going on).
|
| Can anyone confirm or refute this conjecture?
|
| FWIW this is as part of the related work section
| for a paper that has been accepted to JFP:
| "Type-Checking Multi-Parameter Type Classes,"
| by D. Duggan and J. Ophel.
|
| I'd appreciate cc-ing any replies to me, I'm not
| sure that I'm still on this mailing list.
|
| Cheers
| --dd
|
From pugliese@dsi.unifi.it Mon Mar 5 08:12:48 2001
From: pugliese@dsi.unifi.it (Rosario Pugliese)
Date: Mon, 05 Mar 2001 09:12:48 +0100
Subject: PLI 2001: submission deadline is approaching
Message-ID: <3AA34A80.D2607D09@dsi.unifi.it>
[Apologies for multiple copies]
----------------------------------------------------------------
PLI 2001
Principles, Logics, and Implementations
of high-level programming languages
(Sponsored by ACM)
Firenze, ITALY September 2 - 8, 2001
http://music.dsi.unifi.it/pli01/
The colloquium on Principles, Logics, and Implementations of high-
level programming languages is a collection of conferences and
workshops aimed at the advancement of high-level programming
languages. The events composing PLI will cover a spectrum of
topics important to language development and use, including issues
such as semantics, design, analysis, implementation, and
application. Theoretical issues relevant to language design and
programming will be represented. Implementation questions will
provide an emphasis on compilation methods, distributed
computation and static debugging techniques. There will also be a
focus on industrial and educational applications.
Conferences:
ICFP (September 3-5)
Int. Conf. on Functional Programming
General chair: Benjamin Pierce (Univ. Pennsylvania)
Program chair: Xavier Leroy (INRIA Rocquencourt)
PPDP (September 5-7)
Int. Conf. on Principles and Practice of Declarative
Programming
Conference chair: Rocco De Nicola (Univ. Firenze)
Program chair: Harald Sřndergaard (Univ. Melbourne)
Workshops:
· Multilanguage Infrastructure and Interoperability (BABEL)
· ERLANG Workshop
· Fixed Points in Computer Science (FICS)
· HASKELL Workshop
· Quantitative Aspects of Programming Languages (QAPL)
· Rule-Based Programming (RULE)
· Semantics, Applications, and Implementation of Program
Generation (SAIG)
· Scheme and Functional Programming (SCHEME)
· Verification and Computational Logic (VCL)
Submission deadline for ICFP and PPDP: March 15, 2001
Workshops chair: Betti Venneri (Univ. Firenze)
Publicity chair: Rosario Pugliese (Univ. Firenze)
Organizing Committee: Gianni Aguzzi (Univ. Firenze, co-chair),
Giorgio Ghelli (Univ. Pisa, co-chair), Lorenzo Bettini (Univ.
Firenze), Michele Loreti (Univ. Firenze), Dario Colazzo (Univ.
Pisa)
Contact Information: pli-inf@gdn.dsi.unifi.it
Conference Venue:
Auditorium Banca Toscana, Via Panciatichi, 87 (Firenze Nova),
Firenze, ITALY
From dduggan@cs.stevens-tech.edu Mon Mar 5 14:00:51 2001
From: dduggan@cs.stevens-tech.edu (Dominic Duggan)
Date: Mon, 5 Mar 2001 09:00:51 -0500 (EST)
Subject: question re hugs and func dependencies
In-Reply-To: <37DA476A2BC9F64C95379BF66BA2690260DBCB@red-msg-09.redmond.corp.microsoft.com>
"from Simon Peyton-Jones at Mar 5, 2001 00:42:59 am"
Message-ID: <200103051400.JAA1772138@guinness.cs.stevens-tech.edu>
Simon thanks I'm afraid I didn't see your earlier reply.
I didn't try this in GHC, thanks for the clarification.
Hugs on the other hand does give a type:
g :: (Foo [[[[a]]]] [[[[b]]]], Foo [[[[[b]]]]] [[[a]]]) => [[[[b]]]] -> [[[a]]] -> Int
My assumption is that this is because of a depth bound check.
As an editorial aside, it seems to me that the GHC approach
of lazy context reduction introduces the same problems that
functional dependencies were supposed to solve. The type of
g with unresolved constraints hides a type error, and this
is part of the motivation for FD given by Mark Jones in his web note.
It seems to me that an approach of "I don't know" would be
more useful, but I cc to the haskell list in case others have
opinions.
Cheers
--dd
From simonpj@microsoft.com Mon Mar 5 17:48:12 2001
From: simonpj@microsoft.com (Simon Peyton-Jones)
Date: Mon, 5 Mar 2001 09:48:12 -0800
Subject: Rewrite rules
Message-ID: <37DA476A2BC9F64C95379BF66BA2690260DBE2@red-msg-09.redmond.corp.microsoft.com>
Folks
Andrew Tolmach, Tony Hoare, and I are writing a paper about
rewrite rules in GHC -- the {-# RULES #-} stuff.
We'd like to report on practical experience of using rewrite rules.
Has anyone use them in practice? What's your experience?
Pls reply to me, to avoid clogging the list with your cries of rapture.
Simon
From qrczak@knm.org.pl Mon Mar 5 21:12:30 2001
From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk)
Date: 5 Mar 2001 21:12:30 GMT
Subject: Disjoint type classes
References: <001601b205b3$20bd81c0$5d1f239c@ccu.uniovi.es>
Message-ID:
Thu, 18 Feb 1988 08:17:58 +0100, Jose Emilio Labra Gayo pisze:
> Which doesn't work because Haskell doesn't detect that
> "Integral" and "Fractional" are disjoint.
And indeed there is no disjointness concept in the language.
Nothing prevents from making a type an instance of both.
> Is there a way to implement these type classes with current Haskell
> implementations?
I'm afraid not. In the standard way you must decide for each type
separately. At most you could use ghc with -fallow-overlapping-instances
-fallow-undecidable-instances, which would allow to define one of your
instances - the other would have to be defined for each type separately;
but these options are not nice.
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK
From cwitty@newtonlabs.com Mon Mar 5 22:22:45 2001
From: cwitty@newtonlabs.com (Carl R. Witty)
Date: 05 Mar 2001 14:22:45 -0800
Subject: Extensible Algebraic Data Types
In-Reply-To: Ashley Yakeley's message of "Fri, 2 Mar 2001 17:36:15 -0800"
References: <200103030136.RAA24813@mail4.halcyon.com>
Message-ID:
Ashley Yakeley writes:
> I think it would be useful to extend Haskell so that one could create
> algebraic data types in one module that could be union-extended in
> another. Something like this:
>
> data Thing = CharThing Char | IntThing Int | _
>
> ...later...
>
> data Thing |= StringThing String
You might be able to use the Gaster and Jones extensible variants from
"A Polymorphic Type System for Extensible Records and Variants"
(http://www.cse.ogi.edu/~mpj/pubs/polyrec.html). As far as I know,
the extensible variants described in this paper have never been
implemented (although the extensible records are implemented in Hugs).
I've often thought that extensible variants would be at least as
useful, if not more useful, than extensible records.
Carl Witty
From miketh@brisbane.paradigmgeo.com Tue Mar 6 07:40:26 2001
From: miketh@brisbane.paradigmgeo.com (Mike Thomas)
Date: Tue, 6 Mar 2001 17:40:26 +1000
Subject: GHC - Cygwin Installation and also DirectX
Message-ID: <007701c0a610$c15cdcf0$0cb4a8c0@brisbane.paradigmgeo.com>
Hi all.
I'm having ghc import path problems on NT:
----------------------------------------------------------------------------
------------------------------
$ ghc -i//c/ghc/ghc-4.08.2/lib/imports/win32 hello.lhs
Import path element `/cygdrive/c/ghc/ghc-4.08.2/lib/imports/win32' does not
exist, ignor
ing.
hello.lhs:14:
Could not find interface file for `Win32'
in the directories /cygdrive/c/ghc/ghc-4.08.2/lib/imports/win32/*.hi
./*.hi
C:/ghc/ghc-4.08.2/lib/imports/std/*.hi
hello.lhs:15:
Could not find interface file for `Addr'
in the directories /cygdrive/c/ghc/ghc-4.08.2/lib/imports/win32/*.hi
./*.hi
C:/ghc/ghc-4.08.2/lib/imports/std/*.hi
Compilation had errors
----------------------------------------------------------------------------
------------------------------
The Win32 installation instructions say that one should execute "mount -f C:
/", but having done that in response to this error it does not fix the
problem and it stops bash from starting up correctly (Cygwin is installed in
c:\cygwin and GHC in c:\ghc\ghc-4.08.2). (Why am I supposed to do this
mount?)
Has anyone got a solution?
Furthermore, is anyone using Direct X especially Direct Play and Draw with
GHC?
Cheers
Mike Thomas.
From rrt1001@cam.ac.uk Tue Mar 6 11:09:39 2001
From: rrt1001@cam.ac.uk (Reuben Thomas)
Date: Tue, 6 Mar 2001 11:09:39 +0000 (GMT)
Subject: GHC - Cygwin Installation and also DirectX
In-Reply-To: <007701c0a610$c15cdcf0$0cb4a8c0@brisbane.paradigmgeo.com>
Message-ID:
> The Win32 installation instructions say that one should execute "mount -f C:
> /", but having done that in response to this error it does not fix the
> problem and it stops bash from starting up correctly (Cygwin is installed in
> c:\cygwin and GHC in c:\ghc\ghc-4.08.2). (Why am I supposed to do this
> mount?)
It helps because it means that Cygwin's UNIX-style paths (starting from /)
are also valid Windows paths. However, as you've observed, when installing
Cygwin in its default location, it stops other things working, and I've now
retracted that piece of advice. Unfortunately, not mounting C: at / messes
up other things (though more so when building GHC than when merely using
it). Mounting C: at / shouldn't stop bash starting up, though...
> Has anyone got a solution?
There should be some hardwired paths in the driver
(/ghc/ghc-4.08.2/bin/ghc-4.08.2) and possibly other scripts that start with
/cygdrive/c; changing these to C:/ should make things work. If the paths are
being generated somewhere, then running them through cygpath -w will convert
them into Windows format.
I'm working on getting this cleared up in the head, for the upcoming GHC 5.0
release...hopefully Cygwin 1.2 will be out soon, and then things will settle
down somewhat.
--
http://sc3d.org/rrt/ | computation, n. automated pedantry
From iscp9157@nus.edu.sg Wed Mar 7 04:14:32 2001
From: iscp9157@nus.edu.sg (Saswat Anand)
Date: Tue, 6 Mar 2001 20:14:32 -0800
Subject: Can Class do this?
Message-ID: <000c01c0a6bd$55b79be0$aad512ac@iscp9157>
This is a multi-part message in MIME format.
------=_NextPart_000_0009_01C0A67A.0E4074A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I have a problem as follows -
type CF =3D Char -> Float
type IF =3D Integer -> Float
type CIF =3D (Char,Integer) -> Float
There be two functions:
fun :: CF
fun =3D fromInt.ord
sun :: IF
sun =3D fromInteger
I want the followings to be valid.
x :: IF
x =3D sun \+ sun
y :: IF
y =3D sun \+ sun \+ sun -- when only sun is there, type should be =
IF
a :: CF
a =3D fun \+ fun=20
b :: CF
b =3D fun \+ fun \+ fun -- when only fun is there, type should be =
IF
p :: CIF
p =3D sun \+ fun=20
q :: CIF
q =3D sun \+ fun \+ sun - -when sun and fun are mixed type =
should be CIF
I guess this can be done using classes, but I have not been successful =
after trying many variations.
Any help is very much appreciated.
Thanks,
Saswat
------=_NextPart_000_0009_01C0A67A.0E4074A0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I have a problem as follows =
-
type CF =3D Char -> =
Float
type IF =3D Integer -> =
Float
type CIF =3D (Char,Integer) -> =
Float
There be two =
functions:
fun :: CF
fun =3D fromInt.ord
sun :: IF
sun =3D fromInteger
I want the followings to be =
valid.
x :: IF
x =3D sun \+ sun
y :: IF
y =3D sun \+ sun \+=20
sun -- when only sun is there, type =
should=20
be IF
a :: CF
a =3D fun \+ fun
b :: CF
b =3D fun \+ fun \+=20
fun -- when only fun is there, =
type=20
should be IF
p :: CIF
p =3D sun \+ fun
q :: CIF
q =3D sun \+ fun \+=20
sun - -when sun and =
fun are=20
mixed type should be CIF
I guess this can be done using =
classes, but I=20
have not been successful after trying many variations.
Any help is very much =
appreciated.
Thanks,
Saswat
------=_NextPart_000_0009_01C0A67A.0E4074A0--
From mk167280@students.mimuw.edu.pl Tue Mar 6 13:05:23 2001
From: mk167280@students.mimuw.edu.pl (Marcin 'Qrczak' Kowalczyk)
Date: Tue, 6 Mar 2001 14:05:23 +0100 (CET)
Subject: Can Class do this?
In-Reply-To: <000c01c0a6bd$55b79be0$aad512ac@iscp9157>
Message-ID:
On Tue, 6 Mar 2001, Saswat Anand wrote:
> I guess this can be done using classes, but I have not been successful
> after trying many variations.
It requires extensions supported by ghc and Hugs: multiparameter type
classes are required, functional dependencies are recommended.
Functional dependencies don't work well for released ghc versions, but
shoud work in the upcoming ghc-5.0. You might need to remove '| a b -> c'
below and need more explicit type annotations (will not be very
convenient).
class Plus a b c | a b -> c where
(\+) :: a -> b -> c
instance Plus CF CF CF where
f \+ g = ...
instance Plus IF IF IF where
f \+ g = ...
instance Plus CF IF CIF where
f \+ g = ...
instance Plus IF CF CIF where
f \+ g = ...
instance Plus CF CIF CIF where
f \+ g = ...
instance Plus IF CIF CIF where
f \+ g = ...
instance Plus CIF CF CIF where
f \+ g = ...
instance Plus CIF IF CIF where
f \+ g = ...
instance Plus CIF CIF CIF where
f \+ g = ...
--
Marcin 'Qrczak' Kowalczyk
From iscp9157@nus.edu.sg Wed Mar 7 09:00:05 2001
From: iscp9157@nus.edu.sg (Saswat Anand)
Date: Wed, 7 Mar 2001 01:00:05 -0800
Subject: Can Class do this?
Message-ID: <001801c0a6e5$01cfefa0$aad512ac@iscp9157>
This is a multi-part message in MIME format.
------=_NextPart_000_0015_01C0A6A1.F26DC700
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Thanks a lot. It works great with Hugs.=20
But it has a small problem. I also want to be able to write=20
=20
4 \+ fc :: CF
fc \+ 4 :: CF
ic \+ 4 :: IF
4 \+ fc \+ ic :: CIF
Well for that I did this,
instance (Rational a) =3D> Plus a CF CF where --to support 4.0 \+ fc
f \+ g =3D \c -> (realToFrac f) \+ (g c)
I did not do : instance Plus Float CF CF where .. so that I don't have =
to write (4::Float) \+ fc.=20
But it complains because, it violates functional dependency a b -> c. Is =
there any other way to avoid writing (4::Float) in this case.
Well I tried this:
(\+) :: (Lift a c, Lift b c) =3D> a -> b -> (c -> Float)
f \+ g =3D \x -> (lift f) x + (lift f) x
class Lift a b where
lift :: a -> (b -> Float)
instance Lift CF Char where
lift =3D id
instance Lift CF (Char,Integer) where
lift f =3D \(c,i) -> f c
instance Lift IF Integer where
lift =3D id
instance Lift IF (Char,Integer) where
lift f =3D \(c,i) -> f i
instance Lift CIF (Char,Integer) where
lift =3D id
But it does not take following:
x :: CF
x =3D cf \+ cf \+ cf
Cannot justify constraints in explicitly typed binding
*****Expresssion : x
*****Type : CF
*****Given Context : ()
*****Constraints : (Lift (a -> Float) Char, Lift (Char -> FLoat) a)
Thanks,
Saswat
------=_NextPart_000_0015_01C0A6A1.F26DC700
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Thanks a lot. It works great with Hugs. =
But it has a small problem. I also want =
to be able=20
to write
4 \+ fc :: CF
fc \+ 4 :: CF
ic \+ 4 :: IF
4 \+ fc \+ ic :: CIF
Well for that I did this,
instance (Rational a) =3D> Plus a CF =
CF=20
where --to support 4.0 \+ fc
f =
\+ g =3D \c=20
-> (realToFrac f) \+ (g c)
I did not do : instance Plus Float CF CF where .. so that I =
don't have=20
to write (4::Float) =
\+ fc.=20
But it complains because, it violates =
functional=20
dependency a b -> c. Is there any other way to avoid writing =
(4::Float) in=20
this case.
Well I tried this:
(\+) :: (Lift a c, Lift b c) =3D> a =
-> b ->=20
(c -> Float)
f \+ g =3D \x -> (lift f) x + (lift f) =
x
class Lift a b where
lift :: a =
-> (b=20
-> Float)
instance Lift CF Char =
where
lift =3D=20
id
instance Lift CF (Char,Integer) =
where
lift=20
f =3D \(c,i) -> f c
instance Lift IF Integer =
where
lift =3D=20
id
instance Lift IF (Char,Integer) =
where
lift=20
f =3D \(c,i) -> f i
instance Lift CIF (Char,Integer)=20
where
lift =3D id
But it does not take =
following:
x :: CF
x =3D cf \+ cf \+ =
cf
Cannot justify constraints in =
explicitly typed=20
binding
*****Expresssion : x
*****Type : CF
*****Given Context : ()
*****Constraints : (Lift (a -> =
Float) Char, Lift=20
(Char -> FLoat) a)
Thanks,
Saswat
------=_NextPart_000_0015_01C0A6A1.F26DC700--
From qrczak@knm.org.pl Tue Mar 6 17:10:24 2001
From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk)
Date: 6 Mar 2001 17:10:24 GMT
Subject: Can Class do this?
References: <001801c0a6e5$01cfefa0$aad512ac@iscp9157>
Message-ID:
Wed, 7 Mar 2001 01:00:05 -0800, Saswat Anand pisze:
> But it has a small problem. I also want to be able to write
>
> 4 \+ fc :: CF
> fc \+ 4 :: CF
> ic \+ 4 :: IF
> 4 \+ fc \+ ic :: CIF
You can have more fundeps which allow to deduce a type of an argument
from the other argument and the result:
| a b -> c, a c -> b, b c -> a
and make CF and IF instances of Integral (define fromIntegral for them).
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK
From N.Perry@massey.ac.nz Tue Mar 6 19:24:31 2001
From: N.Perry@massey.ac.nz (Nigel Perry)
Date: Wed, 7 Mar 2001 08:24:31 +1300
Subject: GHC - Cygwin Installation and also DirectX
In-Reply-To: <007701c0a610$c15cdcf0$0cb4a8c0@brisbane.paradigmgeo.com>
References: <007701c0a610$c15cdcf0$0cb4a8c0@brisbane.paradigmgeo.com>
Message-ID:
At 5:40 pm +1000 6/3/01 you wrote:
>The Win32 installation instructions say that one should execute "mount -f C:
>/", but having done that in response to this error it does not fix the
>problem and it stops bash from starting up correctly (Cygwin is installed in
>c:\cygwin and GHC in c:\ghc\ghc-4.08.2). (Why am I supposed to do this
>mount?)
From painful experience installing GHC under Win2K I can advise you should
install Cygwin at root level now, contrary to advice in Cygwin. Also make
sure your disks are mounted in binary mode or things go awry. The sed part
of the build process will fail first time around but the build will
continue and
fail later, so build twice (and no I've no idea why sed fails). After that just
the usual amount of salt over the shoulder, frogs leg and bat wing broth, etc.
should get it going. ;-)
Hope that helps.
Nigel
Nigel Perry, New Zealand
From ken@digitas.harvard.edu Tue Mar 6 21:56:28 2001
From: ken@digitas.harvard.edu (Ken Shan)
Date: Tue, 6 Mar 2001 16:56:28 -0500
Subject: Viewing inferred types
Message-ID: <20010306165628.A26183@digitas.harvard.edu>
--Q68bSM7Ycu6FN28Q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Hello all,
When I edit Haskell code in a text editor, I often want to point at an
expression and be told its type. (Even assuming that this feature
only works when the entire file type-checks correctly, it would still
be very useful to me.) For example, in
let c:cs =3D "string" in ...
I would like to point at "c" and be told that
c :: Char
c:cs :: [Char]
I divide this functionality into two parts:
1. Given a Haskell program, produce a list of pairs (span, type),
where "span" is a contiguous region in the source code that parses
as an expression, and "type" is the type of the expression
(possibly universally quantified and/or with context).
2. Make this information easy to generate and view in an editor.
Focusing on part 1, I see two possible approaches:
A. Ask an existing Haskell interpreter/compiler to output the
information. I looked briefly at the implementations listed at
http://www.haskell.org; none of them seems to produce anything
(i.e., any debugging output) from which the necessary information
can be extracted. Therefore, to take this approach, we would need
to modify an implementation. I would be very happy to be
corrected on this observation.
B. Connect a Haskell parser (e.g., hsparser) to a Haskell type
checker (e.g., _Typing Haskell in Haskell_). This is the
preferred approach because the solution would not depend on the
internals of any Haskell implementation. However, the output of
hsparser is neither typed nor desugared for piping into _Typing
Haskell in Haskell_, so some conversion/desugaring work is
required.
I would appreciate any comments, pointers to existing work, or other
help on this project. In particular, how much work would be involved
in approach B above, and has it already been done? Thanks in advance!
--=20
Edit this signature at http://rodimus.digitas.harvard.edu/cgi-bin/ken/sig
Dumpster Clocking: The tendency when looking at objects to guesstimate=20
the amount of time they will take to eventually decompose: "Ski boots are=
=20
the worst. Solid plastic. They'll be around till the sun goes supernova."
--Q68bSM7Ycu6FN28Q
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE6pV0MzjAc4f+uuBURAte/AKD4ulAi86NOK2uGEL4lAiBv/XdYJACguCxO
X4Uct6B7zf2wKVJFTKWD99k=
=ADCU
-----END PGP SIGNATURE-----
--Q68bSM7Ycu6FN28Q--
From bjpop@cs.mu.OZ.AU Wed Mar 7 02:06:44 2001
From: bjpop@cs.mu.OZ.AU (Bernard James POPE)
Date: Wed, 7 Mar 2001 13:06:44 +1100 (EST)
Subject: Viewing inferred types
Message-ID: <200103070206.NAA29941@mundook.cs.mu.OZ.AU>
I think that the ability to view types of subexpressions in programs would
be very useful. Some work has been done in this direction. One example
I know of is Typeview (www-users.cs.york.ac.uk/~olaf/PUBLICATIONS/typeview.html)
The last time I checked it only worked for a small functional language.
> Focusing on part 1, I see two possible approaches:
>
> A. Ask an existing Haskell interpreter/compiler to output the
> information. I looked briefly at the implementations listed at
> http://www.haskell.org; none of them seems to produce anything
> (i.e., any debugging output) from which the necessary information
> can be extracted. Therefore, to take this approach, we would need
> to modify an implementation. I would be very happy to be
> corrected on this observation.
I have looked at pulling types out of various compilers. This can be
tricky for a number of reasons.
ghc provides the -ddump-types flag which
will dump type signatures for all top-level bindings in a module. With some
help from the devlopers I was able to get types for local bindings as well
(lets and wheres). Still, with this information you would need to do some
reconstruction of subexpression types within your typeviewer.
nhc98 provides the option -tbound, which shows the symbol table after type
checking. If I remember correctly I had trouble with the renamer of nhc98.
It seemed hard to reconcile source ids with their renamed counterparts.
> B. Connect a Haskell parser (e.g., hsparser) to a Haskell type
> checker (e.g., _Typing Haskell in Haskell_). This is the
> preferred approach because the solution would not depend on the
> internals of any Haskell implementation. However, the output of
> hsparser is neither typed nor desugared for piping into _Typing
> hsparser is neither typed nor desugared for piping into _Typing
> Haskell in Haskell_, so some conversion/desugaring work is
> required.
I am nearly finished doing precisely this task. Basically I have stuck
hsparser onto the front of thih (with a lot of glue). It only works for
single module programs at the moment, and it runs slowly. The reason I
did this is that I need detailed type information for some other work that
I am doing, and I couldn't easily get what I wanted from the compilers.
It is not currently available for public release, partly because it needs
some polishing, and partly because not all of the code is mine to release
(some of it is Mark Jones'). The intention is to make an alpha release
available soon (next few weeks) with the appropriate permissions granted of
course.
A colleague of mine will be speeding up the code and adding better error
diagnostics, and time permitting, extending the code to multi-modules
(possibly with a hmake style front-end).
If you want more information, or you wish to collaborate on this project
please let me know.
Bernie
From rrt@dcs.gla.ac.uk Wed Mar 7 09:52:08 2001
From: rrt@dcs.gla.ac.uk (Reuben Thomas)
Date: Wed, 7 Mar 2001 09:52:08 +0000 (GMT)
Subject: GHC - Cygwin Installation and also DirectX
In-Reply-To:
Message-ID:
> From painful experience installing GHC under Win2K I can advise you should
> install Cygwin at root level now, contrary to advice in Cygwin. Also make
> sure your disks are mounted in binary mode or things go awry. The sed part
> of the build process will fail first time around but the build will
> continue and
> fail later, so build twice (and no I've no idea why sed fails). After that just
> the usual amount of salt over the shoulder, frogs leg and bat wing broth, etc.
> should get it going. ;-)
Unfortunately, this is all contrary to the advice we currently give: we
advise not to install at the root level, and to mount in text mode. We have
no experience of sed failing.
Of course, you should do whatever works for you, but if you'd like advice
from us, please make sure you've followed our recipe!
(Even more confusing is that our advice has changed recently, and used to be
much more similar to Nigel's...)
--
http://sc3d.org/rrt/ | free, a. already paid for (Peyton Jones)
From Simon Helsen Wed Mar 7 11:43:45 2001
From: Simon Helsen (Simon Helsen)
Date: Wed, 7 Mar 2001 12:43:45 +0100 (CET)
Subject: CALL FOR PAPERS -- JOURNAL OF FUNCTIONAL PROGRAMMING
Message-ID:
CALL FOR PAPERS
SPECIAL ISSUE
JOURNAL OF FUNCTIONAL PROGRAMMING:
DEPENDENT TYPE THEORY MEETS PROGRAMMING PRACTICE
Modern programming languages rely on advanced type systems that detect
errors at compile-time. While the benefits of type systems have long been
recognized, there are some areas where the standard systems in programming
languages are not expressive enough. Language designers usually trade
expressiveness for decidability of the type system. Some interesting
programs will always be rejected (despite their semantical soundness) or
be assigned uninformative types.
There are several remedies to this situation. Dependent type systems,
which allow the formation of types that explicitly depend on other types
or values, are one of the most promising approaches. These systems are
well-investigated from a theoretical point of view by logicians and type
theorists. For example, dependent types are used in proof assistants to
implement various logics and there are sophisticated proof editors for
developing programs in a dependently typed language.
To the present day, the impact of these developments on practical
programming has been small, partially because of the level of
sophistication of these systems and of their type checkers. Only recently,
there have been efforts to integrate dependent systems into intermediate
languages in compilers and programming languages. Additional uses have
been identified in high-profile applications such as mobile code security,
where terms of a dependently typed lambda calculus to encode safety
proofs.
A special issue of the Journal of Functional Programming will be devoted
to the interplay between dependent type theory and programming practice.
We welcome technical contributions in the field, as well as position
papers that:
- make researchers in programming languages aware of new developments
and research directions on the theory side;
- point out to theorists practical uses of advanced type systems and
urge them to address theoretical problems arising in emerging
applications.
Authors who are concerned about the appropriateness of a topic are welcome
to contact the guest editors. Manuscripts should be unpublished works and
not submitted elsewhere. Revised and enhanced versions of papers published
in conference proceedings that have not appeared in archival journals are
eligible for submission. All submissions will be reviewed according to the
usual standards of scholarship and originality.
Submissions should be sent to Gilles Barthe (Gilles.Barthe@inria.fr), with
a copy to Nasreen Ahmad (nasreen@dcs.gla.ac.uk). Submitted articles should
be sent in postscript format preferably gzipped and uuencoded. In
addition, please send, as plain text, title, abstract, and contact
information.
The submission deadline is December 1st, 2001.
Guest Editors:
o Gilles Barthe, INRIA Sophia-Antipolis, France
o Peter Dybjer, Chalmers Tekniska Högskola, Sweden
o Peter Thiemann, Universität Freiburg, Germany
From rrt@dcs.gla.ac.uk Wed Mar 7 13:04:59 2001
From: rrt@dcs.gla.ac.uk (Reuben Thomas)
Date: Wed, 7 Mar 2001 13:04:59 +0000 (GMT)
Subject: GHC - Cygwin Installation and also DirectX (fwd)
Message-ID:
Sigbjorn says:
Link with -mwindows (if going via gcc to get at
the linker.) i.e., if using the std hello.lhs app
ghc -o hello hello.lhs -static -package win32 -optl-mwindows
that'll get you a non-console app with mingw. Think
it'll do the trick with cygwin too.
From N.Perry@massey.ac.nz Wed Mar 7 19:20:03 2001
From: N.Perry@massey.ac.nz (Nigel Perry)
Date: Thu, 8 Mar 2001 08:20:03 +1300
Subject: GHC - Cygwin Installation and also DirectX
In-Reply-To:
References:
Message-ID:
At 9:52 am +0000 7/3/01, Reuben Thomas wrote:
>(Even more confusing is that our advice has changed recently, and used to be
>much more similar to Nigel's...)
I have compiled up to 4.08.1 (or .2 not sure offhand), if Reuben's
advice has changed for later versions then follow them in preference
to my experience.
As to sed failing - it first happened on a PC in the room next to
Ruben's where I was visiting at the time... But these little things
are easy to forget in the huge job of compiling GHC - I keep
forgetting and wonder why it has broken!
Cheers,
Nigel
From miketh@brisbane.paradigmgeo.com Thu Mar 8 07:27:09 2001
From: miketh@brisbane.paradigmgeo.com (Mike Thomas)
Date: Thu, 8 Mar 2001 17:27:09 +1000
Subject: GHC - Cygwin Installation and also DirectX (fwd)
Message-ID: <000501c0a7a1$30d6f160$0cb4a8c0@brisbane.paradigmgeo.com>
Many thanks Reuben and Sigbjorn
> Sigbjorn says:
>
> Link with -mwindows (if going via gcc to get at
> the linker.) i.e., if using the std hello.lhs app
>
> ghc -o hello hello.lhs -static -package win32 -optl-mwindows
>
> that'll get you a non-console app with mingw. Think
> it'll do the trick with cygwin too.
The exe is 4270K, but I can live with that.
Cheers
Mike Thomas
From rrt@dcs.gla.ac.uk Thu Mar 8 08:46:28 2001
From: rrt@dcs.gla.ac.uk (Reuben Thomas)
Date: Thu, 8 Mar 2001 08:46:28 +0000 (GMT)
Subject: GHC - Cygwin Installation and also DirectX (fwd)
In-Reply-To: <000501c0a7a1$30d6f160$0cb4a8c0@brisbane.paradigmgeo.com>
Message-ID:
> The exe is 4270K, but I can live with that.
Even stripped? (Unfortunately GHC does give you big EXEs, and fundamentally
will until we get dynamic linking working again; however, I think I might b=
e
able to improve things drastically even before then by re-enabling object
splitting for the libraries under Windows.)
--=20
http://sc3d.org/rrt/
L'art des vers est de transformer en beaut=E9s les faiblesses (Aragon)
From i1083924@petra.euitio.uniovi.es Thu Mar 8 12:08:26 2001
From: i1083924@petra.euitio.uniovi.es (=?iso-8859-9?Q?Alba_Marina_Lopez_Arg=FCelles?=)
Date: Thu, 08 Mar 2001 13:08:26 +0100 (CET)
Subject: Just one question
Message-ID:
Hi! I'm a Spanish student who is 'trying' to do her final proyect
using Haskell; I don't want to bore you explaining what's the work
about but it has to do with internet and all that.Well,currently I'm just
trying to do a little code using sockets that (giving it an url) connects
to a remote machine and gets information from it.
I've checked a library called LibWWW,and I want to do something similar
to that, but in a lower level and that's why I'm using another library
called SocketPrim.
I've managed to get a socket,to connect it but I cannot managed it to
read.
And now here are the questions:
- There's a function in the library Socket called connectTo and I would
like to know how does it work 'from the inside'.
- I also would like to know what does the function readSocket (from
SocketPrim) return.
- If you know some site where I may get information related with
Haskell about TCP/IP,sockets and all that stuff,I would be very pleased if
you send it to me.
Well,that's all for now.I hope you can resolve my questions to keep
on with the proyect.Thank you very much!
Alba ;)
From simonmar@microsoft.com Thu Mar 8 17:26:57 2001
From: simonmar@microsoft.com (Simon Marlow)
Date: Thu, 8 Mar 2001 09:26:57 -0800
Subject: Just one question
Message-ID: <9584A4A864BD8548932F2F88EB30D1C60171F4EF@TVP-MSG-01.europe.corp.microsoft.com>
Alba Marina Lopez Arguelles writes:
> - There's a function in the library Socket called connectTo
> and I would
> like to know how does it work 'from the inside'.
connectTo is in the Socket library, and it is implemented in terms of
the lower level primitives from SocketPrim. It takes a hostname and
port, and returns a normal Haskell Handle, on which you can use hGetLine
and hPutStr as you would with a file or pipe. This is easiest way to
open up a connection to a server and communicate with it.
> - I also would like to know what does the function readSocket (from
> SocketPrim) return.
I don't recommend using readSocket. Using the normal Haskell I/O
functions with a socket Handle should be enough.
Cheers,
Simon
From miketh@brisbane.paradigmgeo.com Thu Mar 8 21:32:40 2001
From: miketh@brisbane.paradigmgeo.com (Mike Thomas)
Date: Fri, 9 Mar 2001 07:32:40 +1000
Subject: GHC - Cygwin Installation and also DirectX (fwd)
Message-ID: <001601c0a817$5167b880$0cb4a8c0@brisbane.paradigmgeo.com>
> > The exe is 4270K, but I can live with that.
>
> Even stripped?
Woops, sorry. That make it 1869K - a substantial improvement!
> (Unfortunately GHC does give you big EXEs, and
> fundamentally
> will until we get dynamic linking working again; however, I think
> I might be
> able to improve things drastically even before then by re-enabling object
> splitting for the libraries under Windows.)
Thanks. Even without this GHC now stands up very well from my perspective.
I no longer have an excuse for procrastination!
Cheers
Mike Thomas.
From gmu@hotmail.com Fri Mar 9 00:43:40 2001
From: gmu@hotmail.com (G Murali)
Date: Fri, 09 Mar 2001 00:43:40
Subject: newbie
Message-ID:
hi there,
I'm new to this monads stuff.. can you tell me what it is simply ?
an example would be highly appreciated.. i want it is very very simple terms
please..
help please!
gmu
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
From Tom.Pledger@peace.com Fri Mar 9 00:53:00 2001
From: Tom.Pledger@peace.com (Tom Pledger)
Date: Fri, 9 Mar 2001 13:53:00 +1300
Subject: newbie
In-Reply-To:
References:
Message-ID: <15016.10604.931769.647424@waytogo.peace.co.nz>
G Murali writes:
| hi there,
|
| I'm new to this monads stuff.. can you tell me what it is simply ?
| an example would be highly appreciated.. i want it is very very
| simple terms please..
|
| help please!
There are some introductions to monads in the "Books and Tutorials
about Programming in Haskell" section of the haskell.org website.
From franka@cs.uu.nl Fri Mar 9 14:56:02 2001
From: franka@cs.uu.nl (Frank Atanassow)
Date: Fri, 9 Mar 2001 15:56:02 +0100
Subject: newbie
In-Reply-To: ; from gmu@hotmail.com on Fri, Mar 09, 2001 at 12:43:40AM +0000
References:
Message-ID: <20010309155602.A972@cs.uu.nl>
G Murali wrote (on 09-03-01 00:43 +0000):
> I'm new to this monads stuff.. can you tell me what it is simply ?
> an example would be highly appreciated.. i want it is very very simple terms
> please..
A monad on category C is a monoid in the category of endofunctors on C.
Is that simple enough? ;)
No? Then see "Using Monads" at http://haskell.org/bookshelf/
(Sorry, I just couldn't resist!)
--
Frank Atanassow, Information & Computing Sciences, Utrecht University
Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands
Tel +31 (030) 253-3261 Fax +31 (030) 251-379
From thiemann@informatik.uni-freiburg.de Fri Mar 9 14:45:24 2001
From: thiemann@informatik.uni-freiburg.de (Peter Thiemann)
Date: Fri, 9 Mar 2001 15:45:24 +0100 (CET)
Subject: PEPM'02, Preliminary Call for Papers
Message-ID: <200103091445.PAA01568@informatik.uni-freiburg.de>
PRELIMINARY CALL FOR PAPERS
2002 ACM SIGPLAN Workshop on
Partial Evaluation and Semantics-Based Program Manipulation (PEPM'02)
Portland, Oregon, USA, January 14-15, 2002
(preceding POPL'02)
http://www.informatik.uni-freiburg.de/~thiemann/pepm02
Submission deadline: October, 2001
The PEPM'02 workshop will bring together researchers working in the
areas of semantics-based program manipulation, partial evaluation, and
program generation. The workshop focuses on techniques, supporting
theory, and applications of the analysis and manipulation of programs.
Technical topics include, but are not limited to:
* Program manipulation techniques: transformation, specialization,
normalization, reflection, rewriting, run-time code generation,
multi-level programming.
* Program analysis techniques: abstract interpretation, static
analysis, binding-time analysis, attribute grammars, constraints.
* Related issues in language design and models of computation:
imperative, functional, logical, object-oriented, parallel,
distributed, mobile, secure, domain-specific.
* Programs as data objects: staging, meta-programming, incremental
computation, mobility, tools and techniques, prototyping and
debugging.
* Applications: systems programming, scientific computing,
algorithmics, graphics, security checking, simulation, compiler
generation, compiler optimization, decompilation.
* Assessment: applicability of program manipulation techniques to
particular architectures and language paradigms, scalability,
benchmarking, portability.
Original results that bear on these and related topics are solicited.
Papers investigating novel uses and applications of program
manipulation in the broadest sense are especially encouraged. Authors
concerned about the appropriateness of a topic are welcome to consult
with the program chair prior to submission.
SUBMISSION INFORMATION
Papers should be submitted electronically via the workshop's Web
page. Exceptionally, submissions may be emailed to the program
chair: . Acceptable
formats are PostScript or PDF, viewable by gv.
Submissions should not exceed 5000 words, excluding bibliography and
figures. Excessively long submissions may be rejected outright.
Submitted papers will be judged on the basis of significance,
relevance, correctness, originality, and clarity. They should include
a clear identification of what has been accomplished and why it is
significant. They must describe work that has not previously been
published in a major forum. Authors must indicate if a closely
related paper is also being considered for another conference or
journal.
Proceedings will be published as a technical report at the University
of Freiburg. A special issue of the journal "Higher-Order and
Symbolic Computation" is
planned afterwards.
PROGRAM COMMITTEE
Maria Alpuente (Unversity of Valencia, Spain)
Evelyn Duesterwald (Hewlett-Packard Labs, USA)
Robert Glueck (DIKU, Denmark)
Michael Hanus (Christian-Albrecht-University of Kiel, Germany)
Zhenjiang Hu (University of Tokyo, Japan)
John Hughes (Chalmers Technical University, Sweden)
Mark Jones (OGI, USA)
Siau-Cheng Khoo (NUS, Singapore)
Jakob Rehof (Microsoft Research, USA)
Joao Saraiva (University of Minho, Portugal)
Ulrik Schultz (University of Aarhus, Denmark)
Peter Thiemann (University of Freiburg, Germany, chair)
David Walker (CMU, USA)
From ess_lli@cc.helsinki.fi Fri Mar 9 14:21:06 2001
From: ess_lli@cc.helsinki.fi (Ahti Pietarinen)
Date: Fri, 9 Mar 2001 16:21:06 +0200 (EET)
Subject: FG/MOL 2001 Second CFP
Message-ID:
***********************************************************************
[apologies if you receive this more than once]
FGMOL'01 FGMOL'01 FGMOL'01 FGMOL'01 FGMOL'01 FGMOL'01 FGMOL'01 FGMOL'01
FORMAL GRAMMAR/MATHEMATICS OF LANGUAGE CONFERENCE
August 10--12, 2001
Helsinki, Finland
SECOND CALL FOR PAPERS
We are pleased to announce the joint meeting of two conferences:
the sixth conferene on Formal Grammar and the seventh on the
Mathematics of Language. The joint meeting will be held just prior
to the European Summer School in Logic, Language, and Information.
AIMS and SCOPE
FGMOL'01 provides a forum for the presentation of new and original
research on formal grammar and mathematical aspects of language,
especially with regard to the application of formal methods to natural
language analysis.
Themes of interest include, but are not limited to,
* formal and computational syntax, semantics, pragmatics, and phonology;
* model-theoretic and proof-theoretic methods in linguistics;
* constraint-based and resource-sensitive approaches to grammar;
* foundational, methodological and architectural issues in grammar.
* mathematical properties of linguistic frameworks
* theories and models of natural language processing and generation
* parsing theory
* statistical and quantitative models of language
SPECIAL SESSION on MODEL-THEORETIC SYNTAX
There will be a special session of invited papers on model-theoretic
syntax. The speakers will be Geoffrey K. Pullum (keynote),
Patrick Blackburn, James Rogers, and Uwe Moennich.
ADDITIONAL INVITED SPEAKERS to be announced.
SUBMISSION DETAILS
We invite E-MAIL submissions of abstracts for 30-minute papers (including
questions, comments, and discussion).
A submission should consist of two parts:
- an information sheet (in ascii), containing the name of the author(s),
affiliation(s), e-mail and postal address(es) and a title;
- an abstract, consisting of a description of not more than 5 pages
(including figures and references). Abstracts may be either in plain
ASCII or in (unix-compatible encoded) postscript, PDF, or DVI.
Abstracts can be sent to
fgmol@cs.indiana.edu
ABSTRACT SUBMISSION DEADLINE
April 1, 2001
NOTIFICATION OF ACCEPTANCE
May 15, 2001
PROCEEDINGS
A full version of each accepted paper will be included in the conference
proceedings, to be distributed at the conference. Full papers are due
June 30, 2001.
PROGRAMME COMMITTEE
Anne Abeill'e (Paris)
Patrick Blackburn (INRIA)
Gosse Bouma (Groningen)
Mary Dalrymple (Xerox Parc)
Nissim Francez (Haifa)
Thilo Goetz (IBM)
David Johnson (IBM)
Mark Johnso (Brown)
Aravind Joshi (UPenn)
Gerhard J"ager (Utrecht)
Ruth Kempson (London)
Alain Lecomte (LORIA)
Uwe Moennich (T"ubingen)
Glyn Morrill (U.P. Catalunya)
Michael Moortgat (Utrecht)
Owen Rambo (Cogentex)
James Rogers (Earlham)
Giorgio Satta (Padova)
Mark Steedman (Edinburgh)
FURTHER INFORMATION
Web site for ESSLLI XIII: http://www.helsinki.fi/esslli/
Web site for FGMOL'01 :http://www.cis.upenn.edu/~ircs/mol/mol7.html
The organizers:
Geert-Jan Kruijff gj@cogsci.ed.ac.uk
Larry Moss lsm@cs.indiana.edu
Dick Oehrle oehrle@linc.cis.upenn.edu
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%[LaTeX2E Source File]%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}
\usepackage{tabularx}
\setlength{\textwidth}{7in}
\setlength{\oddsidemargin}{-.5in}
\setlength{\topmargin}{-36pt}
\pagestyle{empty}
\begin{document}
\begin{center}
{\em Please Post}\\[.1cm]
{\large{\bf Formal Grammar / Mathematics of Language Conference ---
FGMOL'01\\
CALL FOR PAPERS}}\\
{August 10--12, 2001}\qquad Helsinki\\
\end{center}
\begin{center}
\begin{tabular}{@{}p{.27\textwidth}|p{.70\textwidth}@{}}
%\small\ixpt\setlength{\baselineskip}{9pt}
\footnotesize
\begin{flushleft}
{\bf Programme Committee}
\end{flushleft}
\begin{tabular}{l@{}}
Anne Abeill\'{e} (Paris) \\
Patrick Blackburn (INRIA) \\
Gosse Bouma (Groningen) \\
Mary Dalrymple (Xerox Parc) \\
Nissim Francez (Haifa)\\
Thilo Goetz (IBM)\\
David Johnson (IBM) \\
Mark Johnson (Brown)\\
Aravind Joshi (UPenn)\\
Gerhard J\"{a}ger (Utrecht)\\
Ruth Kempson (London)\\
Alain Lecomte (LORIA)\\
Uwe M\"{o}nnich (T\"{u}bingen)\\
Glyn Morrill (U.P. Catalunya) \\
Michael Moortgat (Utrecht) \\
Owen Rambow (Cogentex)\\
James Rogers (Earlham) \\
Giorgio Satta (Padova) \\
Mark Steedman (Edinburgh)\\
[12pt]
{\bf Organizing Committee}\\
Geert-Jan Kruijff (Prague)\\
Larry Moss (Indiana)\\
Richard Oehrle (Ashford)
\end{tabular}
\medskip
{\bf Important Dates}
\smallskip
\begin{tabular}{l@{}}
Abstracts Due: March 31, 2001\\
Notification: May 15, 2001\\
Final Versions: June 30, 2001\\
Conference: August 10-12, 2001\\
\end{tabular}
\medskip
{\bf Addresses:\quad}
\smallskip
\begin{tabular}{l@{}}
ESSLLI XIII: \\
\texttt{http://www.helsinki.fi/esslli}\\
FGMOL'01:\\
\texttt{http://www.cis.upenn.edu/\ldots}\\
$\quad$ \texttt{\ldots $^{\sim}$ircs/mol/mol7.html}
\end{tabular}
&
\setlength{\parskip}{2pt}
We are pleased to announce the joint meeting of two conferences:
the sixth conferene on Formal Grammar and the seventh on the
Mathematics of Language. The joint meeting will be held just prior
to the European Summer School in Logic, Language, and Information.
\medskip
{\it Aims And Scope} FGMOL'01 provides a forum for the presentation of new
and
original research on formal grammar and mathematical aspects of language,
especially with regard to the application of formal methods to natural
language
analysis. Themes of interest include, but are not limited to,
\begin{itemize}
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}
\item formal and computational syntax, semantics, pragmatics, and
phonology;
\item model-theoretic and proof-theoretic methods in linguistics;
\item constraint-based and resource-sensitive approaches to grammar;
\item foundational, methodological and architectural issues in grammar.
\item mathematical properties of linguistic frameworks
\item theories and models of natural language processing and generation
\item parsing theory
\item statistical and quantitative models of language
\end{itemize}
\noindent We welcome papers from
a wide variety of frameworks.
\medskip
{\it Special session on model-theoretic syntax}
Invited speakers for this are
Geoffrey K. Pullum (keynote),
Patrick Blackburn, James Rogers, and Uwe Moennich.
\medskip
{\it Additional Invited Speakers} to be announced.
\medskip
{\it Submission Details} We invite E-MAIL submissions of abstracts
for 30-minute papers (including questions, comments, and discussion).
A submission should consist of two parts:
\begin{itemize}
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}
\item an information sheet (in ascii), containing the name of the
author(s),
affiliation(s), e-mail and postal address(es) and a title;
\item an abstract, consisting of a description of not more than 5 pages
(including figures and references). Abstracts may be either in plain
ASCII or in (unix-compatible encoded) postscript, PDF, or DVI.
\end{itemize}
\noindent Abstracts can be sent to {\tt fgmol@cs.indiana.edu} (Larry
Moss).
\medskip
{\it Abstract Submission Deadline} March 31, 2001
{\it Notification of Acceptance} May 15, 2001
{\it Proceedings} A full version of each accepted paper will be
included in the conference proceedings, to be distributed at the
conference. Full papers are due June 30, 2001.
\end{tabular}
\end{center}
\end{document}
From jans@numeric-quest.com Fri Mar 9 18:22:28 2001
From: jans@numeric-quest.com (Jan Skibinski)
Date: Fri, 9 Mar 2001 13:22:28 -0500 (EST)
Subject: Interesting application for RandomIOR
Message-ID:
Well, at least interesting for me ... Thinking a bit
about modelling of a standard interpretation of a measurement
in Quantum Mechanics I came up with this tiny addendum
to module QuantumVector:
http://www.numeric-quest.com/haskell/Observation.hs
which simulates apparently random choice of an eigenvalue
and collapses the state to its corresponding eigenvector.
Jan
From gmu@hotmail.com Fri Mar 9 18:32:11 2001
From: gmu@hotmail.com (G Murali)
Date: Fri, 09 Mar 2001 18:32:11
Subject: list of results monad
Message-ID:
hi,
I'm trying to build a monad that will give a list of results.
this is what i want to be able to do
I have
data M a = I [a]
instance Monad M where
return x = I [x]
I (x:xs) >>= f = ??
The type of >>= is m a -> (a -> m b) -> m b
but here the input is [a], now if I apply the input individually on f then i
can get a [m b] and if i extract at each step then I can get [b] and then if
i say return ([b]) i get m b.. right ??
Is this how I go about it .. if so can you give me a small code snippet of
how to do that.
Thanks,
gmu
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
From gmu@hotmail.com Fri Mar 9 23:15:19 2001
From: gmu@hotmail.com (G Murali)
Date: Fri, 09 Mar 2001 23:15:19
Subject: exception handling..
Message-ID:
Hi,
Is it possible to do/mimic exception handling in Haskell using monads.. if
so can you throw in some pointers on this please..
gmu
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
From edrx@inx.com.br Sat Mar 10 09:54:27 2001
From: edrx@inx.com.br (Eduardo Ochs)
Date: Sat, 10 Mar 2001 06:54:27 -0300 (BRT)
Subject: newbie
Message-ID: <20010310095427.E5E3C9FA56@angg>
Frank Atanassow wrote:
> G Murali wrote (on 09-03-01 00:43 +0000):
> > I'm new to this monads stuff.. can you tell me what it is simply ?
> > an example would be highly appreciated.. i want it is very very
> > simple terms please..
>
> A monad on category C is a monoid in the category of endofunctors on C.
>
> Is that simple enough? ;)
>
> No? Then see "Using Monads" at http://haskell.org/bookshelf/
>
> (Sorry, I just couldn't resist!)
Uh-oh. I'm a junior categorist and toposopher and I confess that all
my few attempts to understand what Haskell's monads have to do with
the categorical notion of a monad have failed more or less miserably.
Can someone point me to a relevant paper, or give a quick explanation?
Thanks in advance, and sorry for the dumb question,
Eduardo Ochs
http://angg.twu.net/
edrx@inx.com.br
From edrx@inx.com.br Sat Mar 10 10:08:37 2001
From: edrx@inx.com.br (Eduardo Ochs)
Date: Sat, 10 Mar 2001 07:08:37 -0300 (BRT)
Subject: newbie
Message-ID: <20010310100837.B6B629FA56@angg>
Frank Atanassow wrote:
> G Murali wrote (on 09-03-01 00:43 +0000):
> > I'm new to this monads stuff.. can you tell me what it is simply ?
> > an example would be highly appreciated.. i want it is very very
> > simple terms please..
>
> A monad on category C is a monoid in the category of endofunctors on C.
>
> Is that simple enough? ;)
>
> No? Then see "Using Monads" at http://haskell.org/bookshelf/
>
> (Sorry, I just couldn't resist!)
Uh-oh. I'm a junior categorist and toposopher and I confess that all
my few attempts to understand what Haskell's monads have to do with
the categorical notion of a monad have failed more or less miserably.
Can someone point me to a relevant paper, or give a quick explanation?
Thanks in advance, and sorry for the dumb question,
Eduardo Ochs
http://angg.twu.net/
edrx@inx.com.br
From len@mail.wplus.net Sat Mar 10 11:48:43 2001
From: len@mail.wplus.net (Leonid Bouriakovsky)
Date: Sat, 10 Mar 2001 14:48:43 +0300
Subject: newbie
Message-ID: <007b01c0a958$17622ca0$0d010101@len>
Perhaps, this paper will help:
http://citeseer.nj.nec.com/62964.html
>Eduardo Ochs wrote:
>
>>Frank Atanassow wrote:
>>
>> A monad on category C is a monoid in the category of endofunctors on C.
>>
>> Is that simple enough? ;)
>
>Uh-oh. I'm a junior categorist and toposopher and I confess that all
>my few attempts to understand what Haskell's monads have to do with
>the categorical notion of a monad have failed more or less miserably.
>Can someone point me to a relevant paper, or give a quick explanation?
From jenglish@flightlab.com Sat Mar 10 17:34:28 2001
From: jenglish@flightlab.com (Joe English)
Date: Sat, 10 Mar 2001 09:34:28 -0800
Subject: newbie
In-Reply-To: <20010310095427.E5E3C9FA56@angg>
References: <20010310095427.E5E3C9FA56@angg>
Message-ID: <200103101734.JAA12241@dragon.flightlab.com>
Eduardo Ochs wrote:
> Frank Atanassow wrote:
> > G Murali wrote (on 09-03-01 00:43 +0000):
> > > I'm new to this monads stuff.. can you tell me what it is simply ?
> > A monad on category C is a monoid in the category of endofunctors on C.
> > Is that simple enough? ;)
>
> Uh-oh. I'm a junior categorist and toposopher and I confess that all
> my few attempts to understand what Haskell's monads have to do with
> the categorical notion of a monad have failed more or less miserably.
> Can someone point me to a relevant paper, or give a quick explanation?
The relevant category for Haskell is the one in which
objects are types and arrows are functions. The identity
arrow for object 't' is 'id' instantiated at type 'id :: t -> t',
and composition of arrows is function composition.
Single-argument type constructors like '[]', Maybe, etc.,
map types to types (objects to objects). If equipped with a
suitable function 'fmap :: (a -> b) -> (T a -> T b)'
(i.e., taking arrows to arrows), they form a categorical
functor (specifically, an endofunctor), and can be made instances
of the Haskell Functor class.
Polymorphic functions are natural transformations: a function
'f :: forall a. F a -> G a' gives, for each object (type) 't'
an arrow from 'F t' to 'G t'.
One of the definitions of a monad is: a functor M equipped
with two natural transformations: eta : Id -> M and mu : MM -> M
(obeying certain laws). Translating this into Haskell,
this is a type constructor M along with polymorphic functions
'return :: forall a. a -> M a' and 'join :: forall a. M (M a) -> M a'
(again obeying certain laws).
The 'join' function makes intuitive sense for "container-like"
monads like List (join = concat :: [[a]] -> [a]) and Maybe
(join (Just (Just x)) = Just x ; join Just Nothing = join Nothing = Nothing).
For other monads like state transformers, parsers, and IO it's
less intuitive, so it's more common to define Haskell Monads
in terms of the "bind" operation ">>=",
(>>=) :: (M a) -> (a -> M b) -> M b
which is a close relative of the Kleisli composition operator.
Join, bind, and Kleisli composition are all interdefinable:
(>>=) :: (M a) -> (a -> M b) -> M b
join :: M (M a) -> M a
o :: (b -> M c) -> (a -> M b) -> (a -> M c)
m >>= k = join (fmap k m)
join mm = mm >>= id
f `o` g = join . fmap f . g
Wadler's "Comprehending Monads" gives a very good presentation
using the fmap/return/join formulation (called map/unit/join
in that paper). "The Essense of Functional Programming"
is another very good presentation using the return/>>=
formulation (there called "unitM/bindM"). See
--Joe English
jenglish@flightlab.com
From rjljr2@yahoo.com Sat Mar 10 20:20:48 2001
From: rjljr2@yahoo.com (Ronald Legere)
Date: Sat, 10 Mar 2001 12:20:48 -0800 (PST)
Subject: FFI tutorial??
In-Reply-To: <37DA476A2BC9F64C95379BF66BA269025EAE3C@red-msg-09.redmond.corp.microsoft.com>
Message-ID: <20010310202048.27616.qmail@web10012.mail.yahoo.com>
Does anyone know of a tutorial introduction to the
FFI? How does one go about getting started with this
thing? Any simple examples? I just want to be able
to do simple things (mostly access a c library from
haskell... ok maybe not trivial :) ) I would be
happy if I could just call c programs with simple
types and pointers (no way am I going to figure out
struct alignment! ).
I have had some success with Java Native methods,
so I believe such things can be done :0
Cheers!
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/
From thorinn@diku.dk Sat Mar 10 20:35:44 2001
From: thorinn@diku.dk (Lars Henrik Mathiesen)
Date: 10 Mar 2001 20:35:44 -0000
Subject: newbie
In-Reply-To: <200103101734.JAA12241@dragon.flightlab.com> (message from Joe
English on Sat, 10 Mar 2001 09:34:28 -0800)
Message-ID: <20010310203544.26193.qmail@tyr.diku.dk>
> From: Joe English
> Date: Sat, 10 Mar 2001 09:34:28 -0800
> The relevant category for Haskell is the one in which
> objects are types and arrows are functions. The identity
> arrow for object 't' is 'id' instantiated at type 'id :: t -> t',
> and composition of arrows is function composition.
>
> Single-argument type constructors like '[]', Maybe, etc.,
> map types to types (objects to objects). If equipped with a
> suitable function 'fmap :: (a -> b) -> (T a -> T b)'
> (i.e., taking arrows to arrows), they form a categorical
> functor (specifically, an endofunctor), and can be made instances
> of the Haskell Functor class.
>
> Polymorphic functions are natural transformations: a function
> 'f :: forall a. F a -> G a' gives, for each object (type) 't'
> an arrow from 'F t' to 'G t'.
>
> One of the definitions of a monad is: a functor M equipped
> with two natural transformations: eta : Id -> M and mu : MM -> M
> (obeying certain laws). Translating this into Haskell,
> this is a type constructor M along with polymorphic functions
> 'return :: forall a. a -> M a' and 'join :: forall a. M (M a) -> M a'
> (again obeying certain laws).
However, in some expositions of category theory, the usefulness of
monads is justified because they 'belong' to a certain adjunction.
In Haskell you can't express the adjunction, only the monad, which may
take a little getting used to.
But how about the related concept of an M-algebra? That is, a type T
and a function 'xi :: M T -> T' so that these laws hold:
xi . eta === id
xi . (fmap xi) === xi . mu
As it is, the List monad expresses the idea of the free monoid over a
set. A List-algebra is of course a general monoid:
e :: T
e = xi []
(#) :: T -> T -> T
(#) = \x y.xi [x y]
(And 'M a' is an M-algebra for any a, using xi = join).
And what you do every time you write 'foldl 0 +' in a program is to
give the xi of the additive monoid structure on the Num types.
Would it be useful to have functions that were polymorphic over
List-algebras? (Not that I have any idea how that might be possible to
express in Haskell).
Lars Mathiesen (U of Copenhagen CS Dep) (Humour NOT marked)
From chak@cse.unsw.edu.au Sun Mar 11 03:53:07 2001
From: chak@cse.unsw.edu.au (Manuel M. T. Chakravarty)
Date: Sun, 11 Mar 2001 14:53:07 +1100
Subject: FFI tutorial??
In-Reply-To: <20010310202048.27616.qmail@web10012.mail.yahoo.com>
References: <37DA476A2BC9F64C95379BF66BA269025EAE3C@red-msg-09.redmond.corp.microsoft.com>
<20010310202048.27616.qmail@web10012.mail.yahoo.com>
Message-ID: <20010311145307H.chak@cse.unsw.edu.au>
Ronald Legere wrote,
> Does anyone know of a tutorial introduction to the
> FFI? How does one go about getting started with this
> thing? Any simple examples?
Unfortunately, there is no tutorial style text about the FFI
yet - I agree that it is necessary to have one, but nobody
sat down and wrote one so far.
> I just want to be able
> to do simple things (mostly access a c library from
> haskell... ok maybe not trivial :) ) I would be
> happy if I could just call c programs with simple
> types and pointers (no way am I going to figure out
> struct alignment! ).
Have you had a look at the various tools that simplify
calling C code? (The do stuff like figuring out struct
alignment automatically.) There are four tools by now (in
order of increasing complexity and sophistication):
(1) hsc2hs: Comes with new versions of GHC.
(2) c2hs: http://www.cse.unsw.edu.au/~chak/haskell/c2hs/
(3) greencard: http://haskell.org/greencard/
(4) hdirect: http://haskell.org/hdirect/
You see - the Haskell developers believe in choice ;-)
Cheers,
Manuel
From khaliff@astercity.net Sun Mar 11 16:43:28 2001
From: khaliff@astercity.net (Wojciech Moczydlowski, Jr)
Date: Sun, 11 Mar 2001 17:43:28 +0100 (CET)
Subject: FFI tutorial??
In-Reply-To: <20010310202048.27616.qmail@web10012.mail.yahoo.com>
Message-ID:
On Sat, 10 Mar 2001, Ronald Legere wrote:
> Does anyone know of a tutorial introduction to the
> FFI? How does one go about getting started with this
> thing? Any simple examples? I just want to be able
> to do simple things (mostly access a c library from
> haskell... ok maybe not trivial :) ) I would be
> happy if I could just call c programs with simple
> types and pointers (no way am I going to figure out
> struct alignment! ).
> I have had some success with Java Native methods,
> so I believe such things can be done :0
>
> Cheers!
Try KDirect - it is relatively simple and the tutorial is present. On the
other hand, it isn't very powerful - yet it may satisfy you.
http://www.astercity.net/~khaliff/haskell/kdirect
Wojciech Moczydlowski, Jr
From uk1o@rz.uni-karlsruhe.de Mon Mar 12 01:28:11 2001
From: uk1o@rz.uni-karlsruhe.de (Hannah Schroeter)
Date: Mon, 12 Mar 2001 02:28:11 +0100
Subject: list of results monad
In-Reply-To: ; from gmu@hotmail.com on Fri, Mar 09, 2001 at 06:32:11PM +0000
References:
Message-ID: <20010312022810.M21762@rz.uni-karlsruhe.de>
Hello!
On Fri, Mar 09, 2001 at 06:32:11PM +0000, G Murali wrote:
> hi,
> I'm trying to build a monad that will give a list of results.
> this is what i want to be able to do
> I have
> data M a = I [a]
> instance Monad M where
> return x = I [x]
> I (x:xs) >>= f = ??
> The type of >>= is m a -> (a -> m b) -> m b
> but here the input is [a], now if I apply the input individually on f then i
> can get a [m b] and if i extract at each step then I can get [b] and then if
> i say return ([b]) i get m b.. right ??
> Is this how I go about it .. if so can you give me a small code snippet of
> how to do that.
Seems you have a different take on monads than me. For me that
which you give to "return" is to be threaded to the next action,
not to some end result of the whole computation.
I *did* do a result monad once (for data compression, in fact
the monad was combined for "imperatively" consuming input as well
as "imperatively" producing output).
In principle, a result monad is a state monad where the state
is the accumulated output. An input+result monad is a state monad
where the state is a tuple of remaining input and accumulated output.
So, I'd do something like this:
data ResultM r a = RM (r -> (r,a))
instance Monad (ResultM r) where
return x = RM $ \oldResult -> (oldResult, x)
(RM m1) >>= fm2 = RM$ \oldResult ->
case m1 oldResult of
(result', a) -> case fm2 a of
RM m2 -> m2 result'
-- (>>) is defaulted!
mfail s = error s
-- if you want to have "exception handling" for mfail, you'd
-- need to have RM (r -> Either String (r,a)) above
changeResult :: (r -> r) -> RM r ()
changeResult changeFn = RM $ \oldResult -> (changeFn oldResult, ())
runResultM :: ResultM r a -> r -> (r,a)
runResultM (RM f) initRes = f initRes
-- with Lists:
runListResultM m = runResultM m []
addResult :: r -> RM [r] ()
addResult element = RM $ \oldResult -> (oldResult ++ [element], ())
-- with functions to finally yield lists (like shows)
runListFnM :: ResultM ([r] -> [r]) a -> ([r], a)
runListFnM (RM m) = case m id of
(listFn, a) -> (listFn [], a)
addFnResult :: r -> RM ([r] -> [r]) ()
addFnResult x = RM $ \oldRes -> (oldRes . (x:), ())
Usage:
someComputation = do
somehow compute x
addFnResult x
...
addFnResult y
...
return z
... runListFnM someComputation === ([x,y], z)
Kind regards,
Hannah.
From Dominic.J.Steinitz@BritishAirways.com Mon Mar 12 11:43:23 2001
From: Dominic.J.Steinitz@BritishAirways.com (Steinitz, Dominic J)
Date: 12 Mar 2001 11:43:23 Z
Subject: newbie
Message-ID: <"02A2D3AACB65B012*/c=GB/admd=ATTMAIL/prmd=BA/o=British Airways PLC/ou=CORPLN1/s=Steinitz/g=Dominic/i=J/"@MHS>
Monads in Haskell use the Kleisli triple definition which is equivalent to the two natural transformations and functor definition (with the appropriate laws) - see Algebraic Theories by Manes. When using the do notation you are effectively working in the Kleisli category generated by the monad.
Dominic.
edrx@inx.com.br on 10/03/2001 10:13:00
To: haskell
cc:
bcc: Dominic Steinitz
Subject: Re: newbie
Frank Atanassow wrote:
> G Murali wrote (on 09-03-01 00:43 +0000):
> > I'm new to this monads stuff.. can you tell me what it is simply ?
> > an example would be highly appreciated.. i want it is very very
> > simple terms please..
>
> A monad on category C is a monoid in the category of endofunctors on C.
>
> Is that simple enough? ;)
>
> No? Then see "Using Monads" at http://haskell.org/bookshelf/
>
> (Sorry, I just couldn't resist!)
Uh-oh. I'm a junior categorist and toposopher and I confess that all
my few attempts to understand what Haskell's monads have to do with
the categorical notion of a monad have failed more or less miserably.
Can someone point me to a relevant paper, or give a quick explanation?
Thanks in advance, and sorry for the dumb question,
Eduardo Ochs
http://angg.twu.net/
edrx@inx.com.br
_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell
-------------------------------------------------------------------------------------------------
21st century air travel http://www.britishairways.com
From simonpj@microsoft.com Mon Mar 12 12:44:09 2001
From: simonpj@microsoft.com (Simon Peyton-Jones)
Date: Mon, 12 Mar 2001 04:44:09 -0800
Subject: exception handling..
Message-ID: <37DA476A2BC9F64C95379BF66BA2690260DC32@red-msg-09.redmond.corp.microsoft.com>
http://research.microsoft.com/~simonpj/papers/marktoberdorf.ps.gz
http://research.microsoft.com/~simonpj/Papers/except.ps.gz
http://research.microsoft.com/~simonpj/papers/asynch-exns.ps.gz
| -----Original Message-----
| From: G Murali [mailto:gmu@hotmail.com]
| Sent: 09 March 2001 23:15
| To: haskell@haskell.org
| Subject: exception handling..
|
|
| Hi,
|
| Is it possible to do/mimic exception handling in Haskell
| using monads.. if
| so can you throw in some pointers on this please..
|
| gmu
| ______________________________________________________________
| ___________
| Get Your Private, Free E-mail from MSN Hotmail at
| http://www.hotmail.com.
|
|
| _______________________________________________
| Haskell mailing list
| Haskell@haskell.org
| http://www.haskell.org/mailman/listinfo/haskell
|
From franka@cs.uu.nl Fri Mar 9 20:33:09 2001
From: franka@cs.uu.nl (Frank Atanassow)
Date: Fri, 9 Mar 2001 21:33:09 +0100
Subject: newbie
Message-ID: <20010309213309.A1440@cs.uu.nl>
> On Fri, 9 Mar 2001, Frank Atanassow wrote:
> > A monad on category C is a monoid in the category of endofunctors on C.
Surprisingly, my facetious little remark about monads elicited the following
response (whose author I will not disclose, as I haven't obtained
permission yet):
Somebody wrote (on 09-03-01 15:38 +0000):
> Hi Frank --- Believe it or not your one-liner actually *is* helpful to me.
> >From dim & distant algebra days I remember the definition of monoid (set,
> binary operation, associative, left & right unit) but being a Physics
> major/Maths minor, a long time ago, I was deprived of any introduction to
> Category Theory. I've read some of the papers Haskell monads section &
> also had a look at some category theory books --- but I can't remember
> seeing your nice one-line definition --- do you have a reference to the
> paper or book(s) that do it this way?
I think the monoidal characterization is well known. I first saw it in Asperti
& Longo [1] (p.75), but I'm sure it can be found in other texts. The
connection with monoids is not very evident in Haskell, but is worth keeping
in mind if you know a bit of category theory.
BTW, part of the reason I'm posting this to the Haskell list is to plug a
little project I have started on my home page. It's a small collection of useful
reference texts which deal with programming languages and semantics, all of
which have become available on the web. [1] is among these.
I occasionally see posts on this list from people who are not researchers or
educators (and consequently do not have ready access to such published
material) expressing some interest in exploring PL theory and other, related
formal topics further, if only the ``barrier-to-entry'' were not so
high. Indeed, there is a wealth of technical articles which are available
online, and could prove useful or at least interesting to many Haskell and ML
programmers, but even the ones directed at a relatively wide audience of PL
researchers can be hard to grasp for non-researchers. Personally, I think this
is one reason that Haskell and ML are still fairly marginalized languages. My
hope is that this list can grow into a useful resource for go-getters and
self-starters from other fields and communities, as well as the average PL
researcher.
OK, I am only a stupid PhD student with no publications under my belt, but
anyhow that is how I felt before I became a researcher. Over the space of a
few years, while I was still hacking C++ in the dungeons of our vast corporate
megacomplex, I laid out several hundred dollars of my own money to buy enough
texts to jumpstart my own education, and what started with one book soon
exploded into a mini-library of hardbacks and articles (because you know the
dependencies in any non-trivial bibliography resemble a large bowl of sticky
spaghetti), and I would have been deliriously happy to learn that, for
example, Barendregt's encyclopaedic book on lambda-calculus was actually
readable from the web. So here's to you, my comrades-in-arms.
As it states on my page, if any of you know of any other relevant texts
which might be added to the list, please contact me and I will augment the
list forthwith.
The list is available at:
http://www.cs.uu.nl/people/franka/
and here is the reference I promised:
[1] Andrea Asperti and Giussepe Longo. Categories, Types and Structures. An
introduction to Category Theory for the working computer
scientist. MIT Press, 1991.
URL: http://www.dmi.ens.fr/users/longo/download.html
Regards,
--
Frank Atanassow, Information & Computing Sciences, Utrecht University
Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands
Tel +31 (030) 253-3261 Fax +31 (030) 251-379
From franka@cs.uu.nl Mon Mar 12 14:10:09 2001
From: franka@cs.uu.nl (Frank Atanassow)
Date: Mon, 12 Mar 2001 15:10:09 +0100
Subject: newbie
In-Reply-To: <20010309213309.A1440@cs.uu.nl>; from franka@cs.uu.nl on Fri, Mar 09, 2001 at 09:33:09PM +0100
References: <20010309213309.A1440@cs.uu.nl>
Message-ID: <20010312151009.A3402@cs.uu.nl>
Frank Atanassow wrote (on 09-03-01 21:33 +0100):
> > On Fri, 9 Mar 2001, Frank Atanassow wrote:
> > > A monad on category C is a monoid in the category of endofunctors on C.
>
> Surprisingly, my facetious little remark about monads elicited the following
> response (whose author I will not disclose, as I haven't obtained
> permission yet):
So much for my attempt at discretion. Sorry, Phil. I Bcc'd the list, but maybe
my understanding of the way it works is wrong...
--
Frank Atanassow, Information & Computing Sciences, Utrecht University
Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands
Tel +31 (030) 253-3261 Fax +31 (030) 251-379
From qrczak@knm.org.pl Mon Mar 12 14:08:50 2001
From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk)
Date: 12 Mar 2001 14:08:50 GMT
Subject: list of results monad
References: <20010312022810.M21762@rz.uni-karlsruhe.de>
Message-ID:
Mon, 12 Mar 2001 02:28:11 +0100, Hannah Schroeter pisze:
> I *did* do a result monad once (for data compression, in fact
> the monad was combined for "imperatively" consuming input as well
> as "imperatively" producing output).
These monads are present in ghc >= 4.06, in -package lang, modules:
MonadReader
MonadWriter
MonadState
MonadRWS
The combination of state and output can be done as one of these:
WriterT w (State s)
StateT s (Writer w)
RWS () w s
where w is the type of output and must be a monoid (e.g. a list)
and s is the type of state.
> data ResultM r a = RM (r -> (r,a))
This is isomorphic to MonadState.State.
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK
From simonpj@microsoft.com Mon Mar 12 15:43:33 2001
From: simonpj@microsoft.com (Simon Peyton-Jones)
Date: Mon, 12 Mar 2001 07:43:33 -0800
Subject: Any in Haskell Report
Message-ID: <37DA476A2BC9F64C95379BF66BA2690260D8FA@red-msg-09.redmond.corp.microsoft.com>
Folks,
In the Haskell Report, Feliks points out:
| On pp. 5 and 120 the rule for "ANYseq" has a very strange
| structure: why the
| "{ANY}" at the beginning and end of the subtracted stuff? It
| seems it could
| be simplified, or at least explained.
I have no idea why it can't be just
ANYseq -> {ANY}_
Can anyone see why this simpler form would not work?
I propose to adopt this simplification.
Simon
From franka@cs.uu.nl Mon Mar 12 16:16:29 2001
From: franka@cs.uu.nl (Frank Atanassow)
Date: Mon, 12 Mar 2001 17:16:29 +0100
Subject: newbie
In-Reply-To: <20010310203544.26193.qmail@tyr.diku.dk>; from thorinn@diku.dk on Sat, Mar 10, 2001 at 08:35:44PM -0000
References: <200103101734.JAA12241@dragon.flightlab.com> <20010310203544.26193.qmail@tyr.diku.dk>
Message-ID: <20010312171629.C3402@cs.uu.nl>
Lars Henrik Mathiesen wrote (on 10-03-01 20:35 -0000):
> However, in some expositions of category theory, the usefulness of
> monads is justified because they 'belong' to a certain adjunction.
You can regard a monad as arising from a particular adjunction but, although
every adjunction determines a unique monad, the converse is not true. In fact,
the collection of resolutions for a monad forms a category with adjunctions as
objects and certain functors as arrows. The adjunction which gives rise to the
Kleisli category is initial in this category. The terminal object is called
the Eilenberg-Moore category and it has as objects M-algebras, like your `xi',
and as arrows M-algebra homomorphisms.
> In Haskell you can't express the adjunction, only the monad, which may
> take a little getting used to.
I've been looking at this recently to find some canonical way to express how
to `deconstruct' monadic terms (i.e., how to run them). The idea is that you
build up monadic terms in the Kleisli category, somehow describe a resolution,
then use the initiality property of the Kleisli category to map the terms to
the category of the resolution, where you can use the adjunction to
destructure them.
> But how about the related concept of an M-algebra? That is, a type T
> and a function 'xi :: M T -> T' so that these laws hold:
> xi . eta === id
> xi . (fmap xi) === xi . mu
If you reverse the sense of the last equation and regard the monad primitives
as constructors:
xi (Eta x) = x
xi (Mu m) = xi (fmap xi m)
then this starts to look like a pattern-matching definition for folding a
monad regarded as an algebra. In fact, you can express the operators this way
in Haskell if you use are willing to use a nested datatype:
data M a = Eta a | Mu (M (M a))
> Would it be useful to have functions that were polymorphic over
> List-algebras? (Not that I have any idea how that might be possible to
> express in Haskell).
I dunno if it is useful for List-algebras, but if you take your monad M as the
substitution monad generated by a term signature, then the the resolutions of
the monad can be regarded as a way of factoring M into a composition of
signatures which (I think) represent the values and redexes of the term
language. The Kleisli and E-M categories are extremal cases. In the Kleisli
category the redex functor is trivial; I think this is this is why you can use
it to pass around computations.
In the E-M category, the value functor is trivial, but I'm not sure what this
means precisely yet. For intermediate cases, you get a particular choice of
normal forms. What I'm thinking is that an M-algebra for a language M gives
you a way of extending a denotational description of the normal forms to one
for the entire language, which is automatically sound for the equational
theory.
Which sounds useful to me for writing interpreters.
--
Frank Atanassow, Information & Computing Sciences, Utrecht University
Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands
Tel +31 (030) 253-3261 Fax +31 (030) 251-379
From qrczak@knm.org.pl Mon Mar 12 16:33:53 2001
From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk)
Date: 12 Mar 2001 16:33:53 GMT
Subject: Any in Haskell Report
References: <37DA476A2BC9F64C95379BF66BA2690260D8FA@red-msg-09.redmond.corp.microsoft.com>
Message-ID:
Mon, 12 Mar 2001 07:43:33 -0800, Simon Peyton-Jones pisze:
> I have no idea why it can't be just
>
> ANYseq -> {ANY}_
This would mean: it's a sequence of characters which is not equal to
'{-' or '-}'. But it should mean: it's a sequence of characters which
doesn't contain '{-' or '-}'. The current definition is correct,
this one is not.
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK
From thorinn@diku.dk Tue Mar 13 00:12:02 2001
From: thorinn@diku.dk (Lars Henrik Mathiesen)
Date: 13 Mar 2001 00:12:02 -0000
Subject: newbie
In-Reply-To: <20010312171629.C3402@cs.uu.nl> (message from Frank Atanassow on
Mon, 12 Mar 2001 17:16:29 +0100)
Message-ID: <20010313001202.13842.qmail@tyr.diku.dk>
> Date: Mon, 12 Mar 2001 17:16:29 +0100
> From: Frank Atanassow
> Lars Henrik Mathiesen wrote (on 10-03-01 20:35 -0000):
> > However, in some expositions of category theory, the usefulness of
> > monads is justified because they 'belong' to a certain adjunction.
>
> You can regard a monad as arising from a particular adjunction but,
> although every adjunction determines a unique monad, the converse is
> not true. In fact, the collection of resolutions for a monad forms a
> category with adjunctions as objects and certain functors as arrows.
> The adjunction which gives rise to the Kleisli category is initial
> in this category. The terminal object is called the Eilenberg-Moore
> category and it has as objects M-algebras, like your `xi', and as
> arrows M-algebra homomorphisms.
Yes, I was aware of that --- I should perhaps have said that there's
typically a 'motivating' adjunction, often one involving a forgetful
functor. Which is generally different from the one into the Kleisli
category.
I read the rest of your post with great interest too, though I need to
work at it a bit before I think I understand all of it. MacLane is off
the shelf, and section IV.7 is scheduled to be worked though come the
weekend.
My own thoughts were a bit less ambitious, and I found out that
Haskell (at least hugs -98 +o) will in fact do what I had in mind:
> module Algebra () where
> class Monad m => Algebra m a where xi :: m a -> a
> instance (Num a) => Algebra [] a where
> xi = foldl (+) 0
> instance Algebra [] [a] where xi = concat
> unit :: Algebra [] a => a
> unit = xi []
> (#) :: Algebra [] a => a -> a -> a
> x # y = xi [x, y]
Prelude> :load Algebra.lhs
Reading file "Algebra.lhs":
Hugs session for:
/usr/local/share/hugs/lib/Prelude.hs
Algebra.lhs
Algebra> unit :: Int
0
Algebra> unit :: Float
0.0
Algebra> unit :: [Char]
""
Algebra> "foo" # "bar"
"foobar"
Algebra> (1::Int) # 2 # 3
6
But perhaps I'm just easily amused.
Lars Mathiesen (U of Copenhagen CS Dep) (Humour NOT marked)
From gmh@Cs.Nott.AC.UK Tue Mar 13 09:42:10 2001
From: gmh@Cs.Nott.AC.UK (Graham Hutton)
Date: Tue, 13 Mar 2001 09:42:10 +0000
Subject: fold and unfold
Message-ID: <20010313094315.03D5C255B2@www.haskell.org>
Dear all,
The following new paper may be of interest to some readers of this group:
When is a Function a Fold or an Unfold?
Jeremy Gibbons, Graham Hutton, and Thorsten Altenkirch
http://www.cs.nott.ac.uk/~gmh/when.pdf
http://www.cs.nott.ac.uk/~gmh/when.ps
We give a necessary and sufficient condition for when a set-theoretic
function can be written using the recursion operator fold, and a dual
condition for the recursion operator unfold. The conditions are
simple, practically useful, and generic in the underlying datatype.
(To appear in the Proceedings of the 4th International Workshop on
Coalgebraic Methods in Computer Science, Genova, Italy, April 2001.)
Best wishes,
Graham
+-----------------------------------------------------------------------------+
| Dr Graham Hutton Email : gmh@cs.nott.ac.uk |
| Languages and Programming Group Web : http://www.cs.nott.ac.uk/~gmh/ |
| School of Computer Science and IT |
| The University of Nottingham |
| Jubilee Campus, Wollaton Road |
| Nottingham NG8 1BB |
| United Kingdom |
+-----------------------------------------------------------------------------+
From andreas.marth@daimlerchrysler.com Tue Mar 13 14:16:00 2001
From: andreas.marth@daimlerchrysler.com (andreas.marth@daimlerchrysler.com)
Date: Tue, 13 Mar 2001 15:16:00 +0100
Subject: guiding strictness/lazyness through the program
Message-ID: <0057440010408455000002L452*@MHS>
Hallo!
Does anybody know of a paper that describes ways how to force strict ev=
aluation=20
at some places and lazy evaluation at others?
And I am also interested in a guideline when to use strict evaluation =
and when=20
lazy.
Any pointers appreciated!
Thanks,
Andreas
=
From nipkow@informatik.tu-muenchen.de Tue Mar 13 14:20:30 2001
From: nipkow@informatik.tu-muenchen.de (nipkow@informatik.tu-muenchen.de)
Date: Tue, 13 Mar 2001 15:20:30 +0100
Subject: Research Assistant/PhD Vacancy
Message-ID: <20010313142038Z147822-343+392@sunbroy49.informatik.tu-muenchen.de>
TOOL SUPPORT FOR LOGICAL CALCULI
Research Assistant/PhD Vacancy
Technical University Munich
The theorem proving group (http://www4.in.tum.de/~kleing/group/group.html) at
the Technical University Munich is looking for a research assistant to join a
DFG-funded project focussing on the development and application of the
theorem prover Isabelle (http://isabelle.in.tum.de). The position offers
exciting opportunities for scientifically challenging research leading to a
PhD. The appointment is initially for 2 years with an optional extension.
We seek a candidate with a strong background in at least one of the following
areas
- theorem proving
- logic
- semantics of programming languages
- functional/logic programming
- specification languages
who should like to work on the boundary between theory and practice.
Depending on the candidates interests and abilities, the work can focus an
either of the following areas:
- logical calculi for the development of (object oriented) programs
- structuring mechanisms for large theories
- tool support for automated reasoning
Informal inquiries and formal applications should be addressed to
nipkow@in.tum.de (http://www.in.tum.de/~nipkow).
From theo@engr.mun.ca Tue Mar 13 19:45:31 2001
From: theo@engr.mun.ca (Theodore Norvell)
Date: Tue, 13 Mar 2001 16:15:31 -0330
Subject: Laws for Monad and MonadPlus.
Message-ID: <3AAE78DB.F65A08E3@engr.mun.ca>
Hi all. I was revising a short article I've written about
Monads in Haskell and started wondering about the identities
associated with Monads.
I think it is generally agreed (and in the report) that the
following identities should be true of a Monad:
Left identity: return a >>= k = k a
Right identity: p >>= return = p
Associativity: (p >>= j) >= k = p >>= (\x->(j x >>= k))
[provided x is not free in j or k]
What about MonadPlus? By analogy with semirings, I came up with:
Zero: mzero >>= k = mzero = p >>= (\x -> mzero)
Identity: p `mplus` mzero = p = mzero `mplus` p
Commutativity: p `mplus` q = q `mplus` p
Right distributivity: (p `mplus` q) >>= k = (p >>= k) `mplus` (q >>= k)
Left distributivity: p >>= (\x->j x `mplus` k x) = (p >>= j) `mplus` (p >== k)
[provided x is not free in j or k]
But commutativity does not hold for Maybe or [], left distributivity
does not hold for Maybe and right distributivity does not hold for [],
so these can't be right.
Are the other identities I've listed ok?
Are there other identities that I've missed?
Cheers,
Theodore Norvell
----------------------------
Dr. Theodore Norvell theo@engr.mun.ca
Electrical and Computer Engineering http://www.engr.mun.ca/~theo
Engineering and Applied Science Phone: (709) 737-8962
Memorial University of Newfoundland Fax: (709) 737-4042
St. John's, NF, Canada, A1B 3X5
From dpt@math.harvard.edu Tue Mar 13 20:12:06 2001
From: dpt@math.harvard.edu (Dylan Thurston)
Date: Tue, 13 Mar 2001 15:12:06 -0500
Subject: Laws for Monad and MonadPlus.
In-Reply-To: <3AAE78DB.F65A08E3@engr.mun.ca>; from theo@engr.mun.ca on Tue, Mar 13, 2001 at 04:15:31PM -0330
References: <3AAE78DB.F65A08E3@engr.mun.ca>
Message-ID: <20010313151206.A731@math.harvard.edu>
On Tue, Mar 13, 2001 at 04:15:31PM -0330, Theodore Norvell wrote:
> Are there other identities that I've missed?
What about associativity of mplus:
(p `mplus` q) `mplus` r = p `mplus` (q `mplus` r)
Good question!
--Dylan Thurston
From dpt@math.harvard.edu Tue Mar 13 20:13:26 2001
From: dpt@math.harvard.edu (Dylan Thurston)
Date: Tue, 13 Mar 2001 15:13:26 -0500
Subject: Laws for Monad and MonadPlus.
In-Reply-To: <3AAE78DB.F65A08E3@engr.mun.ca>; from theo@engr.mun.ca on Tue, Mar 13, 2001 at 04:15:31PM -0330
References: <3AAE78DB.F65A08E3@engr.mun.ca>
Message-ID: <20010313151326.B731@math.harvard.edu>
On Tue, Mar 13, 2001 at 04:15:31PM -0330, Theodore Norvell wrote:
> What about MonadPlus? By analogy with semirings, I came up with:
>
> Zero: mzero >>= k = mzero = p >>= (\x -> mzero)
> Identity: p `mplus` mzero = p = mzero `mplus` p
> Commutativity: p `mplus` q = q `mplus` p
> Right distributivity: (p `mplus` q) >>= k = (p >>= k) `mplus` (q >>= k)
> Left distributivity: p >>= (\x->j x `mplus` k x) = (p >>= j) `mplus` (p >== k)
> [provided x is not free in j or k]
>
> But commutativity does not hold for Maybe or [], left distributivity
> does not hold for Maybe and right distributivity does not hold for [],
> so these can't be right.
Incidentally, a Set monad seems to do better: it would satisfy all
these laws.
Best,
Dylan
From jans@numeric-quest.com Tue Mar 13 20:28:50 2001
From: jans@numeric-quest.com (Jan Skibinski)
Date: Tue, 13 Mar 2001 15:28:50 -0500 (EST)
Subject: quantum search algorithm
Message-ID:
Directly from the oven :-):
http://www.numeric-quest.com/haskell/QuantumSearch.hs
Excerpt from a short module description is given below.
Jan
Grover's algorithm assumes that one is given a quantum function, also called
an oracle, that indicates, when confronted with any number between 0 and N-1,
whether this number is or is not the special number being sought.
The algorithm enables one to find a marked item in unstructured N-item database
in a time that scales not as N, as a classical computer would require, but only
as sqrt N.
Putting it another way: the maximum number of calls to oracle is proportional to
sqrt N. Think about a scenario when the oracle charges you per call, or
when its computations are very lengthy. The answer is probabilistic, but
given with very high degree of probability.
In our implementation the 'search' function is able to find specifically
marked number from the assemble of 8 numbers: 0..7 in just two calls to oracle,
with very high degree of probability. The 'test' performs m such searches.
Note that the final stage of the search is simulated as a quantum measurement
performed on the state vector.
From taha@cs.yale.edu Tue Mar 13 16:39:27 2001
From: taha@cs.yale.edu (Walid Taha)
Date: Tue, 13 Mar 2001 11:39:27 -0500
Subject: CFP: SAIG'01
In-Reply-To:
References:
Message-ID:
CALL FOR PAPERS
Semantics, Applications and Implementation of Program Generation (SAIG'01)
PLI Workshop, September 6th, 2001. (Deadline: May 20, 2001)
http://www.cs.yale.edu/~taha/saig/cfp01.html
Program generation has the prospect of being an integral part of a
wide range of software development processes. Many recent studies
investigate different aspects of program generation systems, including
their semantics, their applications, and their implementation.
Existing theories and systems address both high-level (source)
language and low-level (machine) language generation. A number of
programming languages now supports program generation and
manipulation, with different goals, implementation techniques, and
targeted at different applications. The goal of this workshop is to
provide a meeting place for researchers and practitioners interested
in this research area, and in program generation in general.
Scope: The workshop solicits submissions related to theoretical and
practical models and tools for building program generators systems,
Examples include:
* Semantics, type systems, and implementations for multi-stage
languages.
* Run-time specialization systems: e.g. compilers, operating systems.
* High-level program generation (applications, foundations,
environments).
* Program synthesis from high-level specifications.
* Symbolic computation, linking and explicit substitution, in-lining and
macros.
Reports on applications of these techniques to real-world problems are
especially encouraged, as are submissions that relate ideas and
concepts from several of these topics, or bridge the gap between
theory and practice. The program committee is happy to advise on the
appropriateness of a particular subject.
Format: The one-day workshop will contain slots for technical papers
(30 minutes) and position papers (20 minutes. Both times include
discussion.) In addition, there will be one hour allocated for open
discussions at the end of the workshop. Proceedings will be published
as an LNCS volume.
Invited Speakers:
* Krzysztof Czarnecki, University of Ilmenau and Daimler Chrysler
* Tim Sheard, Oregon Graduate Institute of Science and Technology
* Mitch Wand, Northeastern University
Submission Details: Authors are invited to submit papers of at most
5000 words (excluding figures), in postscript format (letter or A4),
using the electronic submission form by May 20th, 2001. This deadline
is not extensible. Both position and technical papers are welcome.
Please indicate at time of submission. Position papers are expected to
describe ongoing work, future directions, and/or survey previous
results. Technical papers are expected to contain novel results. All
papers will be reviewed by the program committee for the above
mentioned criteria, in addition to correctness and clarity. Authors
will be notified of acceptance by July 17th, 2001. Final version of
the papers must be submitted by July 15th, 2001.
Program Committee:
* Gilles Barthe, INRIA * David Basin, Freiburg
* Don Batory, Texas * Robert Glück, DIKU
* Nevin Heintze, Bell-Labs * Eugenio Moggi, DISI
* Greg Morrisett, Cornell * Flemming Nielson, Aarhus
* David Sands, Chalmers * Walid Taha,Yale (PC Chair)
From taha@cs.yale.edu Tue Mar 13 16:39:27 2001
From: taha@cs.yale.edu (Walid Taha)
Date: Tue, 13 Mar 2001 11:39:27 -0500 (EST)
Subject: CFP: SAIG'01
In-Reply-To:
References:
Message-ID:
CALL FOR PAPERS
Semantics, Applications and Implementation of Program Generation (SAIG'01)
PLI Workshop, September 6th, 2001. (Deadline: May 20, 2001)
http://www.cs.yale.edu/~taha/saig/cfp01.html
Program generation has the prospect of being an integral part of a
wide range of software development processes. Many recent studies
investigate different aspects of program generation systems, including
their semantics, their applications, and their implementation.
Existing theories and systems address both high-level (source)
language and low-level (machine) language generation. A number of
programming languages now supports program generation and
manipulation, with different goals, implementation techniques, and
targeted at different applications. The goal of this workshop is to
provide a meeting place for researchers and practitioners interested
in this research area, and in program generation in general.
Scope: The workshop solicits submissions related to theoretical and
practical models and tools for building program generators systems,
Examples include:
* Semantics, type systems, and implementations for multi-stage
languages.
* Run-time specialization systems: e.g. compilers, operating systems.
* High-level program generation (applications, foundations,
environments).
* Program synthesis from high-level specifications.
* Symbolic computation, linking and explicit substitution, in-lining and
macros.
Reports on applications of these techniques to real-world problems are
especially encouraged, as are submissions that relate ideas and
concepts from several of these topics, or bridge the gap between
theory and practice. The program committee is happy to advise on the
appropriateness of a particular subject.
Format: The one-day workshop will contain slots for technical papers
(30 minutes) and position papers (20 minutes. Both times include
discussion.) In addition, there will be one hour allocated for open
discussions at the end of the workshop. Proceedings will be published
as an LNCS volume.
Invited Speakers:
* Krzysztof Czarnecki, University of Ilmenau and Daimler Chrysler
* Tim Sheard, Oregon Graduate Institute of Science and Technology
* Mitch Wand, Northeastern University
Submission Details: Authors are invited to submit papers of at most
5000 words (excluding figures), in postscript format (letter or A4),
using the electronic submission form by May 20th, 2001. This deadline
is not extensible. Both position and technical papers are welcome.
Please indicate at time of submission. Position papers are expected to
describe ongoing work, future directions, and/or survey previous
results. Technical papers are expected to contain novel results. All
papers will be reviewed by the program committee for the above
mentioned criteria, in addition to correctness and clarity. Authors
will be notified of acceptance by July 17th, 2001. Final version of
the papers must be submitted by July 15th, 2001.
Program Committee:
* Gilles Barthe, INRIA * David Basin, Freiburg
* Don Batory, Texas * Robert Glück, DIKU
* Nevin Heintze, Bell-Labs * Eugenio Moggi, DISI
* Greg Morrisett, Cornell * Flemming Nielson, Aarhus
* David Sands, Chalmers * Walid Taha,Yale (PC Chair)
From ashley@semantic.org Wed Mar 14 03:36:42 2001
From: ashley@semantic.org (Ashley Yakeley)
Date: Tue, 13 Mar 2001 19:36:42 -0800
Subject: Contexts in Existential Types
Message-ID: <200103140336.TAA24338@mail4.halcyon.com>
Would it be appropriate for Haskell to be able to remember contexts in
existential types? For instance, currently this does not work in Hugs:
--
class Charable a where
obtainChar :: a -> Char
instance Charable Char where
obtainChar c = c
data AnyCharable = forall c. (Charable c) => MkAnyCharable c
anyA = MkAnyCharable 'a'
recoverA = obtainChar ((\(MkAnyCharable c) -> c) anyA)
--
I believe allowing it to work would not amount to storing dynamic type
information.
Is this an overlooked hole or would it break the spirit of the language?
--
Ashley Yakeley, Seattle WA
From ashley@semantic.org Wed Mar 14 04:21:49 2001
From: ashley@semantic.org (Ashley Yakeley)
Date: Tue, 13 Mar 2001 20:21:49 -0800
Subject: Contexts in Existential Types
Message-ID: <200103140421.UAA29130@mail4.halcyon.com>
At 2001-03-13 19:36, I wrote:
>Would it be appropriate for Haskell to be able to remember contexts in
>existential types? For instance, currently this does not work in Hugs:
>
>--
>class Charable a where
> obtainChar :: a -> Char
>
>instance Charable Char where
> obtainChar c = c
>
>data AnyCharable = forall c. (Charable c) => MkAnyCharable c
>
>anyA = MkAnyCharable 'a'
>recoverA = obtainChar ((\(MkAnyCharable c) -> c) anyA)
>--
Whoops, my error. It is possible to do this:
--
recoverA = (\(MkAnyCharable c) -> obtainChar c) anyA
--
Sorry...
--
Ashley Yakeley, Seattle WA
From fjh@cs.mu.oz.au Wed Mar 14 07:44:54 2001
From: fjh@cs.mu.oz.au (Fergus Henderson)
Date: Wed, 14 Mar 2001 18:44:54 +1100
Subject: Contexts in Existential Types
In-Reply-To: <200103140336.TAA24338@mail4.halcyon.com>
References: <200103140336.TAA24338@mail4.halcyon.com>
Message-ID: <20010314184454.A901@hg.cs.mu.oz.au>
On 13-Mar-2001, Ashley Yakeley wrote:
> Would it be appropriate for Haskell to be able to remember contexts in
> existential types?
I'm not sure exactly what you mean by that.
But your example requires existentially typed functions.
It would certainly be appropriate for Haskell to support
existentially typed functions.
> For instance, currently this does not work in Hugs:
>
> --
> class Charable a where
> obtainChar :: a -> Char
>
> instance Charable Char where
> obtainChar c = c
>
> data AnyCharable = forall c. (Charable c) => MkAnyCharable c
>
> anyA = MkAnyCharable 'a'
> recoverA = obtainChar ((\(MkAnyCharable c) -> c) anyA)
> --
You can write that kind of thing in Mercury. However, you need to use
a separate function rather than a lambda expression, since for this
to work the lambda expression has to have an existentially quantified
polymorphic type, and in Mercury (as in Haskell 98), lambda expressions
are always monomorphic.
fjh$ cat test.m
:- import_module char.
:- typeclass charable(A) where [
func obtainChar(A) = char
].
:- instance charable(char) where [
obtainChar(C) = C
].
% Note for Haskell readers:
% in Mercury the constructor name goes on the left of the `=>'
% and the type class constraints go on the right of it
:- type anyCharable ---> some [C] mkAnyCharable(C) => charable(C).
anyA = 'new mkAnyCharable'('a').
recoverA = obtainChar(x(anyA)).
x(mkAnyCharable(C)) = C.
fjh$ mmc -C --infer-all test.m
test.m:001: Warning: module should start with a `:- module' declaration.
test.m: 1: Warning: interface for module `test' does not export anything.
test.m:012: Inferred :- func anyA = (test:anyCharable).
test.m:013: Inferred :- func recoverA = character.
test.m:014: Inferred :- some [C] (func x((test:anyCharable)) = C => (test:charab
le(C))).
Note that the type inferred for `x' is an existentially quantified function
type.
--
Fergus Henderson | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: | -- the last words of T. S. Garp.
From simonpj@microsoft.com Wed Mar 14 10:10:27 2001
From: simonpj@microsoft.com (Simon Peyton-Jones)
Date: Wed, 14 Mar 2001 02:10:27 -0800
Subject: Contexts in Existential Types
Message-ID: <37DA476A2BC9F64C95379BF66BA2690260DC5B@red-msg-09.redmond.corp.microsoft.com>
Yes, with your modification, it works just fine in GHC, and I guess
therefore hbc. Documentatino in the user manual.
http://haskell.cs.yale.edu/ghc/
Simon
| -----Original Message-----
| From: Ashley Yakeley [mailto:ashley@semantic.org]
| Sent: 14 March 2001 04:22
| To: Haskell List
| Subject: Re: Contexts in Existential Types
|
|
| At 2001-03-13 19:36, I wrote:
|
| >Would it be appropriate for Haskell to be able to remember
| contexts in
| >existential types? For instance, currently this does not
| work in Hugs:
| >
| >--
| >class Charable a where
| > obtainChar :: a -> Char
| >
| >instance Charable Char where
| > obtainChar c = c
| >
| >data AnyCharable = forall c. (Charable c) => MkAnyCharable c
| >
| >anyA = MkAnyCharable 'a'
| >recoverA = obtainChar ((\(MkAnyCharable c) -> c) anyA)
| >--
|
| Whoops, my error. It is possible to do this:
|
| --
| recoverA = (\(MkAnyCharable c) -> obtainChar c) anyA
| --
|
| Sorry...
|
| --
| Ashley Yakeley, Seattle WA
|
|
| _______________________________________________
| Haskell mailing list
| Haskell@haskell.org
| http://www.haskell.org/mailman/listinfo/haskell
|
From ess_lli@cc.helsinki.fi Wed Mar 14 15:21:42 2001
From: ess_lli@cc.helsinki.fi (Ahti Pietarinen)
Date: Wed, 14 Mar 2001 17:21:42 +0200 (EET)
Subject: DEADLINE EXTENSION: Logic & Games ESSLLI'01 workshop
Message-ID:
- Apologies for multiple copies
- Please note:
DEADLINE EXTENSION for Logic & Games ESSLLI 2001 workshop
20-24 August, Helsinki University, Finland
!!!!! New Deadline is: April 9, 2001 !!!!!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%
%% Call for Papers %%
%% %%
%% ESSLLI Workshop on Logic and Games %%
%% %%
%% %%
%% August 20-24, 2001 %%
%% Helsinki, Finland %%
%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GENERAL INFORMATION:
Games have been utilized within logic for a variety of different
purposes such as semantic evaluation games, model comparison
games, and proof games. On the other hand, logic has become
increasingly important in game theory, in particular for the
epistemic foundation of game-theoretic solution concepts. As the
TARK (http://www.tark.org) and LOFT (http://www.econ.ucdavis.edu/
faculty/bonanno/loft4.html) conferences show, interaction between
logic and game theory has become more diverse in recent years,
exploring game logics, the use of game-theory in multi-agent
systems, game-theoretic accounts of natural language phenomena,
and the role of language in defining preferences.
The workshop is part of the 13th European Summer School in Logic,
Language and Information (ESSLLI) which takes place at the
University of Helsinki from August 13 until August 24, 2001
(http://www.helsinki.fi/esslli). The workshop aims to provide a
forum for advanced Ph.D. students and other researchers from
game theory and logic to present their research on (1) game-
theoretic techniques applied to logic, and (2) logical models or
analyses of games and game-theoretic problems. We specifically
invite presentations in any of the following areas:
1) Logical analysis of games, e.g. modeling knowledge, belief,
and information flow in games; applications of epistemic and
dynamic logic to games
2) Logic games, e.g. model comparison games, semantic evaluation
games, Independence-friendly logic
3) Game logics, e.g. extensions of program logics and modal logics
to investigate the structure of games in general
4) The role of language and logical definability in games,
and connections between natural language and games generally
5) Logical approaches to multi-agent systems with a special focus
on game-theoretic aspects
SUBMISSION GUIDELINES:
Papers should not exceed 15 pages in length. A postscript or pdf
version of the paper should be submitted by e-mail to BOTH
organizers before the deadline given below. Note that all workshop
contributors must register for the summer school.
ORGANISERS:
Marc Pauly Gabriel Sandu
CWI Department of Philosophy
P.O. Box 94079 P.O. 24 (Unioninkatu 40)
1090 GB Amsterdam 00014 University of Helsinki
The Netherlands Finland
E-mail: pauly@cwi.nl E-mail: Sandu@elo.helsinki.fi
IMPORTANT DATES:
Submission deadline: April 9, 2001
Notification of contributors: May 1, 2001
Final version due: June 1, 2001
Workshop Dates: August 20-24, 2001
================================================================
From nick@microsoft.com Wed Mar 14 17:51:19 2001
From: nick@microsoft.com (Nick Benton)
Date: Wed, 14 Mar 2001 09:51:19 -0800
Subject: CfP: Babel01 Workshop on Multi-Language Infrastructure and Interoperability
Message-ID: <0C682B70CE37BC4EADED9D375809768A48CFE7@red-msg-04.redmond.corp.microsoft.com>
BABEL'01
CALL FOR PAPERS
=20
First Workshop on Multi-Language
Infrastructure and Interoperability
=20
http://research.microsoft.com/~nick/babel01.htm
=20
Satellite to PLI'01
=20
Firenze, Italy, 8th September 2001
=20
=20
AIMS AND SCOPE
=20
Recent years have seen a resurgence of interest in multi-language
tools and intermediate languages, and in interoperability between
programs and components written in different programming
languages. Shared infrastructure such as code generators, analysis
tools and garbage collectors can greatly ease the task of producing a
high-quality implementation of a new programming language, whilst
being able to interoperate easily with code written in existing
languages is essential for such an implementation to be useful in
practice. This workshop aims to bring together researchers and
developers working on multi-language integration. Contributions are
welcome on topics including, but not limited to:=20
=20
=20
* Compilation of high level languages to common executable formats
such as Sun's Java Virtual Machine, the DRA's ANDF or Microsoft's
.NET Common Language Runtime.
=20
* Defining and using bindings for component middleware such as OMG's
CORBA or Microsoft's COM.
=20
* Language constructs to support interoperability between different
languages, particularly from different paradigms (e.g. OO/functional).
=20
* Multi-language backends for compilation and/or analysis
(e.g. MLRISC, FLINT, C--, TAL, SUIF). =20
=20
* Type theoretic and semantic foundations for multi-language work. =20
=20
* Multi-language development environments and tools (e.g. debuggers,
profilers).
=20
Submissions may address any programming paradigm. Experience papers
which describe the use of multiple languages in application
development are also welcome. Authors unsure of the appropriateness of
a potential submission should email the PC chair (nick@microsoft.com).
=20
=20
PROGRAMME COMMITTEE
=20
Nick Benton (chair) Microsoft Research
Fergus Henderson University of Melbourne
Andrew Kennedy (organiser) Microsoft Research
Greg Morrisett Cornell University
Martin Odersky Ecole Polytechnique Federale de Lausanne
John Reppy Bell Labs
Andrew Tolmach Portland State University
David Wakeling University of Exeter
=20
=20
INVITED SPEAKERS
=20
Zhong Shao Yale University
=20
=20
IMPORTANT DATES
=20
Deadline for submission 1st June 2001
Notification of acceptance 9th July 2001
Final version due 10th August 2001
=20
=20
SUBMISSION DETAILS
=20
Papers should be at most 14 pages and should be submitted in
Ghostscript-compatible PostScript or PDF format and be printable on
both US letter and A4 paper. Authors are strongly encouraged to use
ENTCS style files (see http://math.tulane.edu/~entcs/). Papers should
be submitted electronically from the workshop website given above.
Submissions should not overlap significantly with work which has
already been published or submitted to any other conference or
journal. An informal proceedings will be published as a technical
report and distributed at the workshop. It is intended that a final
proceedings will be published in a volume of ENTCS.
From wpd@uswest.net Thu Mar 15 22:15:13 2001
From: wpd@uswest.net (Grace Trigue White)
Date: Thu, 15 Mar 2001 15:15:13 -0700
Subject: Ghc / Hugs inconsistencty.
Message-ID: <004101c0ad9d$680e6b20$0200000a@DD442D01>
This is a multi-part message in MIME format.
------=_NextPart_000_003E_01C0AD62.BB93F4D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
The following program compiles under ghc, but hugs complains that there =
is an unexpected keyword "forall" on the line defining the type X. The =
type used is the type of the primitive runST, so it is a valid type. It =
seems that one should be able to create a type synonym for it. The =
situation is unchanged if the type X is given a parameter a, i.e. "type =
X a =3D (forall s. ST s a) -> a".
module Main where
import ST
type Module s a =3D ST s a
type X =3D (forall s. ST s a) -> a
f :: (forall s. ST s a) -> a
f x =3D undefined
--type ModuleConnect =3D forall s. (forall t. ST (s, t) a) -> ST s a
main :: IO ()
main =3D
do { putStrLn "Hello World!!!"
}
=20
------=_NextPart_000_003E_01C0AD62.BB93F4D0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
The following program compiles =
under ghc, but=20
hugs complains that there is an unexpected keyword "forall" on the line =
defining=20
the type X. The type used is the type of the primitive runST, so it is a =
valid=20
type. It seems that one should be able to create a type synonym for it. =
The=20
situation is unchanged if the type X is given a parameter a, i.e. "type =
X a =3D=20
(forall s. ST s a) -> a".
module Main =
where
import=20
ST
type Module s a =3D ST s a
type X =3D (forall s. ST s =
a) ->=20
a
f :: (forall s. ST s a) -> a
f x =3D undefined
--type =
ModuleConnect=20
=3D forall s. (forall t. ST (s, t) a) -> ST s a
main :: IO =
()
main=20
=3D
do { putStrLn =
"Hello=20
World!!!"
=20
}
------=_NextPart_000_003E_01C0AD62.BB93F4D0--
From ess_lli@cc.helsinki.fi Thu Mar 15 16:56:09 2001
From: ess_lli@cc.helsinki.fi (Ahti Pietarinen)
Date: Thu, 15 Mar 2001 18:56:09 +0200 (EET)
Subject: DEADLINE EXTENSION: ESSLLI'01 Workshop on Semantic Knowledge
Acquisition and Categorisation (Helsinki, Finland)
Message-ID:
*************** EXTENDED DEADLINE ****************
----- NEW DEADLINE: APRIL 23rd -----
----- Please check new dates below! -----
SEMANTIC KNOWLEDGE ACQUISITION AND CATEGORISATION
Workshop at ESSLLI XIII (Helsinki, Finland)
Helsinki, Finland, August 13th - 17th 2001
Workshop home page
http://www.ilc.pi.cnr.it/~esslli
ESSLLI 2001 home page
http://www.helsinki.fi/esslli
-------------------------------------------------------------------
Endorsed by SIGSEM, the ACL Special Interest Group on computational
semantics
-------------------------------------------------------------------
The sheer amount of knowledge necessary to shed light on the way word
meanings mutually relate in context or distribute in lexico-semantic
classes appears to exceed the limits of human conscious awareness and
descriptive capability. Particularly at this level of linguistic analysis,
then, we seem to be in need of automatic ways of filtering, structuring
and classifying semantic evidence through inspection of a large number of
word uses in context. Totally or partially unsupervised inductive methods
of knowledge acquisition from corpus data are credited with being able to
provide such ways. Yet, it remains to be seen how acquired information can
best be represented in current formal models for knowledge representation,
for it to be made available to mainstream NLP applications.
There are reasons to believe that this integration will require much more
than a simple extension of off-the-shelf machine learning technology. At
the same time, any major breakthrough in this area is bound to have
significant repercussions on the way word meanings and lexico-semantic
classes in general are formally represented and used for applications.
With these purposes in mind, the workshop intends to focus on the issue of
interaction between techniques for inducing semantic information from
corpus data and formal methods of linguistic knowledge representation. In
particular, we encourage in-depth analysis of underlying assumptions of
the proposed techniques and methods and discussion of possible relevant
connections with cognitive, linguistic,logical and philosophical issues.
TOPICS OF INTEREST
Possible themes for contributions are:
- development of 'data-driven' semantic type systems
- dynamic update and tuning of formal ontologies with text data
- 'hybrid models' of knowledge extraction, whereby machine learning
methods are integrated with formal structures of knowledge representation
- creation of dynamic lexical knowledge-bases
- formal representation and structuring of the flow of information
extracted from texts.
WORKSHOP ORGANISATION
The workshop will be held on five subsequent days, August 13th-17th 2001.
It will take place during the ESSLLI-Summer School in Helsinki, and will
be open to all members of the LLI-community, computational linguistics and
cognitive science as well. Each session will consist of two talks plus
discussion (30mins + 15mins each). The workshop language will be English.
----------------------------------------------------------------------------
GUIDELINES FOR SUBMISSIONS
The organizers welcome contributions from different fields of
computational linguistics, logic and cognitive science.
1. Submissions will consist of full papers reporting on original,
unpublished works. Papers should not exceed 5000 words
(including references), must contain a 5-10 lines abstract, and must
be submitted in postscript format
2. The reviewing of papers will be blind. Hence the paper
should not include the authors' names and affiliations.
Furthermore, self-references that reveal the author's identity
should be avoided.
3. Identification information will be put in a separate file
consisting of:
Title of the paper:
Author(s):
Affiliation(s):
E-mail(s):
Abstract:
4. Submitted papers and identification information must be sent
to the following address by APRIL 23rd 2001:
esslli2001@ilc.pi.cnr.it
Accepted papers will be notified by MAY 15th, together with the comments
of the reviewers.
The final version of the papers will be prepared in LaTeX by JUNE 15th,
for publication in the Workshop proceedings. The stylesheet will be
circulated in due time.
Note that all workshop participants must register as participants of
ESSLLI. The early registration fees apply to authors of accepted papers.
---------------------------------------------------------------------------
IMPORTANT DATES
April 23rd 2001 - Deadline for submitting papers
May 15th 2001 - Notification of acceptance
June 15th 2001 - Preparation of the final version of the paper
June 30th 2001 - Final program of the workshop
August 13th 2001 - The workshop begins
---------------------------------------------------------------------------
PROGRAM COMMITEE
Ted Briscoe (Cambridge University, Cambridge, United Kingdom)
Nicoletta Calzolari (Istituto di Linguistica Computazionale, CNR, Pisa, Italy)
Christiane Fellbaum (Princeton University, Princeton, USA)
Ed Hovy (USC, Marina del Rey CA, USA)
Dekang Lin (University of Alberta, Edmonton, Canada)
Antonio Sanfilippo (LingoMotors Inc., Cambridge MA, USA)
Piek Vossen (SAILLABS, Antwerpen, The Netherlands)
ORGANISING COMMITEE
Alessandro Lenci
Simonetta Montemagni
Vito Pirrelli
Istituto di Linguistica Computazionale (ILC) - CNR
Area della Ricerca CNR
Via Alfieri 1 (San Cataldo)
I-56010 PISA
Italy
WORKSHOP CONTACT ADDRESS
esslli2001@ilc.pi.cnr.it
http://www.ilc.pi.cnr.it/~esslli
ESSLLI 2001 CONTACT ADDRESS
esslli@helsinki.fi
http://www.helsinki.fi/esslli
--------------------------------------------------------------------------
From minihaskell@hotmail.com Fri Mar 16 12:32:35 2001
From: minihaskell@hotmail.com (Mini Haskell)
Date: Fri, 16 Mar 2001 12:32:35 -0000
Subject: Please help us with our research....
Message-ID:
Hi
We are a small group of undergraduate computer science students from the
University of Nottingham. As part of our second year we have been
assigned to do a software engineering group project. The project put us
together as a group and we were told what we had to do, our instructions
were as follows:
Mini Haskell
------------
The aim of this project is to build an interpreter for a small
functional programming language called Mini Haskell. For simplicity, the
only values in the language will be integers, lists, and functions. As
well as allowing expressions to be evaluated to a final result, the
interpreter should also allow the individual steps in the evaluation
process to be seen.
------------
AS part of our research we have developed an on-line questionnaire which
looks at the importance of some of the ideas we have had for the
project. The questionnaire is found on our website and asks some very
simple multiple choice questions which should take no longer than 2
minutes to complete. Please help us by looking at the site and by
filling in our questionnaire in the feedback section.
Please go to
questionnaire: http://quest.minihaskell.com
website: http://www.minihaskell.com
thankyou for your time
Dave - minihaskell
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
From bcpierce@cis.upenn.edu Fri Mar 16 14:33:31 2001
From: bcpierce@cis.upenn.edu (Benjamin C. Pierce)
Date: Fri, 16 Mar 2001 09:33:31 EST
Subject: TACS 2001 call for papers (deadline April 1)
Message-ID: <23064.984753211@saul.cis.upenn.edu>
Call For Papers
Fourth International Symposium on
Theoretical Aspects of Computer Science (TACS 2001)
October 29-31, 2001
Tohoku University, Sendai, Japan
http://tacs2001.ito.ecei.tohoku.ac.jp/tacs2001/
The TACS Symposium will focus on the theoretical foundations of
programming and their applications. The topics of interest include...
Theoretical aspects of the design, semantics, analysis, and
implementation of programming languages and systems; logics of
programs; calculi and models of concurrency and parallel
computation; theories of mobile computation and system security;
categories and types in computer science; formalisms, methods, and
systems for program specification, verification, synthesis, and
optimization; constructive, linear, and modal logics in computer
science.
The scientific program will consist of invited lectures, contributed
talks, and demo sessions. A proceedings containing the full papers of
the invited and contributed talks will be published by Springer-Verlag
as a volume of Lecture Notes in Computer Science.
IMPORTANT DATES
Submission deadline: April 1, 2001
Notification to authors: June 15, 2001
Deadline for final versions: July 20, 2001
INVITED SPEAKERS
Luca Cardelli Microsoft Research
Daniel Jackson Massachusetts Institute of Technology
Christine Paulin-Mohring Universite Paris Sud & INRIA
Andrew Pitts University of Cambridge
Jon Riecke Lucent Technologies
Kazunori Ueda Waseda University
CONFERENCE CHAIR:
Takayasu Ito
Tohoku University
PROGRAM CO-CHAIRS:
Naoki Kobayashi
Tokyo Institute of Technology
kobayasi@cs.titech.ac.jp
Benjamin Pierce
University of Pennsylvania
bcpierce@cis.upenn.edu
PROGRAM COMMITTEE:
Zena Ariola University of Oregon
Cedric Fournet Microsoft Research
Jacques Garrigue Kyoto University
Masami Hagiya University of Tokyo
Robert Harper Carnegie Mellon University
Masahito Hasegawa Kyoto University
Nevin Heintze Lucent Technologies
Martin Hofmann Edinburgh University
Zhenjiang Hu University of Tokyo
Naoki Kobayashi Tokyo Institute of Technology
Martin Odersky Ecole Polytechnique Federale de Lausanne
Catuscia Palamidessi Pennsylvania State University
Benjamin Pierce University of Pennsylvania
Francois Pottier INRIA
Andre Scedrov University of Pennsylvania
Natarajan Shankar SRI International
Ian Stark Edinburgh University
Makoto Tatsuta Kyoto University
SUBMISSION INFORMATION
Authors are invited to submit full papers (up to 6000 words, including
figures and bibliographies). Papers must be unpublished and not submitted
for publication elsewhere. Submissions should be in Postscript or PDF
format, on A4 or US letter pages. They must be printable on common
printers and viewable with ghostview or acroread. The first page of each
submission should include the email address, telephone, and fax numbers
of the corresponding author. Accepted papers must be presented at the
symposium, and the final manuscript must be prepared in the LNCS format.
All submissions should be done electronically through the TACS submission
page http://saul.cis.upenn.edu:8086/.
From harald@cs.mu.OZ.AU Fri Mar 16 15:44:41 2001
From: harald@cs.mu.OZ.AU (Harald Sondergaard)
Date: Sat, 17 Mar 2001 02:44:41 +1100
Subject: PPDP'01 deadline extension to 23 March
Message-ID: <200103161544.CAA30609@mundook.cs.mu.OZ.AU>
PPDP'01
Principles and Practice of Declarative Programming
Florence, Italy, 5-7 September 2001
http://music.dsi.unifi.it/pli01/ppdp/
EXTENSION OF DEADLINE FOR SUBMISSIONS
The deadline for paper submissions
has been extended to 23 March 2001.
Harald Sondergaard
PPDP'01 Program Chair
From mthomas@gil.com.au Sat Mar 17 02:20:34 2001
From: mthomas@gil.com.au (Mike Thomas)
Date: Sat, 17 Mar 2001 12:20:34 +1000
Subject: Greencard, GHC and FFI.
Message-ID: <002901c0ae88$ecda7920$b6332fca@snowpea>
Hi all.
I'm having trouble with using green-card 2 on Windows
with GHC-4.08.2. As the default output for -target ghc seems
to be for the C back-end rather than native code, I thought I would
try the FFI target.
Using the example from the green-card doc:
---------------------------------------------
module GCTest where
import StdDIS
%fun my_sin :: Double -> Double
%code res1=sin(arg1);
---------------------------------------------
Compiling for target FFI:
---------------------------------------------
green-card -c GCTest.gc -o GCTest.hs --target ffi
ghc -c GCTest.hs -fglasgow-exts
---------------------------------------------
Linking with this main module:
---------------------------------------------
module Main(main) where
import GCTest
main :: IO()
main = putStrLn (show (my_sin (20.0)))
---------------------------------------------
I get:
---------------------------------------------
$ ghc main.hs -o main.exe GCTest.o StdDIS.o -package lang -package greencard
Compilation IS NOT required
GCTest.o(.text+0x7f):fake: undefined reference to `prim_my_sin'
StdDIS.o(.text+0x549):fake: undefined reference to `prim_free'
StdDIS.o(.text+0x600):fake: undefined reference to `prim_allocCharStar'
StdDIS.o(.text+0x731):fake: undefined reference to `prim_readCharAddr'
StdDIS.o(.text+0xc84):fake: undefined reference to `prim_malloc'
StdDIS.o(.text+0xd38):fake: undefined reference to `access_prim_malloc_res1'
StdDIS.o(.text+0xdec):fake: undefined reference to
`access_prim_malloc_gc_failed
'
StdDIS.o(.text+0xea0):fake: undefined reference to
`access_prim_malloc_gc_failst
ring'
StdDIS.o(.text+0x1206):fake: undefined reference to `prim_writeCharAddr'
collect2: ld returned 1 exit status
---------------------------------------------
Where have I gone wrong?
Cheers
Mike Thomas.
From sigbjorn_finne@hotmail.com Sat Mar 17 09:01:12 2001
From: sigbjorn_finne@hotmail.com (Sigbjorn Finne)
Date: Sat, 17 Mar 2001 10:01:12 +0100
Subject: Greencard, GHC and FFI.
Message-ID:
Mike Thomas mthomas@gil.com.au writes:
>
> I'm having trouble with using green-card 2 on Windows
> with GHC-4.08.2. As the default output for -target ghc seems
> to be for the C back-end rather than native code, I thought I would
> try the FFI target.
>
.... example code deleted
>
> I get
>
> $ ghc main.hs -o main.exe GCTest.o StdDIS.o -package lang -package
greencard
> ---------------------------------------------
> Compilation IS NOT required
> GCTest.o(.text+0x7f):fake: undefined reference to `prim_my_sin'
> ....
Hi,
Greencard lets you write C and Haskell in one source file. When using GHC's
C back end, it is possible to combine the two in one source file (via GHC's
_casm_s.) The FFI doesn't let you do this, but requires you to provide
the C bits separately, and link the Haskell code to it via 'foreign'
declarations.
So, when using GC's FFI backend, it generates two source files for you
(and some header files) - in your case, GCTest.hs and GCTest_stub.c.
To achieve linker happiness, you need to compile up the latter and include
it on the link line *and* drop StdDIS.o from that link line.
hth
--sigbjorn
From mthomas@gil.com.au Sat Mar 17 22:30:40 2001
From: mthomas@gil.com.au (Mike Thomas)
Date: Sun, 18 Mar 2001 08:30:40 +1000
Subject: Greencard, GHC and FFI.
References:
Message-ID: <008201c0af31$eaf113e0$5d332fca@snowpea>
Hi again.
> So, when using GC's FFI backend, it generates two source files for you
> (and some header files) - in your case, GCTest.hs and GCTest_stub.c.
> To achieve linker happiness, you need to compile up the latter and include
> it on the link line *and* drop StdDIS.o from that link line.
Thanks for that - I've achieved linker happiness.
FYI, I notice that the GCTest stub file has a do..while(0), which I suppose
should be optimised away by GCC, but still makes the code less
palatable:
--------------------------------------------------------
/* Auto generated GreenCard 2 code for FFI */
double prim_my_sin(double arg1)
{ double res1;
do { res1=sin(arg1);
return((double)(res1));} while(0);
}
--------------------------------------------------------
Cheers
Mike Thomas
From johnjohnjohn64@hotmail.com Mon Mar 19 07:59:03 2001
From: johnjohnjohn64@hotmail.com (john xxx)
Date: Mon, 19 Mar 2001 18:59:03 +1100
Subject: question does haskell have a something like a wild character
Message-ID:
i want to know if HAskell has an inbuilt function in the prelude a function
that allows me to use wild character like so:
ie. if a list of strings contains a word or a combination of words that do
not necessarily have to be side by side. someting that works like so [..
"hello" ..] == ["my", "tie" , "egg", "hello", "good"] would return True.
where .. represents other elements of the list it counld be 1element or a
hundred elements.
please reply urgently to johnjohnjohn64@hotmail.com
if haskell does not provide such a function can you please give me
information on how to create one that would do such a thing that i need.
THANKYOU FOR YOUR TIME.
please reply! i need this function for an assignment for university.
p.s if you're interested in the question visit.
http://www.cse.unsw.edu.au/~cs1711/ass1/spec-ass1.html
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
From Christian.Brolin@carmen.se Mon Mar 19 08:28:15 2001
From: Christian.Brolin@carmen.se (Christian Brolin)
Date: Mon, 19 Mar 2001 09:28:15 +0100
Subject: question does haskell have a something like a wild character
References:
Message-ID: <3AB5C31F.97BB6207@carmen.se>
john xxx wrote:
>
> i want to know if HAskell has an inbuilt function in the prelude a function
> that allows me to use wild character like so:
>
> ie. if a list of strings contains a word or a combination of words that do
> not necessarily have to be side by side. someting that works like so [..
> "hello" ..] == ["my", "tie" , "egg", "hello", "good"] would return True.
> where .. represents other elements of the list it counld be 1element or a
> hundred elements.
> whatis elem;
elem :: (Prelude.Eq b) => b -> [b] -> Bool
> elem "hello" ["my", "tie" , "egg", "hello", "good"];
True
--
Christian Brolin
From white_ghost8@hotmail.com Mon Mar 19 15:16:27 2001
From: white_ghost8@hotmail.com (The Ghost)
Date: Mon, 19 Mar 2001 16:16:27 +0100
Subject: knight's tour - please help
Message-ID:
Hello everyone,
I have a little problem with implementing the knight's tour in haskell.
My goal is to print out all possible solutions for the knight's tour.
Allthough finding one path (with given startinposition (x,y) of the horse
and dimension of the bord M*N) is not enough. I have to find all of them.
(the printing out may be very simpel)
I've wrote this problem is several other languages and there they work
perfect. But I'm searching for an implementation in Haskell. The
implementation may also be simpel (I think it can be solved only by using
lists and backtracking).
If I have the implementation I can go one with my project, I should use it
to explain the differences between a functional language and the others
(effiency, speed,..)
Is ther someone who has such an implementation (that is not too complicated
and not too lang).
Would you be so kind to send it to me?
I should be very thankfull.
Greetings,
The White Ghost.
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
From martin@meltin.net Tue Mar 20 04:25:45 2001
From: martin@meltin.net (Martin Schwenke)
Date: Tue, 20 Mar 2001 15:25:45 +1100
Subject: ANNOUNCE: HasChorus - some modules for Haskore
Message-ID: <20010320041040.69A3C659859@au2.samba.org>
HasChorus:
A set of Haskell (http://haskell.org/) modules written on top of
Haskore (http://haskell.org/haskore/) to make it easier to sequence
simple, repetitive music.
HasChorus is available via:
http://meltin.net/hacks/haskell/
----------------------------------------------------------------------
HasChorus *has* a bunch of useful modules:
HasChords.lhs: Build (diatonic) chords from scales and scale degrees.
HasDrums.lhs: Sequence drums in a similar manner to a drum machine.
HasEasyMusic.lhs: Allow simple specification of simple music sequences.
HasGroove.lhs: Modify Haskore performances via normal distributions.
HasPatterns.lhs: Sequence patterns by playing chords in different ways.
HasScales.lhs: Build scales and pick notes by scale degree.
HasSounds.lhs: Some boring ways of playing some instruments.
HaskoreExtras.lhs: Some useful functions that aren't in Haskore.
BubbleSort.lhs: An implementation of bubble sort. Used by HasGroove.lhs.
Normal.lhs: Generate normal distributions. Used by HasGroove.lhs.
TwelveBar.lhs: An example song.
Many of the modules can be used without requiring all of the others.
The dependencies look something like:
HasEasyMusic -> HasChords -> HasScales
HasDrums -> HaskoreExtras
HasSounds -> HasPatterns
HasGroove -> BubbleSort, Normal
TwelveBar -> HasChorus -> *EVERTHING ELSE*
----------------------------------------------------------------------
HasChorus has been tested under:
* Hugs: Currently I use Hugs 98, February 2000. I use -h1000000 so
that HasGroove doesn't melt down... :-)
* GHC: 4.08 (previously under 4.07) under x86 Linux.
----------------------------------------------------------------------
I use HasChorus to sequence up simple backing tracks for my own
compositions.
Enjoy...
peace & happiness,
martin
Martin Schwenke
p.s. Several people who have expressed interest in this project during
the last few years have received this announcement via a BCC.
They haven't been secretly subscribed to the Haskell mailing
list. :-)
From thiemann@informatik.uni-freiburg.de Tue Mar 20 16:55:39 2001
From: thiemann@informatik.uni-freiburg.de (Peter Thiemann)
Date: 20 Mar 2001 17:55:39 +0100
Subject: modules and re-export
Message-ID:
I have a little question about the following two modules. Suppose you
want to write your own variant of the prelude that redefines a couple
of names but leaves all the rest unchanged. The Haskell report says
that the following should work:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
module BUG2A (module BUG2A, module Prelude) where
import Prelude hiding (head)
head = "HEAD"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This overrides the definition of head and should reexport head along
with everything imported from the Prelude. Hugs98/feb2001 loads it
happily and says head :: [Char]
Now, I want to use this module as an alternative prelude:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
module BUG2B where
import qualified Prelude
import BUG2A
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unfortunately, this does not behave as (I think) it should:
Reading file "BUG2B.hs":
Parsing........................................................................
ERROR "BUG2B.hs": Entity "head" imported from module "BUG2A" already defined in module "Prelude"
However, this should be legal from my reading of the report.
Any help appreciated.
-Peter
From mthomas@gil.com.au Tue Mar 20 22:14:03 2001
From: mthomas@gil.com.au (Mike Thomas)
Date: Wed, 21 Mar 2001 08:14:03 +1000
Subject: GHC Mingw32 build
Message-ID: <000901c0b18b$13e4b4e0$ea332fca@snowpea>
Hi all..
What is the recommended way of making the Mingw32 build of GHC and all
associated tools, eg HDirect, Green-card etc from the CVS?
Cheers
Mike Thomas
From ru@river.org Wed Mar 21 07:40:28 2001
From: ru@river.org (Richard Uhtenwoldt)
Date: Tue, 20 Mar 2001 23:40:28 -0800 (PST)
Subject: Coroutines
In-Reply-To:
References: <20010319225645.A25257@rz.uni-karlsruhe.de>
Message-ID: <200103210740.XAA13592@ohio.river.org>
Andreas Gruenbacher writes:
>It's not what I had in mind, though. Simon's MVars (in the Awkward Squad)
>come pretty close, but they're still not the sort of (cooperative)
>multitasking that I'm thinking of.
I hope I'm not being too fussy, but seems to me that the CVar is what
is needed, not the MVar:
>main=
> newCVar >>= \l0 ->
> newCVar >>= \l1 ->
> newCVar >>= \l2 ->
> forkIO readInputLineAtATime l0 >>
> forkIO printHeader "silly header" l0 l1 >>
> forkIO numberLines 0 l1 l2 >>
> printOutputLineAtATime l2
(untested code.)
From fis@ssh.com Wed Mar 21 10:01:20 2001
From: fis@ssh.com (Matthias Fischmann)
Date: 21 Mar 2001 12:01:20 +0200
Subject: modules and re-export
In-Reply-To: Peter Thiemann's message of "20 Mar 2001 17:55:39 +0100"
References:
Message-ID: <877l1jmoen.fsf@dengue.local>
Peter Thiemann writes:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> module BUG2A (module BUG2A, module Prelude) where
> import Prelude hiding (head)
> head = "HEAD"
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> module BUG2B where
> import qualified Prelude
> import BUG2A
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Unfortunately, this does not behave as (I think) it should:
> [...]
ghc-4.08.1 compiles it without complaining. A Hugs98 bug?
-Matthias
From richard_adams@non.hp.com Wed Mar 21 19:24:15 2001
From: richard_adams@non.hp.com (ADAMS,RICHARD (Non-HP-Roseville,ex1))
Date: Wed, 21 Mar 2001 12:24:15 -0700
Subject: Question concerning ftp and GHC binaries for HP-UX
Message-ID: <499DC368E25AD411B3F100902740AD655A7CD6@xrose03.rose.hp.com>
I would like to download the GHC binaries to our HP 9000 machine (HP-UX
11.0), but have access only to ftp (i.e., no Web browser is available).
Does anyone know what ftp address to use? Also, does anyone know whether
the GHC binaries for the HP-UX operating system will work on HP-UX 11.0?
I am not sure whether it is relevant, but I use Reflection terminal
emulation to telnet from my PC to the HP 9000 machine. Truly 'hi-tech' :) .
Thank you.
Sincerely,
Richard E. Adams
Softmatrix, Inc.
Roseville, CA
Email: richard_adams@non.hp.com
From sigbjorn_finne@hotmail.com Wed Mar 21 21:14:58 2001
From: sigbjorn_finne@hotmail.com (Sigbjorn Finne)
Date: Wed, 21 Mar 2001 22:14:58 +0100
Subject: modules and re-export
Message-ID:
Peter Thiemann thiemann@informatik.uni-freiburg.de writes:
>
> I have a little question about the following two modules. Suppose you
> want to write your own variant of the prelude that redefines a couple
> of names but leaves all the rest unchanged. The Haskell report says
> that the following should work:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> module BUG2A (module BUG2A, module Prelude) where
>
> import Prelude hiding (head)
>
> head = "HEAD"
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
....
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> module BUG2B where
>
> import qualified Prelude
> import BUG2A
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Unfortunately, this does not behave as (I think) it should:
>
> Reading file "BUG2B.hs":
>
Parsing.....................................................................
...
> ERROR "BUG2B.hs": Entity "head" imported from module "BUG2A" already
> defined in module "Prelude"
>
> However, this should be legal from my reading of the report.
Hi Peter,
yep, that's right, and it is a known wrinkle in Hugs' implementation of
modules.
I submitted a source fix which addresses just this a couple of weeks ago,
http://haskell.cs.yale.edu/pipermail/hugs-bugs/2001-March/000184.html
hopefully it will be included in future releases of Hugs98.
hth
--sigbjorn
From nordland@cse.ogi.edu Wed Mar 21 22:26:56 2001
From: nordland@cse.ogi.edu (Johan Nordlander)
Date: Wed, 21 Mar 2001 14:26:56 -0800
Subject: modules and re-export
References:
Message-ID: <3AB92AB0.1DCEF3C3@cse.ogi.edu>
Sigbjorn Finne wrote:
>
> Peter Thiemann thiemann@informatik.uni-freiburg.de writes:
> >
> > I have a little question about the following two modules. Suppose you
> > want to write your own variant of the prelude that redefines a couple
> > of names but leaves all the rest unchanged. The Haskell report says
> > that the following should work:
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > module BUG2A (module BUG2A, module Prelude) where
> >
> > import Prelude hiding (head)
> >
> > head = "HEAD"
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ....
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > module BUG2B where
> >
> > import qualified Prelude
> > import BUG2A
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > Unfortunately, this does not behave as (I think) it should:
> >
> > Reading file "BUG2B.hs":
> >
> Parsing.....................................................................
> ...
> > ERROR "BUG2B.hs": Entity "head" imported from module "BUG2A" already
> > defined in module "Prelude"
> >
> > However, this should be legal from my reading of the report.
>
> Hi Peter,
>
> yep, that's right, and it is a known wrinkle in Hugs' implementation of
> modules.
> I submitted a source fix which addresses just this a couple of weeks ago,
>
> http://haskell.cs.yale.edu/pipermail/hugs-bugs/2001-March/000184.html
>
> hopefully it will be included in future releases of Hugs98.
>
> hth
> --sigbjorn
Hi all,
The fix will indeed be included in the next Hugs release (thanks
Sigbjorn!); in fact it can be tried right away by checking out the
latest revision from the cvs repository. See http://cvs.haskell.org/
for further details.
Cheers,
Johan
From ltaesch@europemail.com Thu Mar 22 06:39:02 2001
From: ltaesch@europemail.com (luc)
Date: Thu, 22 Mar 2001 06:39:02 +0000
Subject: Welcome to the "Haskell" mailing list
References: <20010321203800.7DBE1255AB@www.haskell.org>
Message-ID: <3AB99E06.C7B3A158@europemail.com>
haskell-request@haskell.org wrote:
> Welcome to the Haskell@haskell.org mailing list!
>
> To post to this list, send your email to:
>
> c
>
hi. im just a newcomer to haskell (www.taesch.com). quite impressed till now
!
im trying to have haxml lib running with hugs and had the following problem
:
1) under win, quite an issue to tun the cpp stuff. did it under linux, (for
info)
2) then i had a "maybeA" which is unknown. some lib i had to add ? ("maybe"
doesnt seems to work)
3) a module declare a "with" function, which hugs doenst seem to like .
renamed it withlt for now.
this make me thinks that this lib is probably not tested under hugs98. could
someone confirm that ? as im too newbies, im maybe missing something
obvious. Id better asking, i thought.
thanks
Luc
From Malcolm.Wallace@cs.york.ac.uk Thu Mar 22 21:19:45 2001
From: Malcolm.Wallace@cs.york.ac.uk (Malcolm Wallace)
Date: Thu, 22 Mar 2001 21:19:45 +0000
Subject: HaXml (was: Re: Welcome to the "Haskell" mailing list)
In-Reply-To: <3AB99E06.C7B3A158@europemail.com>
Message-ID: <4GcAAHJsujpELAIA@cs.york.ac.uk>
> im trying to have haxml lib running with hugs and had the following problem
> 1) under win, quite an issue to tun the cpp stuff. did it under linux, (for
> info)
Thanks for the report. I'll think some more about how to package
HaXml to make things easier for Hugs users.
> 2) then i had a "maybeA" which is unknown. some lib i had to add ? ("maybe"
> doesnt seems to work)
The only use of "maybeA" is in a comment containing some example
code for documentation purposes. It appears that this example is
now out of date, for which, apologies. If you want to use the
example, you need to rename "maybeA" to "maybeToAttr".
> 3) a module declare a "with" function, which hugs doenst seem to like.
> renamed it withlt for now.
"with" is a perfectly valid Haskell function name, but Hugs may have
stolen it for a language extension. Try giving Hugs the +98 option
at startup, to ensure that all extensions are turned off. [Note to
users of the implicit parameter extension: I believe in future the
pseudo-keyword "with" will be removed and replaced by "let".]
> this make me thinks that this lib is probably not tested under hugs98. could
> someone confirm that ? as im too newbies, im maybe missing something
> obvious. Id better asking, i thought.
HaXml is occasionally tested with Hugs98, but not as often as we
test it with other compilers. Soon however, we are hoping to have
a grand hierarchy of standard libraries for Haskell (including HaXml
amongst many others), which will be completely compiler-independent,
and tested regularly with all three or four currently-available
compilers/interpreters. This should greatly improve the portability
of a lot of publically-available Haskell code.
Regards,
Malcolm
From jens-ulrik.petersen@nokia.com Fri Mar 23 03:26:41 2001
From: jens-ulrik.petersen@nokia.com (Jens-Ulrik Petersen)
Date: 23 Mar 2001 12:26:41 +0900
Subject: url update for Asperti & Longo: "Categories, Types and Structures"
In-Reply-To: "Frank Atanassow"'s message of "Fri, 9 Mar 2001 21:33:09 +0100"
References: <20010309213309.A1440@cs.uu.nl>
Message-ID:
Hi Frank,
Thanks for making . Good
idea!
"Frank Atanassow" writes:
> [1] Andrea Asperti and Giussepe Longo. Categories, Types and Structures. An
> introduction to Category Theory for the working computer
> scientist. MIT Press, 1991.
> URL: http://www.dmi.ens.fr/users/longo/download.html
It seems ENS's DMI bifurcated... the current url is now
http://www.di.ens.fr/users/longo/download.html
Maybe you could update the link on your page too.
Thanks, Jens
From sambat_101@yahoo.com Fri Mar 23 12:46:44 2001
From: sambat_101@yahoo.com (Bark Fook)
Date: Fri, 23 Mar 2001 04:46:44 -0800 (PST)
Subject: Question concerning ftp and GHC binaries for HP-UX
In-Reply-To: <20010322170103.8E2B7255C0@www.haskell.org>
Message-ID: <20010323124644.3094.qmail@web5505.mail.yahoo.com>
> Message: 1
> From: "ADAMS,RICHARD (Non-HP-Roseville,ex1)"
>
> To: "'haskell@haskell.org'"
> Subject: Question concerning ftp and GHC binaries
> for HP-UX
> Date: Wed, 21 Mar 2001 12:24:15 -0700
>
> I would like to download the GHC binaries to our HP
> 9000 machine (HP-UX
> 11.0), but have access only to ftp (i.e., no Web
> browser is available).
> Does anyone know what ftp address to use? Also,
> does anyone know whether
> the GHC binaries for the HP-UX operating system will
> work on HP-UX 11.0?
>
> I am not sure whether it is relevant, but I use
> Reflection terminal
> emulation to telnet from my PC to the HP 9000
> machine. Truly 'hi-tech' :) .
>
> Thank you.
>
> Sincerely,
>
> Richard E. Adams
> Softmatrix, Inc.
> Roseville, CA
> Email: richard_adams@non.hp.com
>
I encountered the same problem of downloading with
ftp. However, even if you succeeded in downloading, I
guess it would not work as we wish:(. The system I use
is HP-UX 11.00 (64-bit) HPPA 2.0. And I downloaded the
version 4.08.2 for hppa1.1-hp-hpux with HTTP. It ran
(without explicit errors) and output sth when input
sth.hs. However, each time when I ran the sth, I got
core dump. I tried to recompile the compiler (or even
Happy), of course, failed with the same symptom (or
unHappy). If I know anyone has successfully run GHC
without incurring core dumps in HP-UX 11.00 (64-bit),
I'll be very happy if Happy works too:). If I have
enough time, I wish I could port it to HP-UX 11.00
(64-bit). I'm very glad to know if there exists
somebody who will aid me or play together with me over
64-bit ghc for 64-bit HPUXes. Should I attack the
problem from HBC or nhc98?
One more bad news, SMLNJ works on HP-UX 10.20, not on
HP-UX 11.00, either:-(. I've tried and failed too.
One more good news, Hugs98-Feb2001 does work in HP-UX
11.00 (64-bit). I swear, where only very few tweaks
are needed. But I guess it's running in 32-bit
mode:-).
The last kisstion: Can I build ghc from Hugs, my god?
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
From Malcolm.Wallace@cs.york.ac.uk Fri Mar 23 16:24:18 2001
From: Malcolm.Wallace@cs.york.ac.uk (Malcolm Wallace)
Date: Fri, 23 Mar 2001 16:24:18 +0000
Subject: Question concerning ftp and GHC binaries for HP-UX
In-Reply-To: <20010323124644.3094.qmail@web5505.mail.yahoo.com>
Message-ID: