ghc-5.02.2-i386-unknown-linux.tar.bz2

2002-04-08 Thread Byron Hale

Hi,

I downloaded and installed ghc-5.02.2-i386-unknown-linux.tar.bz2 on my
RedHat Linux 6.2 box (because RPM won't install the relevant RPMs).
However, when I run ghci, I get  the message ... GHC ... 5.02.1 ...

What do you think is happening here?

Best Regards,

Byron Hale
[EMAIL PROTECTED]


___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



ANNOUNCE: Object I/O released

2002-04-08 Thread Krasimir Angelov

   PThe first release, 0.1, of Object I/O is now
available.
PThe Object I/O for Haskell library is a port of
standard Clean Object I/O library. The general
structure of the Haskell version is inherited from the
original library but there are also few differences
provoked from the languages differences.

PObject I/O allows Haskell programmers to build rich
graphical user interface. This release support only
Windows platform. Features include:

P* Modal and nonmodal dialogs

P* Nonmodal resizeable windows

P* Toolbars and menus

P* Various kind of controls and possibility to build
custom controls

P* Layout manager for controls

P* Timers. The timer simplifies building of little
games. See examples.

P* Support for file opening with drag  drop

PQuick reference is available from:
A
href=http://free.top.bg/ka2_mail/objectio-ref.zip;
http://free.top.bg/ka2_mail/objectio-ref.zip/A

PBinary package compiled with GHC-5.02.1
A href=http://free.top.bg/ka2_mail/objectio.zip;
http://free.top.bg/ka2_mail/objectio.zip/A

PExamples
A
href=http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/hslibs/object-io/Examples;http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/hslibs/object-io/Examples/A

PSource package
A
href=http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/hslibs/object-io;http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/hslibs/object-io/A


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: Fundep/Existential Types in 5.03

2002-04-08 Thread Simon Peyton-Jones

Ashley

Just leave out the existential in your defn of D!
The (C a b) in the defn of f will do the job.

But your example nevertheless does expose a delicate interaction in the
type checker.  5.02.2 happened not to expose the functional
dependency, so it simply use the (C a b) that f provided.
5.03 does expose the dependency, and so makes the two
b's the same, which is what gives the error message.

It's a problem that some subtlety in the inference algorithm
(I don't even know what it is) changes the behaviour.  I don't
know how to fix this, but perhaps someone else does.

GHC makes all type abstractions and applications explicit,
so the two b's really can't be the same: they don't have the
same scope.

Simon

| -Original Message-
| From: Ashley Yakeley [mailto:[EMAIL PROTECTED]] 
| Sent: 06 April 2002 02:00
| To: GHC List
| Subject: Fundep/Existential Types in 5.03
| 
| 
| Consider this:
| 
|   module Test3 where
| 
|   class C a b | a - b where
|   m :: a - b
| 
|   data D a = forall b. (C a b) = MkD a
| 
|   f :: (C a b) = D a - b
|   f (MkD a) = m a
| 
| This compiles fine under GHC 5.02.2. But under 5.03, it gives 
| an error:
| 
| Model/Test3.hs:9:
| Inferred type is less polymorphic than expected
| Quantified type variable `b' escapes
| When checking an existential match that binds
| and whose type is D a - b1
| In the definition of `f': f (MkD a) = m a
| 
| I consider that the 5.02.2 behaviour is preferable, and that 
| this is a 
| perfectly good program. 'b' does not escape because it is 
| fundep on 'a', 
| which is specified in the type-signature. There can be only one.
| 
| What was changed in 5.03 and why?
| 
| -- 
| Ashley Yakeley, Seattle WA
| 
| ___
| Glasgow-haskell-users mailing list 
| [EMAIL PROTECTED] 
| http://www.haskell.org/mailman/listinfo/glasgow-| haskell-users
| 
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: ANNOUNCE: Object I/O released

2002-04-08 Thread Krasimir Angelov


--- Simon Peyton-Jones [EMAIL PROTECTED] wrote:
 Well done!
 
 You never responded to my question about MVars...
 
 Simon

   The version that I release is based entirely on LS
version. I think that it is more elegant and more
useful for customer. 

   1) In the MVAR version each event handler must like
this:

eventHandler state = do
   st - takeMVar state
   ...
   ...
   putMVAR state st'

In LS version there isn't need of takeMVar/putMVAR and
the handler is more easy. 

   2) In MVAR version the event handlers in the device
definitions must be defined as curry functions

Example MVAR:
   state - newMVAR (0::Int)
   openWindow (Window NilLS [WindowClose (closeWin
state)])

Example LS:
   openWindow (0::Int) (Window NilLS [WindowClose
closeWin])

   3) Modification of local state doesn't mean
modification of device behaviour. The behaviour of the
device is described with both local state and internal
device data. This means that direct access to the
state isn't a good idea. In the LS version the local
state is encapsulated in the device and I think that
this is more OOP style. Communication between devices
is posible only with message dispatching, that is
better object oriented tehnology.

__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: ghc 5.02.2 FFI question

2002-04-08 Thread Simon Marlow

Hi Bernie,

 I've been playing with the FFI in GHC 5.02.2
 
 I'm not sure if I'm using it correctly because I get a space leak
 in my program.

I just tried your example and it seems to run in constant space here
with 5.02.2.  The code looks fine - this isn't something we really
envisaged people doing with the RTS API, but there's no real problem
with it except that of course you don't get the benefits of type
checking.  I'm sure you have very good reasons for building Haskell
expressions in C :-)

Can you give us any more clues?  What were the symptoms when you ran it?

Cheers,
Simon
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: An answer and a question to GHC implementors [was Re: How to make Claessen's Refs Ord-able?]

2002-04-08 Thread Simon Marlow


 A while back I asked how to make the Ref's from Koen Clasessen's PhD
 thesis Ord-able for the purpose of making them keys for efficient
 finite maps.
 
 Koen quickly responded with a clever implementation which attaches the
 values to the keys.  While I don't rule out eventually making use of
 it, this solution has the drawback of requiring lookups in the finite
 map to be inside the ST or IO monad.
 
 Josef Svenningsson asked if I had tried adding 
   {-# NOINLINE refWInt #-}
 I had (quite hopefully.)  It doesn't work.  After fiddling a bit to
 get a sense of what works and what doesn't, I tried:
   {-# INLINE refWInt #-}
 .  This does the trick!  I've included the working code (which differs
 from that of my original message only by the addition of the INLINE
 directive) below.

 My question to the GHC implementors is: what's going on here?  Can you
 give us (at least Josef and I are confused) any help in predicting how
 unsafePerformIO will behave?

I'm afraid the answer is just unsafePerformIO is called
*unsafe*PerformIO for a reason!  You're using it in an inherently
unsafe way here - the result of the program depends on whether the
compiler duplicates the expression or not, something which it is
normally free to do without affecting the meaning of the program.

However, it is possible to have global top-level references using
unsafePerformIO if you're very careful about it.  In GHC we do something
like this:

{-# NOINLINE global_var #-}
global_var :: IORef Int
global_var = unsafePerformIO (newIORef 42)

the NOINLINE pragma is used to ensure that there is precisely *one* copy
of the right hand side of global_var in the resulting program (NOTE: you
also need to compile the program with -fno-cse to ensure that the
compiler doesn't also common up the RHS of global_var with other similar
top-level definitions).

Cheers,
Simon
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: ANNOUNCE: Object I/O released

2002-04-08 Thread Simon Peyton-Jones

Krasimir

|The version that I release is based entirely on LS
| version. I think that it is more elegant and more
| useful for customer. 

I'm delighted and impressed that you have completed the Object I/O
port, but I don't think I agree with you about the MVar/LS issue.

A note to other readers: the issue is whether it is better, from
the programmer's point of view, to use MVars to manipulate
state, or to use the state parameterisation that Clean uses.
This issue is discussed in the paper by Peter Achten and mself
  http://research.microsoft.com/~simonpj/Papers/haskellobjectio.htm


My defence of the MVar approach is not because I simply 
think that MVars are best for everything!
It's because I have really struggled to understand the types in the
Clean I/O system, and they become *so* much simpler when the
state parameterisation is left out.  And if I struggle, then I fear that
novice programmers may be in real difficulty.

I think that even Peter Achten thought this too, having done it both
ways (but I should let him speak for himself).

To respond to your points:

|1) In the MVAR version each event handler must like
| this:
| 
| eventHandler state = do
|st - takeMVar state
|...
|...
|putMVAR state st'
| 
| In LS version there isn't need of takeMVar/putMVAR and
| the handler is more easy. 
| 
|2) In MVAR version the event handlers in the device 
| definitions must be defined as curry functions
| 
| Example MVAR:
|state - newMVAR (0::Int)
|openWindow (Window NilLS [WindowClose (closeWin
| state)])
| 
| Example LS:
|openWindow (0::Int) (Window NilLS [WindowClose
| closeWin])

Both are true, but you can easily wrap up the state passing
if that is what you want:

 state - newMVAR (0::Int)
 openWindow (Window NilLS [WindowClose (handle state closeWin)])

handle :: MVar a - (a - IO a) - IO ()
handle m t = do { s - getMVar m; r - t s'; putMVar m s' }

Now you can write closeWin :: WinState - IO WinState
if you want.  

Of course the reference to the state is still explicit, but I do not
think that is a bad thing.  It tells you where that MVar can be modified
(and where it can't!).  There might be two pieces of state for one
component,
one modified by one set of events and one by another, and it would be
nice
to make that apparent.

|3) Modification of local state doesn't mean
| modification of device behaviour. The behaviour of the
| device is described with both local state and internal
| device data. This means that direct access to the
| state isn't a good idea. In the LS version the local
| state is encapsulated in the device and I think that
| this is more OOP style. 

I don't understand this; you can encapsulate the MVars too, in just
the same way:

windowDevice = do { s - newMVar 0;
openWindow ... }

No caller of WindowDevice can see the encapsulated MVar.

Simon
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: Fundep/Existential Types in 5.03

2002-04-08 Thread Simon Peyton-Jones

I don't know how to make existentials know about functional
dependencies.  In the type system that GHC implements, your
example fails, and I don't see any meaningful way to make it
succeed.  But maybe someone else does.

Simon

| -Original Message-
| From: Ashley Yakeley [mailto:[EMAIL PROTECTED]] 
| Sent: 08 April 2002 10:30
| To: Simon Peyton-Jones; GHC List
| Cc: Mark Shields
| Subject: RE: Fundep/Existential Types in 5.03
| 
| 
| At 2002-04-08 02:15, Simon Peyton-Jones wrote:
| 
| Just leave out the existential in your defn of D!
| The (C a b) in the defn of f will do the job.
| 
| I have another example, but this fails in 5.02.2:
| 
|   class C a b | a - b
| 
|   data D a = forall b. (C a b) = MkD b
| 
|   f :: (C a b) = D a - b
|   f (MkD b) = b
| 
| Should this compile? It looks meaningful to me.
| 
| 
| -- 
| Ashley Yakeley, Seattle WA
| 
| 
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



ANNOUNCE: GHC 5.02.3 released

2002-04-08 Thread Simon Marlow


   The (Interactive) Glasgow Haskell Compiler -- version 5.02.3
  ==

We are pleased to announce a new patchlevel release of the Glasgow
Haskell Compiler (GHC), version 5.02.3.  The source distribution is
freely available via the World-Wide Web, under a BSD-style license.
See below for download details.  Pre-built packages for Linux,
FreeBSD, Solaris and Win32 are also available (or will appear
shortly).

Haskell is a standard lazy functional programming language; the
current language version is Haskell 98, agreed in December 1998.

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

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

http://www.haskell.org/

GHC's Web page lives at

http://www.haskell.org/ghc/



 What's new in 5.02.3
==

Some important bugfixes:

   - now works with gcc 3.x
 
   - works with newer glibc releases on Linux

   - loading parsers generated by Happy with the -ag flags
 into GHCi now works

   - fix for excessive recompilation when using --make

   - tryTakeMVar now works

   - fix some problems with the dynamic linker when loading
 C libraries into GHCi (using Gtk+HS from GHCi should now
 work).

and various other minor fixes.

NOTE: object files created by this vesrion of GHC may be incompatible
with object files created by older versions of GHC, so be sure to
recompile any pre-compiled libraries you may have lying around.


 How to get it
===

The easy way is to go to the WWW page, which should be
self-explanatory:

http://www.haskell.org/ghc/

We supply binary builds in the native package format for various
flavours of Linux and BSD, and in InstallShield form for Windows
folks.  Everybody else gets a .tar.gz which can be installed where you
want.

Once you have the distribution, please follow the pointers in the
README file to find all of the documentation about this release.



 On-line GHC-related resources
===

Relevant URLs on the World-Wide Web:

GHC home page http://www.haskell.org/ghc/
Haskell home page http://www.haskell.org/
comp.lang.functional FAQ  http://www.cs.nott.ac.uk/~gmh/faq.html



 System requirements
=

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

  * i386-unknown-{linux,freebsd,mingw32}
  * sparc-sun-solaris2
  * alpha-dec-osf3

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

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

The builder's guide included in distribution gives a complete
run-down of what ports work; an on-line version can be found at

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



 Mailing lists
===

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

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

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

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

Please report bugs using our SourceForge page at

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

or send them to [EMAIL PROTECTED]

GHC users hang out on [EMAIL PROTECTED]  Bleeding
edge CVS users party on [EMAIL PROTECTED]
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: ANNOUNCE: Object I/O released

2002-04-08 Thread Krasimir Angelov

--- Peter Achten [EMAIL PROTECTED] wrote:

 Perhaps there is an interesting alternative that 
 covers all GOOD points and has fewer BAD points.

Some pieces of library can be simplified if redefine:

data WindowLSHandle ls ps
   = WindowLSHandle
{ wlsState:: ls
, wlsHandle   :: WindowHandle ls ps
}

as

data WindowLSHandle ls ps
   = WindowLSHandle
{ wlsState:: MVar ls-- or IORef ls
, wlsHandle   :: WindowHandle ls ps
}

That let Object I/O to manage local state but
simplifies implementation of WindowDevice (see
WindowDevice.hs). There isn't need of fixIO and not
need to use of build function. This also simplifies
creation of modal dialogs and synchronous message
passing. The current implementation uses
unsafeTypeCast function which is not a good idea. 
In this implementation the type system is still
complicated but my decision is just to skip type
declarations and let compiler to resolve function
types for me. In my experience with Object I/O I
notice that type error is usually logical error. So
types for me isn't a trouble.

__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: ghc-5.02.2-i386-unknown-linux.tar.bz2

2002-04-08 Thread Byron Hale

At 11:40 AM 4/8/2002 +0100, you wrote:

  I downloaded and installed ghc-5.02.2-i386-unknown-linux.tar.bz2 on my
  RedHat Linux 6.2 box (because RPM won't install the relevant RPMs).
  However, when I run ghci, I get  the message ... GHC ...
  5.02.1 ...
 
  What do you think is happening here?

What do you get from 'ghc --version'?

It came from the haskell.org download page.  Version 5.02.1 was previously 
installed, as Serge Mechveliani inquired. I installed it as
the super-user at the root of the file system.

Perhaps I should now consider Version 5.02.3, but the problem may
recur. I got this version of RHL from RH over the Web and finally
realize that I need to register with RH for support. That is the ultimate 
solution, but there may be a delay in executing it. It is at least worth
understanding.

Thanks,

Byron Hale
[EMAIL PROTECTED]


Simon
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



GHCi and -O [was: Re: ANNOUNCE: GHC 5.02.3 released]

2002-04-08 Thread Till Doerges

On Mon, Apr 08, 2002 at 01:13:13PM +0100, Simon Marlow wrote:

The (Interactive) Glasgow Haskell Compiler -- version 5.02.3

Nice. :-)

 NOTE: object files created by this vesrion of GHC may be incompatible
 with object files created by older versions of GHC, so be sure to
 recompile any pre-compiled libraries you may have lying around.

This made me think about using *.o-files in GHCi generated w/ 'ghc
-O2'. My GHCi (currently 5.00.2) states:

--- snip ---
warning: -O conflicts with --interactive; -O turned off.
--- snap ---

if I pass -O2 to ghci.

Additionally, I recall some core-dumps or having ghci sometimes report
missing symbols if using some modules compiled w/ optimization.

So, is GHCi supposed to work w/ optimized modules after all? The
documentation merely suggests, this might be possible:

--- snip --- 
Why should we want to run compiled code? Well, compiled code is
roughly 10x faster than interpreted code, but takes about 2x longer to
produce (perhaps longer if optimisation is on). So it pays to compile
the parts of a program that aren't changing very often, and use the
interpreter for the code being actively developed.
--- snap ---

Thanks -- Till
-- 
 e-mail: reverse(net dot doerges at till)   | ENCRYPTED |
pgp/gpg: keys via keyserver or my homepage  |  MAIL IS  |
www: http://www.doerges.net |  WELCOME! |
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



ANNOUNCE: Object I/O released

2002-04-08 Thread Krasimir Angelov

   PThe first release, 0.1, of Object I/O is now
available.
PThe Object I/O for Haskell library is a port of
standard Clean Object I/O library. The general
structure of the Haskell version is inherited from the
original library but there are also few differences
provoked from the languages differences.

PObject I/O allows Haskell programmers to build rich
graphical user interface. This release support only
Windows platform. Features include:

P* Modal and nonmodal dialogs

P* Nonmodal resizeable windows

P* Toolbars and menus

P* Various kind of controls and possibility to build
custom controls

P* Layout manager for controls

P* Timers. The timer simplifies building of little
games. See examples.

P* Support for file opening with drag  drop

PQuick reference is available from:
A
href=http://free.top.bg/ka2_mail/objectio-ref.zip;
http://free.top.bg/ka2_mail/objectio-ref.zip/A

PBinary package compiled with GHC-5.02.1
A href=http://free.top.bg/ka2_mail/objectio.zip;
http://free.top.bg/ka2_mail/objectio.zip/A

PExamples
A
href=http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/hslibs/object-io/Examples;http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/hslibs/object-io/Examples/A

PSource package
A
href=http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/hslibs/object-io;http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/hslibs/object-io/A


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell



Re: String type in Socket I/O

2002-04-08 Thread dominic . j . steinitz


Having written a Haskell LDAP interface, this is something that worried me
but I never got to the bottom of. I've cross-posted this to haskell
(hopefully the right place). There was some discussion of replacing Char by
a type for raw bytes / octets but I'm not sure what happened to it.

Dominic.




Warrick Gray [EMAIL PROTECTED]@haskell.org on 07/04/2002 13:31:41

Sent by:  [EMAIL PROTECTED]


To:   libraries
cc:
bcc:
Subject:  String type in Socket I/O


Hi all,

I am writing an HTTP client-side library, using the SocketPrim library.
During the implementation of Base64 encode/decode I began to have some
doubts over the use of the Char type for socket I/O.

As far as I can tell, sendTo and recvFrom are simply handles on the
underlying OS calls.  My winsock2.h file tells me the data passed into and
received from these functions are C style chars, 8 bits each.  In unix
these
functions (sys/sockets.h) appear to use a C void pointer.  Finally I notice
that the Haskell98 report defines Haskell Char as a Unicode char (which I
figure isn't guaranteed 8 bits).

So I am curious, what happens when I send these unicode Haskell chars to
the
SocketPrim.sendTo function?  My current guess is that the low 8 bits of
each
Char become a C style char.  My base64 encoding and decoding functions sort
of make this assumption, by ripping out the low 8 bits of chars before
encoding this binary representation (3x8bit chars become 4x6bit base64
chars).

So far everything works fine, but is this approach going to break in the
near future?  What I would like to see are socket functions that do not
introduce this extra level of binary indirection, perhaps using a
ByteArray,
or Word8 (as I see has previously been discussed -
http://www.haskell.org/pipermail/libraries/2001-August/000482.html).  How
realistic is this?

Warrick.



_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.

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







  
-

  Save time by using an eTicket and our Self-Service Check-in Kiosks.
  For more information go to http://www.britishairways.com/eservice1


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



do notation and

2002-04-08 Thread Simon Peyton-Jones

Folks

Following a good deal of email I now propose to

DO NOTHING

to the rules defining do-notation in the Haskell 98 Report.  
That means that GHC and Hugs, and nhc perhaps, should 
change so that they actually implement the do-notation 
translation rule

  do {e ; stmts}   =   e  do {stmts}

using () and not (=).

From my reading of the email, some people will agree strongly,
and no one will disagree strongly.  I suppose I could be wrong about
this, though.

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



Re: Parsec: No newline after last line and 'many'

2002-04-08 Thread Daan Leijen

Hi Till,

My guess is that you want to break up a text file into
a list of lines with Parsec. (ie. lines functionality).
A text file consists of non-newline characters seperated by
newline characters:

 import Parsec

 plines :: Parser [String]
 plines  = (many (noneOf \n)) `sepBy` newline

You don't need any try or manyTill here. It seems to 
work on my system but I haven't tested it exhaustively.

 TestLine parseTest linep (hi\nTill)
 [hi,Till]
 
 TestLine parseTest linep (hi\nTill\n)
 [hi,Till,]
 
 TestLine parseTest linep (hi\n\nTill\n)
 [hi,,Till,]

I hope this helps, 
All the best,
Daan.


- Original Message - 
From: Till Doerges [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, April 07, 2002 11:04 PM
Subject: Re: Parsec: No newline after last line and 'many'


 On Sun, Apr 07, 2002 at 07:44:42PM +0200, Till Doerges wrote:
 
  Eventually I want to be able to use my parser 'linep' with 'many' on
  no matter which text-files.
 
 'manyTill linep eof' and is what I wanted (looking at my first name, I
 should have gotten that one earlier... ;-)
 
 Bye -- Till
 ___
 Haskell mailing list
 [EMAIL PROTECTED]
 http://www.haskell.org/mailman/listinfo/haskell
 
 


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



ANNOUNCE: GHC 5.02.3 released

2002-04-08 Thread Simon Marlow


   The (Interactive) Glasgow Haskell Compiler -- version 5.02.3
  ==

We are pleased to announce a new patchlevel release of the Glasgow
Haskell Compiler (GHC), version 5.02.3.  The source distribution is
freely available via the World-Wide Web, under a BSD-style license.
See below for download details.  Pre-built packages for Linux,
FreeBSD, Solaris and Win32 are also available (or will appear
shortly).

Haskell is a standard lazy functional programming language; the
current language version is Haskell 98, agreed in December 1998.

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

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

http://www.haskell.org/

GHC's Web page lives at

http://www.haskell.org/ghc/



 What's new in 5.02.3
==

Some important bugfixes:

   - now works with gcc 3.x
 
   - works with newer glibc releases on Linux

   - loading parsers generated by Happy with the -ag flags
 into GHCi now works

   - fix for excessive recompilation when using --make

   - tryTakeMVar now works

   - fix some problems with the dynamic linker when loading
 C libraries into GHCi (using Gtk+HS from GHCi should now
 work).

and various other minor fixes.

NOTE: object files created by this vesrion of GHC may be incompatible
with object files created by older versions of GHC, so be sure to
recompile any pre-compiled libraries you may have lying around.


 How to get it
===

The easy way is to go to the WWW page, which should be
self-explanatory:

http://www.haskell.org/ghc/

We supply binary builds in the native package format for various
flavours of Linux and BSD, and in InstallShield form for Windows
folks.  Everybody else gets a .tar.gz which can be installed where you
want.

Once you have the distribution, please follow the pointers in the
README file to find all of the documentation about this release.



 On-line GHC-related resources
===

Relevant URLs on the World-Wide Web:

GHC home page http://www.haskell.org/ghc/
Haskell home page http://www.haskell.org/
comp.lang.functional FAQ  http://www.cs.nott.ac.uk/~gmh/faq.html



 System requirements
=

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

  * i386-unknown-{linux,freebsd,mingw32}
  * sparc-sun-solaris2
  * alpha-dec-osf3

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

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

The builder's guide included in distribution gives a complete
run-down of what ports work; an on-line version can be found at

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



 Mailing lists
===

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

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

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

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

Please report bugs using our SourceForge page at

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

or send them to [EMAIL PROTECTED]

GHC users hang out on [EMAIL PROTECTED]  Bleeding
edge CVS users party on [EMAIL PROTECTED]
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell



RE: ANNOUNCE: Object I/O released

2002-04-08 Thread Peter Achten

Hello Krasimir,

I am very curious about your implementation of the Object I/O system, but 
unfortunately could not open the .zip files either (same symptoms as Arjan 
van IJzendoorn wrote). Could you check the formats of these files? Thanks 
in advance.

Simon Peyton-Jones wrote:
Krasimir

|The version that I release is based entirely on LS
| version. I think that it is more elegant and more
| useful for customer.

I'm delighted and impressed that you have completed the Object I/O
port, but I don't think I agree with you about the MVar/LS issue.

 A note to other readers: the issue is whether it is better, from
 the programmer's point of view, to use MVars to manipulate
 state, or to use the state parameterisation that Clean uses.
 This issue is discussed in the paper by Peter Achten and mself
   http://research.microsoft.com/~simonpj/Papers/haskellobjectio.htm

My defence of the MVar approach is not because I simply
think that MVars are best for everything!
It's because I have really struggled to understand the types in the
Clean I/O system, and they become *so* much simpler when the
state parameterisation is left out.  And if I struggle, then I fear that
novice programmers may be in real difficulty.

I think that even Peter Achten thought this too, having done it both
ways (but I should let him speak for himself).

This issue was one of the key design issues Simon and I had to resolve when 
porting the Clean Object I/O system to Haskell. The arguments in the above 
mentioned paper are still valid. Briefly, one can summarise them as: MVar-s 
offer many significant advantages (simpler types, simpler implementation, 
more expressive power, programming style similar to handling of identifier 
values) but have one disadvantage (state management is done by the 
programmer).

As it happens, I am about to spend a couple of weeks 
(re)designing/implementing/bug-fixing the Object I/O library, and this 
issue is high on my priority list. I think this is a delicate design 
decision that should be taken with care, as it has impact on all existing 
programs  and all implementations :-).

Regards,
Peter

Additional remarks to those of Simon:
To respond to your points:

|1) In the MVAR version each event handler must like
| this:
|
| eventHandler state = do
|st - takeMVar state
|...
|...
|putMVAR state st'
|
| In LS version there isn't need of takeMVar/putMVAR and
| the handler is more easy.

But the reverse case is also true: in the LS version, an event handler must 
modify local state. So a function that is really not interested in the 
local state is either polymorphic in the local state or uses the local 
state lifting function (noLS and noLS1). In the MVAR version one wouldn't 
be bothered with this.

|
|2) In MVAR version the event handlers in the device
| definitions must be defined as curry functions
|
| Example MVAR:
|state - newMVAR (0::Int)
|openWindow (Window NilLS [WindowClose (closeWin
| state)])
|
| Example LS:
|openWindow (0::Int) (Window NilLS [WindowClose
| closeWin])

Both are true, but you can easily wrap up the state passing
if that is what you want:

  state - newMVAR (0::Int)
  openWindow (Window NilLS [WindowClose (handle state closeWin)])

 handle :: MVar a - (a - IO a) - IO ()
 handle m t = do { s - getMVar m; r - t s'; putMVar m s' }

Now you can write closeWin :: WinState - IO WinState
if you want.

Of course the reference to the state is still explicit, but I do not
think that is a bad thing.  It tells you where that MVar can be modified
(and where it can't!).  There might be two pieces of state for one
component,
one modified by one set of events and one by another, and it would be
nice
to make that apparent.


|   3) Modification of local state doesn't mean
| modification of device behaviour. The behaviour of the
| device is described with both local state and internal
| device data. This means that direct access to the
| state isn't a good idea. In the LS version the local
| state is encapsulated in the device and I think that
| this is more OOP style.

I don't understand this; you can encapsulate the MVars too, in just
the same way:

windowDevice = do { s - newMVar 0;
 openWindow ... }

No caller of WindowDevice can see the encapsulated MVar.

The main point of 'LS advocates' is that encapsulation is guaranteed by 
construction, while it is a program property in the MVAR system. This is of 
course a GOOD thing. However, this characteristic of LS is also its 
weakness: one simply can't (partially) share local state between GUI 
components of different top-level parents (except of course on the highest 
level within the interactive process) even though in practice this would 
make a lot of sense. One also can't easily modify event handlers once a GUI 
structure has been created, even if one would `know' the proper local state 
type because of the strong encapsulation (you can 

RE: ANNOUNCE: Object I/O released

2002-04-08 Thread Krasimir Angelov

--- Peter Achten [EMAIL PROTECTED] wrote:

 Perhaps there is an interesting alternative that 
 covers all GOOD points and has fewer BAD points.

Some pieces of library can be simplified if redefine:

data WindowLSHandle ls ps
   = WindowLSHandle
{ wlsState:: ls
, wlsHandle   :: WindowHandle ls ps
}

as

data WindowLSHandle ls ps
   = WindowLSHandle
{ wlsState:: MVar ls-- or IORef ls
, wlsHandle   :: WindowHandle ls ps
}

That let Object I/O to manage local state but
simplifies implementation of WindowDevice (see
WindowDevice.hs). There isn't need of fixIO and not
need to use of build function. This also simplifies
creation of modal dialogs and synchronous message
passing. The current implementation uses
unsafeTypeCast function which is not a good idea. 
In this implementation the type system is still
complicated but my decision is just to skip type
declarations and let compiler to resolve function
types for me. In my experience with Object I/O I
notice that type error is usually logical error. So
types for me isn't a trouble.

__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell



Re: ANNOUNCE: Object I/O released

2002-04-08 Thread Rijk J. C. van Haaften

Hello all,

Peter Achten and Arjan van IJzendoorn wrote:
I ... unfortunately could not open the .zip files

and Peter asked
Could you check the formats of these files?

After having tried to download the file a few times, I believe
the problem is not in the zip file format, but download failure.
(Until now, I didn't manage to download more than 3 MB, though
the file should be 4 MB.)

Krasimir, can you please put the file on another server (maybe
the cvs.haskell.org maintainers are willing to store the file;
ask Jeff Lewis, [EMAIL PROTECTED])?

Regards,

Rijk-Jan

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



SAVE02 call for papers

2002-04-08 Thread Sandro . Etalle

 FloC 2002 workshop SAVE 2002
Workshop on Specification, Analysis and Validation for Emerging Technologies
 Copenhagen , Denmark, July 27, 2002

   CALL FOR PAPERS

SUBMISSION DEADLINE: APRIL 27, 2002
 ^^
TOPICS

* Specification languages and rapid prototyping:
  * Logic programming and its extensions
  * First-order, constructive, modal and temporal logic
  * Constraints
  * Type theory
* Analysis:
  * Abstract interpretation
  * Program analysis and transformation
* Validation:
  * Simulation and testing
  * Deductive methods
  * Model checking
  * Theorem proving

The preferred issues include, but are not limited to:

* Mobility: specification and verification of mobile code.
* Security: e.g. specification and verification of security protocols.
* Interaction, coordination, negotiation, communication and exchange on the Web.
* Open and Parametrized Systems.

PUBLICATION 

The proceedings of the workshop will be published as technical
report. We are planning a journal special issue: a selection of the
workshop papers will be invited for submitting a full version to it.

MOTIVATIONS AND GOALS

The huge increase in interconnectivity we have witnessed in the last
decade has boosted the development of systems which are often
large-scale, distributed, time-critical, and possibly acting in an
unreliable or malicious environment. Furthermore, software and
hardware components are often mobile, and have to interact with a
potentially arbitrary number of other entities.

These systems require solid formal techniques for their verification
and analysis. In this respect, computational logic plays an
increasingly important role, both providing formal methods for proving
system's correctness and tools - e.g. using techniques like constraint
programming and theorem proving - for verifying their properties.

In addition, computational logic is gaining importance as tool for the
specification of these systems. For instance, one can think at the
specification, in a form of temporal logic, of a communication
protocol. Such specification offers the advantage that one can reason
about it using formal methods, and at the same time it is often easily
executable by rewriting it into a logic-based programming language.

The first edition of SAVE 2001 took place as a one-day satellite event
of ICLP/CP 2001 in Paphos, Cyprus. The technical program consisted of
an invited talk and seven paper presentations covering problems
related to security, real time systems, simulation and performance
evaluation, and general purpose verification techniques (all papers are
available on line in the here).

The aim of this new edition is to bring together researchers
interested in the use of computational logic as a tool for the
specification, analysis and validation of systems, with particular
emphasis on (but not restricted to) emerging technologies like World
Wide Web and e-commerce, (protocols for) smart cards and mobile
telephony, wireless technology, control and real-time systems, open
and distributed systems.


IMPORTANT DATES

* Deadline for submissions: April 27, 2002 
* Notification: May 27, 2002 
* Final papers due: June 24, 2002 
* Workshop date: July 27, 2002


PROGRAM COMMITTEE

Alessandro Armando DIST, University of  Genova, Italy 
Radhia Cousot, Ecole Polytecnique, France 
Thierry Massart, U. Libre de Brussels, Belgium 
Catuscia Palamidessi, Penn State University, USA 
Frank Pfenning, Carnegie Mellon University, USA 
Andreas Podelski Max-Planck-Institut, Germany
Sriram Rajamani, Microsoft Research, USA
Jean-Francois Raskin, U. Libre Brussels, Belgium

INSTRUCTION FOR AUTHORS

Please send your submission as a (uuencoded, gzipped, if possible)
Postscript or PDF file to: [EMAIL PROTECTED]

The paper must not exceed 15 pages, and must contain a cover page
with: title, name and addresses of the authors, abstract and
keywords. Please prepare the manuscript using LaTex article style,
single column, 12.2cm x 19.3cm text area.

The proceedings will be published in electronic format.

A printed version will be distributed to all participants of the workshop. 

WORKSHOP ORGANISERS/PC CHAIRS

*  Giorgio Delzanno - Dipartimento di Informatica e Scienze *
   dell'Informazione - Universita' di Genova. e-mail:
   [EMAIL PROTECTED]

*  Sandro Etalle - Department of Computer Science- University of Twente
   and CWI. e-mail: [EMAIL PROTECTED]

*  Maurizio Gabbrielli - University of Bologna, Italy e-mail: [EMAIL PROTECTED]


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



Re: deriving over renamed types

2002-04-08 Thread Lennart Augustsson

I just just wanted to say that I agree with almost everything Conor said.
I find it a little odd that the extension to Haskell that allows explicit
forall
does not also allow you use explicit type application (and type lanbda).

-- Lennart

C T McBride wrote:

 Hi

 On Fri, 5 Apr 2002, Ashley Yakeley wrote:

  At 2002-04-04 05:57, C T McBride wrote:
 
   ...which would be very useful, but would probably have unpleasant
   consequences for type inference...
  
  To my mind, this is not a credible objection. The horse has already
  bolted; there's no point in trying to shut the stable door.
 
  Perhaps I should say type decidability. Currently Haskell can always
  calculate whether one type-constructor is a substitution-instance of
  another, and therefore whether two type-constructors are the same. This
  may not be possible if you have full type lambdas, as in general there is
  no way of calculating whether two functions are the same.

 That's fair enough, up to a point. Higher-order unification is
 undecidable, and does not in any case yield unique most general unifiers.
 It's inevitable that if there are more things we could possibly be saying,
 it's harder for the machine to guess which one we mean. My point, however,
 is that we should not restrict what we can say, just because machines have
 limitations. Instead, we should ensure that we who (hopefully) know what
 we mean, should be able to tell the machine.

 In this respect, it's reasonable to allow both `big lambda', abstracting
 over types and other higher kind things, and `big application' (absent,
 thus far, from the relevant proposals), allowing those abstracted
 parameters to be instantiated explicitly. That's what we do in dependent
 type theory (except that there's no distinction between big and little
 lambda), and proof assistants like Agda, Coq and Lego all have decidable
 typechecking, with much richer type systems than Haskell's. I have one
 foot on the platform and one on the train here: I'm currently implementing
 a dependently typed programming language in Haskell, and thinking about
 type system extensions for Haskell is an occupational hazard.

 The joy of Hindley-Milner is that you never have to write a big lambda or
 a big application, but it doesn't mean they aren't there. The machine
 inserts big lambdas via let-polymorphism and big applications via
 first-order unification. By careful restriction of the solutions available
 for higher-kind unknowns---only type constructors or polymorphic
 parameters---Haskell ekes out a little more automation. Not unreasonable.

 But instead of restricting the usage of big lambda and big application to
 only those which can be kept implicit, why not allow them optionally to be
 made explicit, and use the existing mechanisms to provide reasonable (but
 obviously not most general) defaults when this option is not exercised?
 Again, there's an established precedent for this in type theory. Pollack's
 `Implicit Syntax' has been around for ten years, and precisely allows you
 to indicate that an argument will by default be inferred (via unification,
 if possible) but can in any case be given explicitly.

 So, if we had, say, a monadically lifted fold operator

   mfoldr :: forall m. Monad m = forall a,b.
 (a - b - m b) - m b - [a] - m b

 we could use this for Maybe, [], IO, etc as it stands, but we could also
 define foldr by something like

   foldr = mfoldr{Id}

 That's certainly cheaper, and much less frustrating than the `packaging'
 option

   newtype Id a = An a

   instance Monad Id ...

 A proposal which serves a different purpose but pushes in this general
 direction is Kahl and Scheffczyk's `Named Instances' idea. They're
 interested (rightly, in my opinion) in providing an explict but optional
 language of witnesses for the class constraints which appear in type
 schemes. Their proposal recognizes and does not interfere with the fact
 that, for many simple programs, there's an obvious default choice of
 instance which the machine can safely be left to fill in. However, they
 provide the means to specify an instance whenever a non-obvious behaviour
 is desired, or when (as is often the case with multi-parameter classes)
 there is no obvious behaviour anyway.

 It's a good idea, which I would like to see taken further. It seems to me
 desirable to seek a better integration of type-level programming via
 classes and the type-level nearly-programming which is made available by
 higher-kind polymorphism. I'm beginning to have some ideas about how this
 can be done---again based on existing technology in dependent type
 theory---but now's not the right time to push that particular boat out.

 So, let me summarize with two points:

 [Scientific] If we want to do wacky stuff, we should be under no illusion
 about preserving type inference (as opposed to type checking)---we must
 say what we mean. The maintenance of type inference is an untenable excuse
 for preventing us from 

Re: deriving over renamed types

2002-04-08 Thread Ashley Yakeley

At 2002-04-08 12:45, Lennart Augustsson wrote:

I just just wanted to say that I agree with almost everything Conor said.
I find it a little odd that the extension to Haskell that allows explicit
forall
does not also allow you use explicit type application (and type lanbda).

What did you have in mind?

  data Zero;
  data Succ n;

  type Add Zero b = b;
  type Add (Succ a) b = Succ (Add a b);

  type Mult Zero b = Zero;
  type Mult (Succ a) b = Add b (Mult a b);

  type Fact Zero = Zero;
  type Fact (Succ n) = Mult (Succ n) (Fact n);

  data Foo f = MkFoo (f ());

  type Succ' = Succ;
  type Succ'' n = Succ n;

  -- which of these types are the same?
  f1 = MkFoo undefined :: Foo Succ;
  f2 = MkFoo undefined :: Foo Succ';
  f3 = MkFoo undefined :: Foo Succ'';
  f4 = MkFoo undefined :: (Add (Succ Zero));


-- 
Ashley Yakeley, Seattle WA

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



Re: deriving over renamed types

2002-04-08 Thread Pixel

Ashley Yakeley [EMAIL PROTECTED] writes:

[...]

   -- which of these types are the same?
   f1 = MkFoo undefined :: Foo Succ;
   f2 = MkFoo undefined :: Foo Succ';
   f3 = MkFoo undefined :: Foo Succ'';
   f4 = MkFoo undefined :: Foo (Add (Succ Zero));

yeah, why not! Have them all be the same thing.
(i added the missing Foo on f4)


add Zero b = b
add (Succ a) b = Succ (add a b)

mult Zero b = Zero
mult (Succ a) b = add b (mult a b)

fact Zero = Zero
fact (Succ n) = mult (Succ n) (fact n)

data Foo f = MkFoo (f ())

succ' = Succ
succ'' n = Succ n

-- which of these types are the same?
f1 = MkFoo undefined :: Foo Succ
f2 = MkFoo undefined :: Foo succ'
f3 = MkFoo undefined :: Foo succ''
f4 = MkFoo undefined :: Foo (add (Succ Zero))


add to haskell
- eta-expanding of (add (Succ Zero)) in (\x - add (Succ Zero) x)
- compile-time evaluation of type expressions (handling unbounded parameters
like x above)

and that should do it!


I don't think this is a crazy as it sounds. Cayenne has already started
computing types at compile-time.

I'm currently working on merd (http://merd.net) which has a such a type system.
eg:

range(n, m) =
if n  m then
n | range(n + 1, m)
else
n

Two_to_height = range(2, 8)  #= 2|3|4|5|6|7|8

restricted_identity !! Two_to_height - Two_to_height
restricted_identity(x) = x

restricted_identity(4) #= 4
restricted_identity(1) #= compile-time error: 1 is not in 2|3|4|5|6|7|8
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell



Re: ANNOUNCE: GHC 5.02.3 released

2002-04-08 Thread Sigbjorn Finne


Simon Marlow [EMAIL PROTECTED] writes:
 
The (Interactive) Glasgow Haskell Compiler -- version 5.02.3
   ==
 
 We are pleased to announce a new patchlevel release of the Glasgow
 Haskell Compiler (GHC), version 5.02.3.  The source distribution is
 freely available via the World-Wide Web, under a BSD-style license.
 See below for download details.  Pre-built packages for Linux,
 FreeBSD, Solaris and Win32 are also available (or will appear
 shortly).
 

yep, win32 installer now available:

http://haskell.org/ghc/download_ghc_502.html

enjoy
--sigbjorn


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