From joe@isun.informatik.uni-leipzig.de Mon Apr 2 07:43:07 2001 Date: Mon, 2 Apr 2001 08:43:07 +0200 (MET DST) From: Johannes Waldmann joe@isun.informatik.uni-leipzig.de Subject: process file table full?
Dear all, I was running a ghc compiled executable, 
(containing -syslib net -syslib concurrent) and got this after a while

Fail: resource exhausted
Action: openFile
Reason: process file table full connect-985988146.log

what could be the reasons? something related to sockets?
-- 
-- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ --
-- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 --


From ltaesch@europemail.com Mon Apr 2 13:36:30 2001 Date: Mon, 2 Apr 2001 08:36:30 -0400 (EDT) From: ltaesch@europemail.com ltaesch@europemail.com Subject: package ? 4.0.8.2
im new to ghc.

i just could not find how to include lib/package in the compile...


by browsing the web,  i found that  http://www.cs.mu.oz.au/fpu/ghc-guides/set/packages.html#LISTING-PACKAGES

have a 3.8 section about package, whereas haskell.org/ghc/documentation dont !

also ghc --list-packages doesnt not work on my win install (fresh from the day before)

also, the doc mention a packages.conf file.
where is this one ? (on win)

are there some changes currently worked on packages ?

thanks

Luc

------------------------------------------------------
Get free personalized email at http://four11.iname.com


From christian.lescher@icn.siemens.de Mon Apr 2 14:11:57 2001 Date: Mon, 2 Apr 2001 15:11:57 +0200 From: Lescher Christian christian.lescher@icn.siemens.de Subject: Difficulties compiling hmake / HaXml
Now that I made it through the hmake compilation and went on to the haXml tools I come to another problem with compiling haXml.
The error message (below) lead me to the missing file (IOExts.hi) which I found in "/lib/imports/lang". I searched the Makefile and recognized the "HFLAGS" variable wich seems to be set for the ghc-compiler and the path to the "lang" directory.
But, as there is an error message what is wrong ? Is there a problem with the Makefile or the directory structure? Can you help me go on?

Cheers, Christian

C:\test-haxml>make
cd lib; hmake XmlLib.hs
ghc    -c -o Pretty.o Pretty.lhs
ghc    -c -o XmlTypes.o XmlTypes.hs
ghc    -c -o XmlPP.o XmlPP.hs
ghc    -c -o XmlLex.o XmlLex.hs
ghc    -c -o ParseSTLib.o ParseSTLib.hs
ghc    -c -o XmlHtmlParse.o XmlHtmlParse.hs
ghc    -c -o XmlParse.o XmlParse.hs

XmlParse.hs:39:
    Could not find interface file for `IOExts'
    in the directories ./*.hi
                       C:/ghc/ghc-4.08.2/lib/imports/std/*.hi

Compilation had errors

make: *** [XmlLib] Error 1



From simonmar@microsoft.com Mon Apr 2 14:29:48 2001 Date: Mon, 2 Apr 2001 14:29:48 +0100 From: Simon Marlow simonmar@microsoft.com Subject: package ? 4.0.8.2
> im new to ghc.
>=20
> i just could not find how to include lib/package in the compile...
>=20
>=20
> by browsing the web,  i found that =20
>
http://www.cs.mu.oz.au/fpu/ghc-guides/set/packages.html#LISTING-PACKAGES

> have a 3.8 section about package, whereas
haskell.org/ghc/documentation dont !
>
> also ghc --list-packages doesnt not work on my win install (fresh from
the day=20
> before)
>
> also, the doc mention a packages.conf file.
> where is this one ? (on win)

GHC 4.08.2 doesn't have package.conf, or the ghc-pkg tool.  These are in
the forthcoming GHC 5.00 only; presumably the documentation you are
looking at is for a newer version of GHC.

Cheers,
	Simon


From keving@cs.mu.OZ.AU Tue Apr 3 00:13:11 2001 Date: Tue, 3 Apr 2001 09:13:11 +1000 From: Kevin Glynn keving@cs.mu.OZ.AU Subject: package ? 4.0.8.2
Apologies,  this is a local copy of the GHC documentation I use for
speedy access.  Somehow it appears to be halfway between 4.08 and
5.00.  I've made it clearer on the fpu pages now.

Slightly off-topic.  Could you make a copy of the CVS versions of the
documentation available from the GHC pages? I still haven't worked out
how to get the right docbook stuff installed under Debian ...

thanks
k



Simon Marlow writes:
 > > im new to ghc.
 > > 
 > > i just could not find how to include lib/package in the compile...
 > > 
 > > 
 > > by browsing the web,  i found that  
 > >
 > http://www.cs.mu.oz.au/fpu/ghc-guides/set/packages.html#LISTING-PACKAGES
 > 
 > > have a 3.8 section about package, whereas
 > haskell.org/ghc/documentation dont !
 > >
 > > also ghc --list-packages doesnt not work on my win install (fresh from
 > the day 
 > > before)
 > >
 > > also, the doc mention a packages.conf file.
 > > where is this one ? (on win)
 > 
 > GHC 4.08.2 doesn't have package.conf, or the ghc-pkg tool.  These are in
 > the forthcoming GHC 5.00 only; presumably the documentation you are
 > looking at is for a newer version of GHC.
 > 
 > Cheers,
 > 	Simon
 > 
 > _______________________________________________
 > Glasgow-haskell-users mailing list
 > Glasgow-haskell-users@haskell.org
 > http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
 > 


From joe@isun.informatik.uni-leipzig.de Tue Apr 3 07:21:51 2001 Date: Tue, 3 Apr 2001 08:21:51 +0200 (MET DST) From: Johannes Waldmann joe@isun.informatik.uni-leipzig.de Subject: process file table full?
Yesterday I asked for the posssible reasons of

> Fail: resource exhausted
> Action: openFile
> Reason: process file table full connect-985988146.log

Writing that particular file wasn't the cause, but just a symptom.

It seems that I forgot to close filehandles obtained from Socket.accept.
I somehow thought they were garbage collecteted, but apparently the weren't.
-- 
-- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ --
-- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 --


From simonpj@microsoft.com Tue Apr 3 08:43:59 2001 Date: Tue, 3 Apr 2001 00:43:59 -0700 From: Simon Peyton-Jones simonpj@microsoft.com Subject: package ? 4.0.8.2
Julian is planning to make the nightly-build documentation visible from
the GHC home page.  (aren't you, Julian?!)

Simon

| -----Original Message-----
| From: Kevin Glynn [mailto:keving@cs.mu.OZ.AU]=20
| Sent: 03 April 2001 00:13
| To: Simon Marlow
| Cc: ltaesch@europemail.com; glasgow-haskell-users@haskell.org
| Subject: RE: package ? 4.0.8.2
|=20
|=20
|=20
| Apologies,  this is a local copy of the GHC documentation I=20
| use for speedy access.  Somehow it appears to be halfway=20
| between 4.08 and 5.00.  I've made it clearer on the fpu pages now.
|=20
| Slightly off-topic.  Could you make a copy of the CVS=20
| versions of the documentation available from the GHC pages? I=20
| still haven't worked out how to get the right docbook stuff=20
| installed under Debian ...
|=20
| thanks
| k
|=20
|=20
|=20
| Simon Marlow writes:
|  > > im new to ghc.
|  > >=20
|  > > i just could not find how to include lib/package in the=20
| compile...  > >=20
|  > >=20
|  > > by browsing the web,  i found that =20
|  > >
|  >=20
| http://www.cs.mu.oz.au/fpu/ghc-guides/set/packages.html#LISTIN
G-PACKAGES
 >=20
 > > have a 3.8 section about package, whereas
 > haskell.org/ghc/documentation dont !
 > >
 > > also ghc --list-packages doesnt not work on my win install (fresh
from  > the day=20
 > > before)
 > >
 > > also, the doc mention a packages.conf file.
 > > where is this one ? (on win)
 >=20
 > GHC 4.08.2 doesn't have package.conf, or the ghc-pkg tool.  These are
in  > the forthcoming GHC 5.00 only; presumably the documentation you
are  > looking at is for a newer version of GHC.  >=20
 > Cheers,
 > 	Simon
 >=20
 > _______________________________________________
 > Glasgow-haskell-users mailing list
 > Glasgow-haskell-users@haskell.org
 > http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
 >=20

_______________________________________________
Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


From simonmar@microsoft.com Tue Apr 3 09:38:50 2001 Date: Tue, 3 Apr 2001 09:38:50 +0100 From: Simon Marlow simonmar@microsoft.com Subject: process file table full?
> Yesterday I asked for the posssible reasons of
>=20
> > Fail: resource exhausted
> > Action: openFile
> > Reason: process file table full connect-985988146.log
>=20
> Writing that particular file wasn't the cause, but just a symptom.
>=20
> It seems that I forgot to close filehandles obtained from=20
> Socket.accept.
> I somehow thought they were garbage collecteted, but=20
> apparently the weren't.

They should be garbage collected and closed automatically.  But it may
be some time between the handle becoming garbage and it finally being
closed, so if you're accepting connections at a fast rate, it's always a
good idea to close the handle explicitly when you finish with it.

Cheers,
	Simon


From christian.lescher@icn.siemens.de Tue Apr 3 12:37:18 2001 Date: Tue, 3 Apr 2001 13:37:18 +0200 From: Lescher Christian christian.lescher@icn.siemens.de Subject: AW: Difficulties compiling hmake / HaXml
Thanks for helping me out again. Now I made it through to the XML-Tools but unfortunatly they brought me another error. Below the error message I copied the 2 lines mentioned there (220 and 222) from the haskell file.


cd tools; hmake DtdToHaskell -I../lib -package text
ghc  -package text  -I../lib  -c -o DtdToTypeDefPP.o DtdToTypeDefPP.hs

DtdToTypeDefPP.hs:220: Data constructor not in scope: `DefaultTo'

DtdToTypeDefPP.hs:222: Data constructor not in scope: `DefaultTo'

Compilation had errors

make: *** [DtdToHaskell] Error 1
bash-2.04$

----------

mkAttrField e (AttDef n StringType (DefaultTo (AttValue [Left s]) f)) = (name_f e n, Defaultable String s)
mkAttrField e (AttDef n _          (DefaultTo (AttValue [Left s]) f)) = (name_f e n, Defaultable (Defined (name n)) (mangle s))



From Malcolm.Wallace@cs.york.ac.uk Tue Apr 3 13:07:03 2001 Date: Tue, 3 Apr 2001 13:07:03 +0100 From: Malcolm Wallace Malcolm.Wallace@cs.york.ac.uk Subject: AW: Difficulties compiling hmake / HaXml
> Thanks for helping me out again. Now I made it through to the
> XML-Tools but unfortunatly they brought me another error.

> cd tools; hmake DtdToHaskell -I../lib -package text
> ghc  -package text  -I../lib  -c -o DtdToTypeDefPP.o DtdToTypeDefPP.hs
> 
> DtdToTypeDefPP.hs:220: Data constructor not in scope: `DefaultTo'
> DtdToTypeDefPP.hs:222: Data constructor not in scope: `DefaultTo'

This indicates a clash between the version of XmlTypes.hs installed in
-package text, and the version in your source tree in directory ../lib.

Remove "-package text" from the hmake command line, and change
"-I../lib" to "-i../lib" (ghc prefers -i to -I).

Regards,
    Malcolm


From christian.lescher@icn.siemens.de Tue Apr 3 14:41:56 2001 Date: Tue, 3 Apr 2001 15:41:56 +0200 From: Lescher Christian christian.lescher@icn.siemens.de Subject: AW: AW: Difficulties compiling hmake / HaXml
I changed the hmake call to that one you suggested but sadly another error followed up.


cd tools; hmake DtdToHaskell -i../lib
ghc   -i../lib  -c -cpp -o DtdToTypeDefPP.o DtdToTypeDefPP.hs

DtdToTypeDefPP.hs:94:
    Ambiguous occurrence `commaList'
    It could refer to either `commaList', defined at DtdToTypeDefPP.hs:510
                          or `Pretty.commaList', imported from Pretty at DtdToTypeDefPP.hs:19

DtdToTypeDefPP.hs:117:
    Ambiguous occurrence `commaList'
    It could refer to either `commaList', defined at DtdToTypeDefPP.hs:510
                          or `Pretty.commaList', imported from Pretty at DtdToTypeDefPP.hs:19

Compilation had errors

make: *** [DtdToHaskell] Error 1
bash-2.04$



From qrczak@knm.org.pl Wed Apr 4 15:48:33 2001 Date: 4 Apr 2001 14:48:33 GMT From: Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl Subject: Replacing module Array by IArray
Wed, 28 Mar 2001 21:11:59 +0200, andreas.marth@daimlerchrysler.com <andreas.marth@daimlerchrysler.com> pisze:

> The module Array exports module Ix (Haskell 98 Library Report).
> The module IArray doesn't export Ix (jet?).

Thanks, it will export it in ghc-5.00.

> I think a pack and unpack function to convert between IArray ix be
> and UArray ix ube via 'amap pack/unpack' would be useful.

Such conversion is as simple as
    \a -> listArray (bounds a) (elems a)
or
    \a -> array (bounds a) (assocs a)
so I don't think it needs a separate function.

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



From miketh@brisbane.paradigmgeo.com Thu Apr 5 07:12:17 2001 Date: Thu, 5 Apr 2001 16:12:17 +1000 From: Mike Thomas miketh@brisbane.paradigmgeo.com Subject: Hard earned hints for using Win32 GHC 4.08.2 and HDirect.
Hi all.

I thought I might share some hints on making HDirect work with GHC 4.08.2.


Installing and checking GHC:

 - Get the installer from the GHC downloads page, do the installation per
the instructions there, including Cygwin etc.

 - Remove the digit "1" from the bottom of lib/imports/win32/Win32.hi

 - Remove old .hi files from any program source directories you may have.

 - To test, try compiling the Windows hello.lhs example using the command
line "ghc hello.lhs -o hello.exe -package win32" and run hello.exe.

 - If you get linker errors about "import____timezone_dll" from time.o, you
need to add the line:
  push(@SysLibrary, '-lcrtdll')  if ($TargetPlatform =~
/-(mingw32|cygwin32)$/);
below the line:
  push(@SysLibrary, '-lwsock32') if ($TargetPlatform =~
/-(mingw32|cygwin32)$/);

in your "bin/ghc" driver script.  This is because the distribution is built
with an old version of Cygwin GCC which links against crtdll.dll rather than
msvcrt.dll when -mno-cygwin is set on the command line (GHC uses mingw32).
By doing this, spare symbols are resolved after linkage with msvcrt.dll.  DO
NOT SUBSTITUTE -lmsvcrt with -lcrtdll. If you substitute, you will get
errors about running out of resources on fileOpen at run time.

 - You may also need to update your GCC Mingw32 libraries and headers from
the Sourceforge Mingw32 downloads page if you have unexplained crashes.


Building HDIrect 0.17

 - Uninstall previous versions of HDirect including "lib/imports/com" and
associated libraries, which don't work very well with GHC 4.08.2.

 - Get the source from the HDirect web site and untar it somewhere.

 - You may need to edit "lib/WideStringSrc.c" if you use the latest Cygwin
distribution to remove a clashing definition and declaration of wcslen().

 - Build per the instructions in the INSTALL file.

 - This gives you a bare bones ihc.exe which cannot handle type libraries.

 - Install the freshly built lib/*.hi files in a new ghc "lib/imports/com"
directory and also the libraries (libHScom.a, libhdirect.a) into ghc's "lib"
directory.

 - Do "make clean", deleting "src/ihc.exe" by hand.

 - Set SUPPORT_TYPELIBS=YES in "src/Makefile"

 - "make boot", "make", then "make lib" as before.

 - You now have version 0.17 of HDirect for Windows.


Question Time:

Why does ihc ignore binary interfaces in type libraries such as dx7vb.dll?


Cheers

Mike Thomas




From christian.lescher@icn.siemens.de Thu Apr 5 09:14:29 2001 Date: Thu, 5 Apr 2001 10:14:29 +0200 From: Lescher Christian christian.lescher@icn.siemens.de Subject: AW: Difficulties compiling hmake / HaXml
Finally I made it till the end, thanks to your very quick replies.
I hope I didn't bother you too much with all the mails.
At last I'd like to give a summary of all the changes been made to the files of the "HaXml" release. Perhaps you'll find this information usefull for further releases.

system configuration:
- Win NT 4.0
- cygwin 1.1.8
- ghc 4.08.2
- hmake 2.02 ;)
- HaXml 1.01


The Makefile and the DtdToTypesDefPP.hs were changed.


changes to Makefile:
line 51:
cd lib; hmake XmlLib.hs					changed to
cd lib; hmake XmlLib.hs -package lang

line 53:
cd lib; hmake Haskell2Xml.hs					->
cd lib; hmake Haskell2Xml.hs -package lang -package text

line 55:
cd lib; hmake Xml2Haskell.hs					->
cd lib; hmake Xml2Haskell.hs -package lang

line 61:
cd tools; hmake DtdToHaskell $(INC)
mv tools/DtdToHaskell .						->

cd tools; hmake DtdToHaskell -i../lib -package lang
mv tools/DtdToHaskell.exe .

line 65:
cd examples; hmake Canonicalise $(INC)
mv examples/Canonicalise .					->

cd examples; hmake Canonicalise -i../lib -package lang
mv examples/Canonicalise.exe .

line 69:
cd tools; hmake Xtract $(INC)
mv tools/Xtract .						->

cd tools; hmake Xtract -i../lib -package lang
mv tools/Xtract.exe .

line 74:
mv tools/DrIFT/DrIFT .						->
mv tools/DrIFT/DrIFT.exe .


changes to DtdToTypesDefPP.hs:
line 510:
commaList = hcat . intersperse comma				->
	-- commaList = hcat . intersperse comma


From rrt@dcs.gla.ac.uk Thu Apr 5 12:35:51 2001 Date: Thu, 5 Apr 2001 12:35:51 +0100 (BST) From: Reuben Thomas rrt@dcs.gla.ac.uk Subject: New InstallShield for Windows, plus mingwin fix
I have uploaded a new GHC InstallShield for Windows that fixes many recent
problems (including most of the problems with GHC that Mike Thomas reported
in his list of instructions for building H/Direct).

Unless the Cygwin team have acted with unwonted rapidity (which, at the time
of writing, they hadn't), you'll also need to download our version of the
mingwin package (or get the relevant bits from SourceForge). Our zip can
simply be unpacked over an installed Cygwin tree to give you mingwin headers
and libraries that really work.

-- 
http://sc3d.org/rrt/ | certain, a.  insufficiently analysed



From fis@ssh.com Thu Apr 5 13:27:00 2001 Date: Thu, 5 Apr 2001 15:27:00 +0300 From: fis@ssh.com fis@ssh.com Subject: [Q] bootstrapping ghc on netbsd

 Dear all,


QUESTION: Is there an easy way of keeping ghc-4.08.2 from using any
assembler code when compiling it from .hc files + sources?

DETAILS: Why do I want to do this?  gmp-2.0.2 has some problems
compiling on netbsd machines that can be solved by hiding all
assembler code from the compiler.  Having done so, I managed to
bootstrap on NetBSD 1.3.2, but still have an inplace-compiler failure
on 1.5.  The error message is from the gcc assembler (see below), so I
thought trying a pure C variant might help somewhat.

I undefined i386_{HOST,TARGET,BUILD}_ARCH in $(TOP)/mk/config.mk but
it had no effect.


 thanks for any hints,
Matthias



======================================================================
rm -f Addr.o ; if [ ! -d Addr ]; then mkdir Addr; else /usr/bin/find Addr -name '*.o' -print | xargs rm -f __rm_food ; fi ;   
../../ghc/driver/ghc-inplace -recomp -cpp -fglasgow-exts -fvia-C -Rghc-timing -I../../ghc/includes  -imonads -static -O  -package-name lang -split-objs    -c Addr.hc -o Addr.o -osuf o
Funny global thing?: __stg_split_marker1:
Funny global thing?: _module_registered:
Funny global thing?: __init_Addr:
Funny global thing?: __stg_split_marker2:
Funny global thing?: __stg_split_marker3:
[...]
Funny global thing?: __stg_split_marker89:
Funny global thing?: __stg_split_marker90:
Prologue junk?: .globl __stg_split_marker2
__stg_split_marker2:
        ret
.Lfe3:
        .size    __stg_split_marker2,.Lfe3-__stg_split_marker2
.globl Addr_lvl_closure
.data
        .align 4
        .type    Addr_lvl_closure,@object
        .size    Addr_lvl_closure,4
Addr_lvl_closure:
        .long Addr_lvl_info
.globl Addr_lvl_info
.section        .rodata
        .align 4
        .type    Addr_lvl_info,@object
        .size    Addr_lvl_info,12
Addr_lvl_info:
        .long 0
        .word 0
        .word 0
        .word 17
        .word 0
.text
        .align 4
.globl Addr_lvl_entry
        .type    Addr_lvl_entry,@function
Addr_lvl_entry:
        
gmake[2]: *** [Addr.o] Error 255
======================================================================



-- 
Matthias Fischmann | Research Engineer                | +358 (9) 8565 7474
fis@ssh.fi         | SSH Communication Security Corp. | +358 (40) 752 5291


From josefs@cs.chalmers.se Thu Apr 5 16:28:40 2001 Date: Thu, 5 Apr 2001 17:28:40 +0200 (MET DST) From: Josef Svenningsson josefs@cs.chalmers.se Subject: About rules
Hi all!

I've been playing around with the rules facility a bit. There is a boring
shortcoming when working with infix operators. It seems that the rule
parser doesn't like them at all. The following example gives syntax error:

{-# RULES
    "plus/mult" forall p . p + p = 2 * p
#-}

whereas the following is allright:

{-# RULES
    "plus/mult" forall p . (+) p p = (*) 2 p
#-}

It's not a big problem, but it's rather inconvenient and ugly. Is it easy
to fix?

Cheers,
	/Josef



From simonmar@microsoft.com Fri Apr 6 09:58:58 2001 Date: Fri, 6 Apr 2001 09:58:58 +0100 From: Simon Marlow simonmar@microsoft.com Subject: [Q] bootstrapping ghc on netbsd
> QUESTION: Is there an easy way of keeping ghc-4.08.2 from using any
> assembler code when compiling it from .hc files + sources?

No, there isn't an easy way.  When compiling via C, GHC "mangles" the
assembly output from the C compiler in order to support tail calls and
some other optimisations.  There's a native code generator, but currenly
it can't be used for some of the library code.

> DETAILS: Why do I want to do this?  gmp-2.0.2 has some problems
> compiling on netbsd machines that can be solved by hiding all
> assembler code from the compiler.

I think this was a misconfiguration problem with GMP, as I mentioned in
my other message to glasgow-haskell-bugs.

>  Having done so, I managed to
> bootstrap on NetBSD 1.3.2, but still have an inplace-compiler failure
> on 1.5.  The error message is from the gcc assembler (see below), so I
> thought trying a pure C variant might help somewhat.

This is almost certainly an incompatibility between the exact flavour of
GCC being used on NetBSD 1.5, and our assembly mangling machinery.  If
you add the flag -ddump-raw-asm, and send me the output, I might be able
to tell what's wrong.

Cheers,
	Simon


From simonpj@microsoft.com Fri Apr 6 15:40:57 2001 Date: Fri, 6 Apr 2001 07:40:57 -0700 From: Simon Peyton-Jones simonpj@microsoft.com Subject: About rules
No good reason.  I've implemented the one-line change in my copy
but we're in a code freeze until we release GHCi 5.00 on Monday.
After that I'll commit it.

Good idea, thank you.

Simon

| -----Original Message-----
| From: Josef Svenningsson [mailto:josefs@cs.chalmers.se]=20
| Sent: 05 April 2001 16:29
| To: glasgow-haskell-users@haskell.org
| Subject: About rules
|=20
|=20
| Hi all!
|=20
| I've been playing around with the rules facility a bit. There=20
| is a boring shortcoming when working with infix operators. It=20
| seems that the rule parser doesn't like them at all. The=20
| following example gives syntax error:
|=20
| {-# RULES
|     "plus/mult" forall p . p + p =3D 2 * p
| #-}
|=20
| whereas the following is allright:
|=20
| {-# RULES
|     "plus/mult" forall p . (+) p p =3D (*) 2 p
| #-}
|=20
| It's not a big problem, but it's rather inconvenient and=20
| ugly. Is it easy to fix?
|=20
| Cheers,
| 	/Josef
|=20
|=20
| _______________________________________________
| Glasgow-haskell-users mailing list=20
| Glasgow-haskell-users@haskell.org=20
| http://www.haskell.org/mailman/listinfo/glasgow-| haskell-users
|=20


From m@ryangunter.com Sat Apr 7 18:23:43 2001 Date: 07 Apr 2001 10:23:43 -0700 From: Mike Gunter m@ryangunter.com Subject: process file table full?
One might think it would be best to trigger a garbage collection
before giving up and raising the exception.  Or no?

        mike


"Simon Marlow" <simonmar@microsoft.com> writes:

> > Yesterday I asked for the posssible reasons of
> > 
> > > Fail: resource exhausted
> > > Action: openFile
> > > Reason: process file table full connect-985988146.log
> > 
> > Writing that particular file wasn't the cause, but just a symptom.
> > 
> > It seems that I forgot to close filehandles obtained from 
> > Socket.accept.
> > I somehow thought they were garbage collecteted, but 
> > apparently the weren't.
> 
> They should be garbage collected and closed automatically.  But it may
> be some time between the handle becoming garbage and it finally being
> closed, so if you're accepting connections at a fast rate, it's always a
> good idea to close the handle explicitly when you finish with it.
> 
> Cheers,
> 	Simon


From ltaesch@europemail.com Sun Apr 8 19:25:55 2001 Date: Sun, 08 Apr 2001 18:25:55 +0000 From: luc ltaesch@europemail.com Subject: failed when trying to compile FranTk with ghc
I tried FranTk with ghc 4.08 and got :
(this is the "fixed" FrankTk, alledged working with 4.06, if im not
wrong)

are there any difference with 4.06  and 4.08 ?


------------------------------------------------------------------------

==fptools== gmake boot - --no-print-directory -r;
 in /home/luc/tmp/FranTk/src/FranSrc
------------------------------------------------------------------------

ghc -M -optdep-f -optdep.depend  -optdep-o -optdepo    -O -fglasgow-exts
-recomp -dcore-lint -fvia-C -syslib concurrent    -i../TclHaskellSrc
Compatibility.ghc.hs BaseTypes.hs Force.hs MutSet.hs Event.hs BPrim.hs
WorkPool.hs FranTime.hs Behavior.hs FranPrim.hs Listener.hs ColorCore.hs
Vector2.hs VectorSpace.hs Point2.hs Vector3.hs Point3.hs Transform2.hs
Rect.hs Transform3.hs StaticTypes.hs ColorCoreB.hs Point2B.hs Point3B.hs
Vector2B.hs Vector3B.hs RectB.hs Transform2B.hs Transform3B.hs
BehaviorTypes.hs VectorSpaceB.hs BehaviorIO.hs FranCore.hs
FranBehavior.hs
No file `PrelNumExtra.hi', `PrelNumExtra.lhs', `PrelNumExtra.hs' (reqd
from file `Compatibility.ghc.hs')
among import directories:
        ../TclHaskellSrc:.
gmake[2]: *** [depend] Error 1
gmake[1]: *** [boot] Error 1





From kort@science.uva.nl Mon Apr 9 10:01:08 2001 Date: Mon, 09 Apr 2001 11:01:08 +0200 From: Jan Kort kort@science.uva.nl Subject: failed when trying to compile FranTk with ghc
luc wrote:
> 
> I tried FranTk with ghc 4.08 and got :
> (this is the "fixed" FrankTk, alledged working with 4.06, if im not
> wrong)
> 
> are there any difference with 4.06  and 4.08 ?

Below is a list of fixes to get FranTk working with ghc4.08.

  Jan

Run configure like normal, i.e.:
./configure --prefix=/scratch/kort/pkgs/frantk

Change the file FranTk/src/FranSrc/Compatibility.ghc.hs to
========================================================================
-- this module is for GHC; GSL
module Compatibility
       ( double2Float
       , yield
       , debugMsgLn
       , setDebug
       , mkWeakIORef
       , toInt
       , fromInt
       ) where
import GlaExts 
import NumExts(doubleToFloat)
import PrelRead(readDec)
import IOExts
import Concurrent
import Exception

double2Float = doubleToFloat

setDebug :: Bool -> IO ()
setDebug _ = return ()

debugMsgLn :: String -> IO ()
debugMsgLn s = assert (trace s `seq` True) $ return () 
========================================================================

In the file FranTk/src/FranTkSrc/Makefile change the line:
HC_OPTS+= -i../FranSrc:../TclHaskellSrc -fallow-overlapping-instances -fallow-undecidable-instances
-syslib misc 
to:
HC_OPTS+= -i../FranSrc:../TclHaskellSrc -fallow-overlapping-instances -fallow-undecidable-instances
-syslib data

In the file FranTk/demos/Makefile change the line:
HC_OPTS+= -i../src/FranTkSrc:../src/FranSrc:../src/TclHaskellSrc -fallow-overlapping-instances
-fallow-undecidable-instances -syslib misc
to:
HC_OPTS+= -i../src/FranTkSrc:../src/FranSrc:../src/TclHaskellSrc -fallow-overlapping-instances
-fallow-undecidable-instances -syslib data

If the compiler complains about not finding the file "tcl.h", in the
file FranTk/src/TclHaskellSrc/Makefile change the rule:
tclhaskell.o: tclhaskell.c tclhaskell.h
        $(HC) -c tclhaskell.c
to:
tclhaskell.o: tclhaskell.c tclhaskell.h
        $(HC) -I/opt/arch/lib/tk8.3/include -c tclhaskell.c
where /opt/arch... is the place "tcl.h" and "tk.h" are.

In the directory FranTk/src/TclHaskellSrc do:
rm *.hi *.o

In the file FranTk/src/TclHaskellSrc/Makefile add TclPrim.hs to
the HS_SRCS list.

In the directory FranTk/src/FranSrc do:
rm *.hi

In the directory FranTk/demos do:
rm *.hi

And then continue the normal installation with:
gmake boot
gmake all


From extern.thomas.pasch@volkswagen.de Mon Apr 9 10:52:47 2001 Date: Mon, 9 Apr 2001 11:52:47 +0200 From: Pasch, Thomas (ACTGRO) extern.thomas.pasch@volkswagen.de Subject: How to convert the type signature of a variable to a String?
Hello,

it is possible to write

  module Main(main) where

  import Dynamic

  main = putStrLn ( show ( typeOf (f (1::Integer))))

  f x = x

The output is of course 
  
  Integer

But the typeOf will only work for 'concrete' data types.
It will not work for functions. So I can't write

  main = putStrLn ( show ( typeOf (f)))

Thus it is possible to write a function that recognize functions, i.e.

  functionType arg = case arg of
    (arg:: a->b) -> "function"

So the question is: Is is possible to write a function the gives
back a String with the signature of the argument of that function?

For example:

 'function f' gives the String "a->a" 

Best regards,

Thomas





From pasch@netzGeneration.com Tue Apr 10 00:55:21 2001 Date: Tue, 10 Apr 2001 01:55:21 +0200 From: Thomas Pasch pasch@netzGeneration.com Subject: How to box/unbox values?
Hello,

is there an easy way to box/unbox Types.
I need this for Int's, so is there 
a function that does:

Int# -> Int
Int -> Int#

Regards,

Thomas


From uk1o@rz.uni-karlsruhe.de Tue Apr 10 08:53:19 2001 Date: Tue, 10 Apr 2001 09:53:19 +0200 From: Hannah Schroeter uk1o@rz.uni-karlsruhe.de Subject: How to box/unbox values?
Hello!

On Tue, Apr 10, 2001 at 01:55:21AM +0200, Thomas Pasch wrote:

> is there an easy way to box/unbox Types.
> I need this for Int's, so is there 
> a function that does:

> Int# -> Int
> Int -> Int#

You must import the appropriate modules, to "see" the type definition
for Int (which is data Int = I# Int# in GHC). Then just use plain
pattern matching:

unboxInt :: Int -> Int#
unboxInt (I# i#) = i#

boxInt :: Int# -> Int
boxInt i# = I# i#

Note that there are some restrictions for handling unboxed values,
see the documentation.

Kind regards,

Hannah.


From v-julsew@microsoft.com Tue Apr 10 10:52:01 2001 Date: Tue, 10 Apr 2001 02:52:01 -0700 From: Julian Seward (Intl Vendor) v-julsew@microsoft.com Subject: How to box/unbox values?
| -----Original Message-----
| From: Thomas Pasch [mailto:pasch@netzGeneration.com]
| Sent: Tuesday, April 10, 2001 12:55 AM
| To: glasgow-haskell-users@haskell.org
| Subject: How to box/unbox values?
|=20
|=20
| Hello,
|=20
| is there an easy way to box/unbox Types.
| I need this for Int's, so is there=20
| a function that does:
|=20
| Int# -> Int
| Int -> Int#

import GlaExts ( Int(..) )
iBox x =3D I# x
iUnbox (I# x) =3D x



From ger@tzi.de Tue Apr 10 15:30:14 2001 Date: Tue, 10 Apr 2001 16:30:14 +0200 From: George Russell ger@tzi.de Subject: ghc5.00 binary on Sparc?
GHC 5.00 looks wonderful.  Would it be possible to make a binary
distribution available for Sparc?  As you may remember, I've had 
difficulty compiling it myself for Sparc, for some reason I don't know,
and even if I find a way of hacking things to compile it, I'd rather
users (= students) didn't have to . . .


From andrew@intertrader.com Wed Apr 11 09:09:50 2001 Date: Wed, 11 Apr 2001 09:09:50 +0100 From: Andrew Cooke andrew@intertrader.com Subject: Stack trace on error (and packages)
Hi,

Is it possible to persuade ghc/RTS to provide a stack trace (or
something similar) when an error occurs?  I have some code that is
generating a runtime error (appears to be due to division by
almost-zero, provoking very large numbers and then a NaN in a case
statement when coerced to Double) in a function that is used throughout
my code - it would be a big help to know which function called the
function that is generating the error.

Also, less importantly, how do I generate packages?  I have a bunch of
.o files (modules) all compiled using -package-name and -c, but I can't
find the correct ghc flag to link them into a library (.a/Linux).

Apologies if both/either of these are covered in the docs - I couldn't
find a simple way of getting a stack trace and no info on actually
linking to create a package (when I try various "obvious" things I get
errors indicating a missing main).

Thanks,
Andrew

PS Away from home, so having to use my work address.  Please reply to
the list (which I can read on the 'net and will subscribe to when I get
home) or, if you want to avoid that,
andrew@andrewcooke.free-online.co.uk, which I will read this weekend. 
Work isn't happy about non-work-related emails to this account.  Sorry.


From Keith.Wansbrough@cl.cam.ac.uk Wed Apr 11 10:00:05 2001 Date: Wed, 11 Apr 2001 10:00:05 +0100 From: Keith Wansbrough Keith.Wansbrough@cl.cam.ac.uk Subject: Stack trace on error (and packages)
> 
> Hi,
> 
> Is it possible to persuade ghc/RTS to provide a stack trace (or
> something similar) when an error occurs?  I have some code that is
> generating a runtime error (appears to be due to division by
> almost-zero, provoking very large numbers and then a NaN in a case
> statement when coerced to Double) in a function that is used throughout
> my code - it would be a big help to know which function called the
> function that is generating the error.

Yes.  Compile your program with -prof -auto-all  (you need at least -prof on all modules for the link to work, but -auto-all is only necessary on modules containing functions you want to trace).  This turns on automatic profiling.

Now run your program with the option  `+RTS -xc'   .  This will turn on a cost-centre stack trace, displayed each time your program throws an exception (including runtime errors).

This gives not the program stack (which function demanded which value), but the cost-centre stack (which function called which function which failed), which may or may not be more useful.  The former is only available under `gdb' at the moment, with a very hairy user interface.  You can read about cost centres in chapter 4 of the manual.

My apologies for not having put this properly in the manual yet!

HTH..

--KW 8-)
-- 
Keith Wansbrough <kw217@cl.cam.ac.uk>
http://www.cl.cam.ac.uk/users/kw217/
Cambridge University Computer Laboratory.



From qrczak@knm.org.pl Wed Apr 11 13:19:50 2001 Date: Wed, 11 Apr 2001 14:19:50 +0200 (CEST) From: Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl Subject: IArray and MArray
Is it important to keep the current definition of IArray and MArray
classes? I would like to change class operations, without changing
the interface, i.e. turn methods into ordinary overloaded functions
and have different methods. It would affect users making their own
instances of these classes, but not users of these instances.

The problem is that translation of the index to an Int is coupled with
actual array operations. It's not possible to omit the translation with
the range check in an overloaded way; such operations must be coded
separately for each element type, which is quite painful. It's not
possible to add a method which specifies indexing by Int, because there is
no reasonable default definition, except using (!!) on the index range:
the class Ix doesn't define translation from Int to indices.

Many bulk operations don't need indices but just iterate over the array:
elems, listArray, amap, thaw, freeze, (==), compare (actually compare
is a more complex issue). The performance is horrible if tight loops
do the translation. But if the needed functionality is not in the array,
the operation must be coded for each type separately instead of letting
the compiler do the specialization, and some of these must be matched
with rules.

Class operations define too much. Translation of indices to Ints with
bounds checking is done in the same way for all arrays. These operations
must be polymorphic wrt. index, so they don't have a choice. But they
have to hardwire the translation into individual methods.

I would let operations in IArray and MArray work on Ints and change
current methods to functions overloaded over the array and the index.

-- 
Marcin 'Qrczak' Kowalczyk



From v-julsew@microsoft.com Thu Apr 12 13:17:50 2001 Date: Thu, 12 Apr 2001 05:17:50 -0700 From: Julian Seward (Intl Vendor) v-julsew@microsoft.com Subject: The (Interactive) Glasgow Haskell Compiler -- version 5.00
[Binary builds for x86-linux and sparc-solaris are now
 available.  We're still working on the Windows version.  -- J]


    The (Interactive) Glasgow Haskell Compiler -- version 5.00
   =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

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

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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

5.00 has been majorly revamped since the previous stable version,
4.08.2.
This should be a stable release.  Major changes since 4.08.2 are:

   - An interactive system, similar in style to Hugs.  You can
interactively
     load and unload modules, run expressions, ask the types of things.
     Module dependencies are tracked and chased automatically.
     Combinations of compiled and interpreted modules may be used.
     All the GHC libraries are available in interactive mode, as are
     most of the Glasgow extensions to Haskell 98.  Compilation in
     interactive mode (to bytecode) is about three times faster than
     compiling to object code.

   - Batch compilation of multiple modules at once, with automatic
     dependency chasing.  For large programs this can halve compilation
     times, and removes the need for Makefiles.

   - Enhanced package (library) management system.  Packages may be
     installed and removed from an installation using the ghc-pkg tool.

   - Initial Unicode support - the Char type is now 31 bits.

   - Sparc native code generator, giving much faster compilation on
sparcs.
     (Native code generation for x86s has been available for a while).

   - Improved heap profiling - you can restrict heap profiles
     by type, closure description, cost centre, and module.

   - Support for the latest Foreign Function Interface (FFI)
     proposals.  Marcin Kowalczyk's hsc2hs tool is included.

   - Language extensions: parallel list comprehensions and functional
     dependencies.

   - The usual huge collection of bug fixes.  Most reported bugs have
     been fixed.

For full details see the release notes:

        http://www.haskell.org/ghc/docs/5.00/set/release-5-00.html



 How to get it
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

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 .rpm/.deb form for all you Linux junkies
out there, 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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D

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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

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

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

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
  * alpha-dec-osf{2,3}
  * mips-sgi-irix{5,6}
  * {rs6000,powerpc}-ibm-aix

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

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



 Mailing lists
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

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 send bug reports about GHC to glasgow-haskell-bugs@haskell.org;
GHC users hang out on glasgow-haskell-users@haskell.org.  Bleeding
edge CVS users party on cvs-ghc@haskell.org.


From wbuss@telda.net Thu Apr 12 17:35:23 2001 Date: Thu, 12 Apr 2001 18:35:23 +0200 (MEST) From: Wolfhard Buß wbuss@telda.net Subject: Building ghci
Hello,
i just built and installed ghc 5.00 from the sources
with the help from ghc 4.08.2.
ghci responds with 'ghc-5.00: not built for interactive use'.

Q: How to build ghc with support for interactive use?
Which configure option or makefile target did i miss?

Kind regards,
Wolfhard.



From michael.weber@post.rwth-aachen.de Thu Apr 12 17:45:40 2001 Date: Thu, 12 Apr 2001 18:45:40 +0200 From: Michael Weber michael.weber@post.rwth-aachen.de Subject: Building ghci
On Thu, Apr 12, 2001 at 18:35:23 +0200, Wolfhard Buß wrote:
> Hello,
> i just built and installed ghc 5.00 from the sources
> with the help from ghc 4.08.2.
> ghci responds with 'ghc-5.00: not built for interactive use'.

just rebuild ghc-5.00 with itself again.


Cheers,
M/
-- 
 /~\ ASCII ribbon | "Don't worry about people stealing your ideas.  If your
 \ / campaign     |  ideas are any good, you'll have to ram them down
  X  against      |  people's throats."
 / \ HTML mail    |      -- Howard Aiken


From qrczak@knm.org.pl Sat Apr 14 21:28:16 2001 Date: 14 Apr 2001 20:28:16 GMT From: Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl Subject: How to convert the type signature of a variable to a String?
Mon, 9 Apr 2001 11:52:47 +0200, Pasch, Thomas (ACTGRO) <extern.thomas.pasch@volkswagen.de> pisze:

> So the question is: Is is possible to write a function the gives
> back a String with the signature of the argument of that function?
> 
> For example:
> 
>  'function f' gives the String "a->a" 

No. Classes are not powerful enough to "recognize polymorphism".
In this form it's not even theoretically consistent: any function
can be treated as a function of a more specific type, so the result
would be ambiguous (for example f has type Int->Int too, so asking
for a type should give "Int->Int" too).

The fact that a function can be treated as of more specific types than
originally defined is not a problem when the function is used, because
interpretations according to possible types agree. But when you want
to make a string out of it, they can't agree if they are not trivial:
a value can't behave as both strings "a->a" and "Int->Int".

In Haskell there are almost no cases where an ambiguity is resolved
implicitly, i.e. when one of several correct interpretations is chosen.
There are not many ambiguities at all, and they result in compile
errors if they arise.

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



From andrew@bromage.org Sun Apr 15 05:20:01 2001 Date: Sun, 15 Apr 2001 14:20:01 +1000 From: Andrew J Bromage andrew@bromage.org Subject: How to convert the type signature of a variable to a String?
G'day all.

Mon, 9 Apr 2001 11:52:47 +0200, Pasch, Thomas (ACTGRO) <extern.thomas.pasch@volkswagen.de> pisze:

> > For example:
> > 
> >  'function f' gives the String "a->a" 

On Sat, Apr 14, 2001 at 08:28:16PM +0000, Marcin 'Qrczak' Kowalczyk wrote:

[...]
> In this form it's not even theoretically consistent: any function
> can be treated as a function of a more specific type, so the result
> would be ambiguous (for example f has type Int->Int too, so asking
> for a type should give "Int->Int" too).

I think I understand what you're saying, but I'd just like to understand
this practically.  We know that the most general type of `id' is "a->a".
We assume there's a theoretical function:

	get_the_function_type_of :: a -> String

where a can be a function type.  Now consider:

	f :: (String -> String) -> String
	f g = g (get_the_function_type_of g)

The question is: Should `f id' return "a->a" or "String->String"?

Cheers,
Andrew Bromage


From davidbak@cablespeed.com Sun Apr 15 08:47:32 2001 Date: Sun, 15 Apr 2001 00:47:32 -0700 From: David Bakin davidbak@cablespeed.com Subject: win32 4.08.2 install question
This is a multi-part message in MIME format.

------=_NextPart_000_0022_01C0C545.A784D6D0
Content-Type: text/plain;
	charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

While waiting for 5.00 for win32 I thought I'd get started with 4.08.2 - =
downloaded it today and installed it and the latest cygwin as per =
instructions.  However:  When following the "test the fruits of your =
labour" I invoke "ghc -o main main.hs" and get back a bash prompt and =
that's all.  No files created, e.g., no main.  Same for "ghc -c =
main.hs".  Something trivial must be wrong with my setup.  I've copied =
the ghc/bin/perl to cygwin/bin.  No spaces in any directories (ghc is =
installed at c:\ghc). My mounted dirs look like this:

C:\Cygwin\bin>mount
Device              Directory           Type         Flags
c:\Cygwin\bin       /usr/bin            user         textmode
c:\Cygwin\etc       /etc                user         textmode
c:\Cygwin\lib       /usr/lib            user         textmode
c:                  /                   user         textmode

Anybody have an idea what's going on?  I can't wait to get 5.00 and its =
integral driver!

-- Dave

------=_NextPart_000_0022_01C0C545.A784D6D0
Content-Type: text/html;
	charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252">
<META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3D"Courier New" size=3D2>While waiting for 5.00 for =
win32 I thought=20
I'd get started with 4.08.2 - downloaded it today and installed it and =
the=20
latest cygwin as per instructions.&nbsp; However:&nbsp; When following =
the "test=20
the fruits of your labour" I invoke "ghc -o main main.hs" and get back a =
bash=20
prompt and that's all.&nbsp; No files created, e.g., no main.&nbsp; Same =
for=20
"ghc -c main.hs".&nbsp; Something trivial must be wrong with my =
setup.&nbsp;=20
I've copied the ghc/bin/perl to cygwin/bin.&nbsp; No spaces in any =
directories=20
(ghc is installed at c:\ghc). My mounted dirs look like =
this:</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New"=20
size=3D2>C:\Cygwin\bin&gt;mount<BR>Device&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Directory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Flags<BR>c:\Cygwin\bin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
/usr/bin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
user&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
textmode<BR>c:\Cygwin\etc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
/etc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;=20
user&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
textmode<BR>c:\Cygwin\lib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
/usr/lib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
user&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
textmode<BR>c:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
user&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
textmode</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>Anybody have an idea what's =
going on?&nbsp;=20
I can't wait to get&nbsp;5.00 and its integral driver!</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>-- =
Dave</FONT></DIV></BODY></HTML>

------=_NextPart_000_0022_01C0C545.A784D6D0--



From qrczak@knm.org.pl Sun Apr 15 13:09:29 2001 Date: 15 Apr 2001 12:09:29 GMT From: Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl Subject: How to convert the type signature of a variable to a String?
Sun, 15 Apr 2001 14:20:01 +1000, Andrew J Bromage <andrew@bromage.org> pisze:

> We know that the most general type of `id' is "a->a".
> We assume there's a theoretical function:
> 
> 	get_the_function_type_of :: a -> String
> 
> where a can be a function type.  Now consider:
> 
> 	f :: (String -> String) -> String
> 	f g = g (get_the_function_type_of g)
> 
> The question is: Should `f id' return "a->a" or "String->String"?

Inside f the variable g has type String->String. It doesn't matter
that the expression used to build this argument could be used on
another type too: the level of concreteness of the type is not a
part of the object having that type, but a property of the variable
through which we access it.

It would return "String->String" (assuming that
get_the_function_type_of was in some sense possible). Any other
overloaded function would be also used as for String->String instead of
reporting an ambiguity error, where using it for 'id' directly could
report an ambiguity error if the instance is not defined uniformly
for all types of function arguments and results but depends on a
particular choice of them.

In other words all instances of an overloaded function must agree on
the level to which they examine the type. If one of them doesn't look
at a fragment of the type (e.g. function argument), others can't too;
if one of them depends on them, the type must be determined in order
to make a usage unambiguous.

ghc has -fallow-overlapping-instances which relaxes this requirement.
It allows fallbacks: when a type doesn't fit to any instance, try
to use a more general one. It still doesn't make calls which don't
determine that type unambiguous, and doesn't allow to recognize the
fact that a variable is polymorphic. It has some strange properties,
e.g. importing a module (which defines some instances) can change a
valid program into another valid program with a different meaning.

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



From chak@cse.unsw.edu.au Sun Apr 15 15:15:39 2001 Date: Mon, 16 Apr 2001 00:15:39 +1000 From: Manuel M. T. Chakravarty chak@cse.unsw.edu.au Subject: The (Interactive) Glasgow Haskell Compiler -- version 5.00
"Julian Seward (Intl Vendor)" <v-julsew@microsoft.com> wrote,

>     The (Interactive) Glasgow Haskell Compiler -- version 5.00
>    ============================================================
> 
> We are pleased to announce a new major release of the Glasgow Haskell
> Compiler (GHC), version 5.00.  The source distribution is freely
> available via the World-Wide Web and through anon. FTP, under a
> BSD-style license.  See below for download details.

The source tar ball misses the configure scripts (it has the
`configure.in's, but the source tar ball should be
autoconf'ed, shouldn't it?)

Cheers,
Manuel


From qrczak@knm.org.pl Sun Apr 15 15:29:59 2001 Date: 15 Apr 2001 14:29:59 GMT From: Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl Subject: The (Interactive) Glasgow Haskell Compiler -- version 5.00
Mon, 16 Apr 2001 00:15:39 +1000, Manuel M. T. Chakravarty <chak@cse.unsw.edu.au> pisze:

> The source tar ball misses the configure scripts (it has the
> `configure.in's, but the source tar ball should be
> autoconf'ed, shouldn't it?)

BTW, IMHO 'make maintainer-clean' should not delete configure scripts
(comments say that it doesn't, but it does).

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



From qrczak@knm.org.pl Sun Apr 15 17:02:12 2001 Date: 15 Apr 2001 16:02:12 GMT From: Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl Subject: IArray and MArray
Wed, 11 Apr 2001 14:19:50 +0200 (CEST), Marcin 'Qrczak' Kowalczyk <qrczak@knm.org.pl> pisze:

> Is it important to keep the current definition of IArray and MArray
> classes? I would like to change class operations, without changing
> the interface, i.e. turn methods into ordinary overloaded functions
> and have different methods. It would affect users making their own
> instances of these classes, but not users of these instances.

Too late to complain :-)
I've done this.

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



From davidbak@cablespeed.com Sun Apr 15 18:42:13 2001 Date: Sun, 15 Apr 2001 10:42:13 -0700 From: David Bakin davidbak@cablespeed.com Subject: solved! Fw: win32 4.08.2 install question
This is a multi-part message in MIME format.

------=_NextPart_000_000D_01C0C598.BB179680
Content-Type: text/plain;
	charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

Found the problem in Sigbj=F8rn Finne's FAQ at =
http://www.dcs.gla.ac.uk/~sof/ghc-win32-faq.html:  I had no /bin, only a =
/usr/bin. I've gotten hello world to compile so I'm off and running.  If =
5.00 wasn't switching to a Haskell driver I'd suggest updating the GHC =
installation on windows page with this FAQ.  -- Dave

$ mount
Device              Directory           Type         Flags
c:\Cygwin\bin       /bin                user         textmode
c:\Cygwin\etc       /etc                user         textmode
c:\Cygwin\lib       /usr/lib            user         textmode
c:                  /                   user         textmode


----- Original Message -----=20
From: David Bakin=20
To: glasgow-haskell-users@haskell.org=20
Sent: Sunday, April 15, 2001 12:47 AM
Subject: win32 4.08.2 install question


While waiting for 5.00 for win32 I thought I'd get started with 4.08.2 - =
downloaded it today and installed it and the latest cygwin as per =
instructions.  However:  When following the "test the fruits of your =
labour" I invoke "ghc -o main main.hs" and get back a bash prompt and =
that's all.  No files created, e.g., no main.  Same for "ghc -c =
main.hs".  Something trivial must be wrong with my setup.  I've copied =
the ghc/bin/perl to cygwin/bin.  No spaces in any directories (ghc is =
installed at c:\ghc). My mounted dirs look like this:

C:\Cygwin\bin>mount
Device              Directory           Type         Flags
c:\Cygwin\bin       /usr/bin            user         textmode
c:\Cygwin\etc       /etc                user         textmode
c:\Cygwin\lib       /usr/lib            user         textmode
c:                  /                   user         textmode

Anybody have an idea what's going on?  I can't wait to get 5.00 and its =
integral driver!

-- Dave

------=_NextPart_000_000D_01C0C598.BB179680
Content-Type: text/html;
	charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252">
<META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2><FONT face=3D"Courier New">Found the problem <FONT =
size=3D3>in=20
</FONT><FONT size=3D3>Sigbj=F8rn Finne's FAQ at <A=20
href=3D"http://www.dcs.gla.ac.uk/~sof/ghc-win32-faq.html">http://www.dcs.=
gla.ac.uk/~sof/ghc-win32-faq.html</A>:&nbsp;=20
I had no /bin, only a /usr/bin. I've gotten hello world to compile so =
I'm off=20
and running.&nbsp; If 5.00 wasn't&nbsp;switching to a Haskell driver=20
I'd&nbsp;suggest updating the GHC installation on windows page with this =

FAQ.&nbsp; -- Dave</FONT></FONT></FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>$=20
mount<BR>Device&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;=20
Directory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Flags<BR>c:\Cygwin\bin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
/bin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;=20
user&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
textmode<BR>c:\Cygwin\etc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
/etc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;=20
user&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
textmode<BR>c:\Cygwin\lib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
/usr/lib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
user&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
textmode<BR>c:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
user&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
textmode</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV style=3D"FONT: 10pt arial">----- Original Message -----=20
<DIV style=3D"BACKGROUND: #e4e4e4; font-color: black"><B>From:</B> <A=20
title=3Ddavidbak@cablespeed.com =
href=3D"mailto:davidbak@cablespeed.com">David=20
Bakin</A> </DIV>
<DIV><B>To:</B> <A title=3Dglasgow-haskell-users@haskell.org=20
href=3D"mailto:glasgow-haskell-users@haskell.org">glasgow-haskell-users@h=
askell.org</A>=20
</DIV>
<DIV><B>Sent:</B> Sunday, April 15, 2001 12:47 AM</DIV>
<DIV><B>Subject:</B> win32 4.08.2 install question</DIV></DIV>
<DIV><BR></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>While waiting for 5.00 for =
win32 I thought=20
I'd get started with 4.08.2 - downloaded it today and installed it and =
the=20
latest cygwin as per instructions.&nbsp; However:&nbsp; When following =
the "test=20
the fruits of your labour" I invoke "ghc -o main main.hs" and get back a =
bash=20
prompt and that's all.&nbsp; No files created, e.g., no main.&nbsp; Same =
for=20
"ghc -c main.hs".&nbsp; Something trivial must be wrong with my =
setup.&nbsp;=20
I've copied the ghc/bin/perl to cygwin/bin.&nbsp; No spaces in any =
directories=20
(ghc is installed at c:\ghc). My mounted dirs look like =
this:</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New"=20
size=3D2>C:\Cygwin\bin&gt;mount<BR>Device&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Directory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Flags<BR>c:\Cygwin\bin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
/usr/bin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
user&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
textmode<BR>c:\Cygwin\etc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
/etc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;=20
user&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
textmode<BR>c:\Cygwin\lib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
/usr/lib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
user&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
textmode<BR>c:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
user&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
textmode</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>Anybody have an idea what's =
going on?&nbsp;=20
I can't wait to get&nbsp;5.00 and its integral driver!</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>-- =
Dave</FONT></DIV></BODY></HTML>

------=_NextPart_000_000D_01C0C598.BB179680--



From chak@cse.unsw.edu.au Mon Apr 16 04:52:31 2001 Date: Mon, 16 Apr 2001 13:52:31 +1000 From: Manuel M. T. Chakravarty chak@cse.unsw.edu.au Subject: The (Interactive) Glasgow Haskell Compiler -- version 5.00
qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) wrote,

> Mon, 16 Apr 2001 00:15:39 +1000, Manuel M. T. Chakravarty <chak@cse.unsw.edu.au> pisze:
> 
> > The source tar ball misses the configure scripts (it has the
> > `configure.in's, but the source tar ball should be
> > autoconf'ed, shouldn't it?)
> 
> BTW, IMHO 'make maintainer-clean' should not delete configure scripts
> (comments say that it doesn't, but it does).

I agree.

Manuel


From chak@cse.unsw.edu.au Mon Apr 16 13:13:04 2001 Date: Mon, 16 Apr 2001 22:13:04 +1000 From: Manuel M. T. Chakravarty chak@cse.unsw.edu.au Subject: The (Interactive) Glasgow Haskell Compiler -- version 5.00
"Julian Seward (Intl Vendor)" <v-julsew@microsoft.com> wrote,

> [Binary builds for x86-linux and sparc-solaris are now
>  available.  We're still working on the Windows version.  -- J]
> 
> 
>     The (Interactive) Glasgow Haskell Compiler -- version 5.00
>    ============================================================

RPM packages for x86 built on RedHat Linux 7.0/glibc 2.2 are
now available at

  ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/i386/ghc-5.00-2.i386.rpm
  ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/i386/ghc-prof-5.00-2.i386.rpm

with the source RPM at

  ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/src/ghc-5.00-2.src.rpm

Manuel


From mechvel@math.botik.ru Tue Apr 17 13:08:04 2001 Date: Tue, 17 Apr 2001 16:08:04 +0400 From: S.D.Mechveliani mechvel@math.botik.ru Subject: sgml
Hello,

I want to install GHC-5.00 (from binaries, on Linux). 
But the installation guide, as most documentation, is in the  .sgml 
format. I can read  ASCII, .dvi, .ps, .tex, html  texts.
But what to do with  .sgml,  please?

-----------------
Serge Mechveliani
mechvel@botik.ru


From christian.lescher@icn.siemens.de Tue Apr 17 16:12:19 2001 Date: Tue, 17 Apr 2001 17:12:19 +0200 From: Lescher Christian christian.lescher@icn.siemens.de Subject: Haskell2Xml - Some questions
Hi Malcom,

While doing my first steps with Haskell2Xml, some more questions arose:

- Is there any support for floating point numbers (e.g. Double)?
- Is it possible to read/write XML data directly from/to strings =
(instead of using readXml and writeXml)? This is especially interesting =
when exposing Haskell functions within a Win DLL (and that's what I =
want to do after all).
- May I tell Haskell2Xml somehow to leave out the DTD output and write =
only the "data contents"?

Regards, Christian

-----------------------------------------------------------------
Christian Lescher
Siemens AG
ICN WN CS PL T 1, Mch H/Ko 9, 5741/237
Hofmannstr. 51, 81359 M=FCnchen, Deutschland
Tel. +49 (0) 89-722-47737
Fax: +49 (0) 89-722-35320
E-Mail: christian.lescher@icn.siemens.de
-----------------------------------------------------------------
In case of tool problems please call our hotline +49 89 722 44444.



From John.Velman@HSC.com Tue Apr 17 21:48:54 2001 Date: Tue, 17 Apr 2001 13:48:54 -0700 From: John.Velman@HSC.com John.Velman@HSC.com Subject: compiling ghc 5.0 with cygwin
I am using Cygwin on an NT4SP5.  I have a recent (i.e.,
up to date) installation of Cygwin (1.1.8-2).

I installed ghc 4.08.2, and it seems to work.  At least
the simple "hello" works, and happy-1.9 seemed to compile
and install with no problems.

When I tried to compile ghc-5.00, my "make" run ends with
the following error

______
....tail of make output:
------------------------------------------------------------------------
==fptools== make boot - --unix - --no-print-directory -r;
 in /home/newarchives/haskell/ghc5/ghc-5.00/ghc/utils/hsc2hs
------------------------------------------------------------------------
Creating Config.hs ... done.
make INSTALLING=0 BIN_DIST=0 - --unix - --no-print-directory -r all
/usr/local/bin/ghc -package util -O    -c Config.hs -o Config.o -osuf o
/usr/local/bin/ghc -package util -O    -c KludgedSystem.hs -o KludgedSystem.o -o
suf o
/usr/local/bin/ghc -package util -O    -c Main.hs -o Main.o -osuf o
/usr/local/bin/ghc -o hsc2hs-bin -package util -O       Config.o KludgedSystem.o
 Main.o
V:/usr/local/lib/ghc/ghc-4.08.2/lib/libHSstd.a(Time.o)(.text+0x1c42c):ghc1360.c:
 undefined reference to `_imp___timezone_dll'
collect2: ld returned 1 exit status
make[4]: *** [hsc2hs-bin] Error 1
make[3]: *** [all] Error 2
make[2]: *** [boot] Error 1
make[1]: *** [boot] Error 1
make[1]: Leaving directory `/home/newarchives/haskell/ghc5/ghc-5.00/ghc'
make: *** [all] Error 1
_______

Has anyone seen this before -- is it a cygwin bug or a ghc bug?  Well,
you know all the questions.

I hope someone knows the answers!

John Velman
john.velman@hsc.com



From chak@cse.unsw.edu.au Wed Apr 18 09:40:56 2001 Date: Wed, 18 Apr 2001 18:40:56 +1000 From: Manuel M. T. Chakravarty chak@cse.unsw.edu.au Subject: The (Interactive) Glasgow Haskell Compiler -- version 5.00
> >     The (Interactive) Glasgow Haskell Compiler -- version 5.00
> >    ============================================================
> 
> RPM packages for x86 built on RedHat Linux 7.0/glibc 2.2 are
> now available at
> 
>   ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/i386/ghc-5.00-2.i386.rpm
>   ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/i386/ghc-prof-5.00-2.i386.rpm

There are now also x86 RPMS for RedHat Linux 6.2 at

  ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/i386-rh6.2/ghc-5.00-2.i386.rpm
  ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/i386-rh6.2/ghc-prof-5.00-2.i386.rpm

This build has been kindly contributed by Tom Moertel.

Manuel


From joe@isun.informatik.uni-leipzig.de Wed Apr 18 13:52:12 2001 Date: Wed, 18 Apr 2001 14:52:12 +0200 (MET DST) From: Johannes Waldmann joe@isun.informatik.uni-leipzig.de Subject: how to implement timeouts for IO operations?
what is the Right Way to impose a timeout condition on IO actions?
the GHC manual says ( http://www.haskell.org/ghc/docs/5.00/set/select.html )
"use threadDelay and  asynchronous exceptions". When I do this:

timed :: Int -> IO a -> IO a
timed d action = do

    let timer = do	  
	    threadDelay d
	    throw $ AssertionFailed "timer expired"

    t <- forkIO timer
    x <- action
    killThread t
    return x

it seems to work, but how do I turn off the "Fail: thread killed" messages?

-- 
-- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ --
-- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 --


From christian.lescher@icn.siemens.de Wed Apr 18 17:02:16 2001 Date: Wed, 18 Apr 2001 18:02:16 +0200 From: Lescher Christian christian.lescher@icn.siemens.de Subject: AW: Haskell2Xml - Some questions
> > - Is there any support for floating point numbers (e.g. Double)?
> 
> XML does not (as far as I know) have any built-in concept of floating
> point numbers, so neither does HaXml.  However, within HaXml you
> have the full power of Haskell available to you, so if you wish to
> read, write, or process Doubles from/to some string content (or element
> attributes), you can probably code it yourself quite easily.
> 
	In case of Haskell2Xml, what about a conversion like this:

	  <double value="123.45"/>

	Is this easy to implement?

	Regards, Christian



From qrczak@knm.org.pl Wed Apr 18 18:34:16 2001 Date: 18 Apr 2001 17:34:16 GMT From: Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl Subject: how to implement timeouts for IO operations?
Wed, 18 Apr 2001 14:52:12 +0200 (MET DST), Johannes Waldmann <joe@isun.informatik.uni-leipzig.de> pisze:

> it seems to work, but how do I turn off the "Fail: thread killed" messages?

import Exception

    t <- block $ forkIO $ catchJust asyncExceptions
        (unblock timer)
        (\_ -> return ())

Perhaps the message about killing a thread will not appear in future
versions of ghc. A discussion about it on this list stopped six
weeks ago.

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



From joe@isun.informatik.uni-leipzig.de Wed Apr 18 20:36:04 2001 Date: Wed, 18 Apr 2001 21:36:04 +0200 (MET DST) From: Johannes Waldmann joe@isun.informatik.uni-leipzig.de Subject: how to implement timeouts for IO operations?
Thank you, Marcin. 

Your reply seems to imply that the structure
of the program I posted was basically OK?


A slightly related point, I was having difficulties with TimeDiff 
values - I got negative tdPicosecs sometimes,
and some functions (show) even dumped core.

Are such problems known (I am using a binary ghc-4.08)?
For the moment, I switched to Posix.EpochTime.


I found TimeDiff and ClockTime quite restrictive:
they are not instances of Num, I can't add/subtract/negate TimeDiffs;
and I cannot generate a zero ClockTime.
(In my application, I need to simulate two clocks,
where always one is running, the other one is stopped -
as used in tournament Chess.)

-- 
-- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ --
-- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 --


From michael.weber@post.rwth-aachen.de Wed Apr 18 21:08:42 2001 Date: Wed, 18 Apr 2001 22:08:42 +0200 From: Michael Weber michael.weber@post.rwth-aachen.de Subject: how to implement timeouts for IO operations?
On Wed, Apr 18, 2001 at 21:36:04 +0200, Johannes Waldmann wrote:
> A slightly related point, I was having difficulties with TimeDiff 
> values - I got negative tdPicosecs sometimes,
> and some functions (show) even dumped core.
> 
> Are such problems known (I am using a binary ghc-4.08)?
> For the moment, I switched to Posix.EpochTime.
> 
> 
> I found TimeDiff and ClockTime quite restrictive:
> they are not instances of Num, I can't add/subtract/negate TimeDiffs;
> and I cannot generate a zero ClockTime.
> (In my application, I need to simulate two clocks,
> where always one is running, the other one is stopped -
> as used in tournament Chess.)

Despite my humble try, TimeDiff and ClockTime (Time.lhs) are still
b0rked.  Use on your own risk (and read the comments at the top).
Sorry for that...


Cheers,
Michael


From Tom.Pledger@peace.com Wed Apr 18 22:15:16 2001 Date: Thu, 19 Apr 2001 09:15:16 +1200 From: Tom Pledger Tom.Pledger@peace.com Subject: how to implement timeouts for IO operations?
Johannes Waldmann writes:
 | Thank you, Marcin. 
 | 
 | Your reply seems to imply that the structure
 | of the program I posted was basically OK?

Another way appears as an example in Tackling The Awkward Squad (in
the Using Asynchronous Exceptions section).  It's a bit more liberal
in its use of threads, doing forkIO twice within parIO, but the
overall effect is pretty similar to your function's.

    timeout :: Int -> IO a -> IO (Maybe a)
    timeout n a = parIO (do { r <- a; return (Just r) })
                        (do { threadDelay n; return Nothing })


From andreas.siglreithmayr@sdm-research.de Thu Apr 19 09:20:42 2001 Date: Thu, 19 Apr 2001 10:20:42 +0200 From: andreas.siglreithmayr@sdm-research.de andreas.siglreithmayr@sdm-research.de Subject: Where can I get "Main.dll_o" and "PrelMain.dll_o"?
I run ghc under cygwin WinNT.
If I compile a simple HelloWorld program as described in the instalation descripton, I get the following error:

$ ghc -o main main.hs
gcc: D:/Unix/ghc/lib/Main.dll_o: No such file or directory
gcc: D:/Unix/ghc/lib/PrelMain.dll_o: No such file or directory

Do you know whats wrong?
Or where can I get the files?

--
Andreas Siglreithmayr			mailto:Andreas.Siglreithmayr@sdm-research.de
sd&m Research GmbH			http://www.sdm.de
Thomas-Dehler-Str. 18 , D-81737 Muenchen, Germany
Tel +49 89 63812-917  Fax -150




From joe@isun.informatik.uni-leipzig.de Thu Apr 19 09:38:20 2001 Date: Thu, 19 Apr 2001 10:38:20 +0200 (MET DST) From: Johannes Waldmann joe@isun.informatik.uni-leipzig.de Subject: how to implement timeouts for IO operations?
>     timeout n a = parIO (do { r <- a; return (Just r) })
>                         (do { threadDelay n; return Nothing })

oh, I this looks better (to me) since it doesn't use exceptions!
does parIO kill the `other' thread? 
still I don't find parIO (in ghc-4.08), in what module is it?

-- 
-- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ --
-- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 --


From joe@isun.informatik.uni-leipzig.de Thu Apr 19 10:08:14 2001 Date: Thu, 19 Apr 2001 11:08:14 +0200 (MET DST) From: Johannes Waldmann joe@isun.informatik.uni-leipzig.de Subject: how to implement timeouts for IO operations?
OK, I was being a bit stupid this morning.
Now I see that `parIO' is not in the ghc libs,
but programmed explicitely in the `Tackling the awkward sqaud' paper.
http://research.microsoft.com/~simonpj/papers/marktoberdorf.htm
-- 
-- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ --
-- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 --


From v-julsew@microsoft.com Fri Apr 20 10:30:02 2001 Date: Fri, 20 Apr 2001 02:30:02 -0700 From: Julian Seward (Intl Vendor) v-julsew@microsoft.com Subject: sgml
The documentation should be supplied in .html and .ps files,
at least in the .tar.bz2 binary build I did, and, I presume
in the RedHat 6.2/7.0 RPMs.  Are you saying this is not the case?

J

| -----Original Message-----
| From: S.D.Mechveliani [mailto:mechvel@math.botik.ru]
| Sent: Tuesday, April 17, 2001 1:08 PM
| To: glasgow-haskell-users@haskell.org
| Subject: sgml
|=20
|=20
| Hello,
|=20
| I want to install GHC-5.00 (from binaries, on Linux).=20
| But the installation guide, as most documentation, is in the  .sgml=20
| format. I can read  ASCII, .dvi, .ps, .tex, html  texts.
| But what to do with  .sgml,  please?
|=20
| -----------------
| Serge Mechveliani
| mechvel@botik.ru
|=20
| _______________________________________________
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users@haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
|=20


From mechvel@math.botik.ru Fri Apr 20 12:49:20 2001 Date: Fri, 20 Apr 2001 15:49:20 +0400 From: S.D.Mechveliani mechvel@math.botik.ru Subject: no problem with .sgml
I wrote recently

| I want to install GHC-5.00 (from binaries, on Linux).
| But the installation guide, as most documentation, is in the  .sgml
| format. I can read  ASCII, .dvi, .ps, .tex, html  texts.
| But what to do with  .sgml,  please?


Forget this question, please.

Because I un-archivated the binaries and found there the needed docs on 
ghc in the needed formats.

-----------------
Serge Mechveliani
mechvel@botik.ru




From christian@lescher.de Fri Apr 20 17:05:17 2001 Date: Fri, 20 Apr 2001 18:05:17 +0200 From: Christian Lescher christian@lescher.de Subject: GHC 5.0 - InstallShield for Windows?
When do you expect an InstallShield version of GHC 5.0 for Windows?

Christian




From rrt@dcs.gla.ac.uk Fri Apr 20 17:23:42 2001 Date: Fri, 20 Apr 2001 17:23:42 +0100 (BST) From: Reuben Thomas rrt@dcs.gla.ac.uk Subject: GHC 5.0 - InstallShield for Windows?
> When do you expect an InstallShield version of GHC 5.0 for Windows?

We have to get the Windows linker working first. Given the current bugginess
of 5.0, the likely answer is "not very soon".

-- 
http://sc3d.org/rrt/ | Caution Children At Play Drive Slowly



From matth@mindspring.com Sun Apr 22 14:45:45 2001 Date: Sun, 22 Apr 2001 08:45:45 -0500 From: Matt Harden matth@mindspring.com Subject: An attempt at foldr/build fusion for zip
Hi,

I think I may have found a way to get zip & friends to fuse with *both*
of their input lists.  I am not a heavy ghc hacker, though, so I may be
missing something important that makes this unworkable.  I have no idea
what kind of code this would actually end up creating.

Anyway, here's my attempt; it ties in with the current foldr2 scheme.  I
eagerly any await comments or questions, especially from the foldr/build
gurus.

-- foldr2_both.lhs:
Attempting to fuse zip with both input lists.
We seem to be forced to use a recursive datatype to accomplish this.
We're using newtype, so there should be no overhead from
construction/deconstruction of this type, right?

\begin{code}
newtype BuildZip a b = BZ ((a -> (BuildZip a b) -> b) -> b)

bz :: (forall b. (a->b->b)->b->b) -> b -> BuildZip a b
bz f n = f (\x xs -> BZ (\c -> c x xs)) (BZ (\_ -> n))
{-# INLINE bz #-}

foldr2_both :: (a->b->c->c) -> BuildZip a c -> BuildZip b c -> c
foldr2_both k (BZ xs) (BZ ys) =
       xs (\x xs' ->
       ys (\y ys' ->
           k x y (foldr2_both k xs' ys')
       ) )

{-# RULES
"foldr2/both"   forall k n (f::forall z.(a->z->z)->z->z)
                           (g::forall z.(b->z->z)->z->z) .
                  foldr2 k n (build f) (build g) =
                    foldr2_both k (bz f n) (bz g n)
 #-}
\end{code}
-- END foldr2_both.lhs

Best regards,
Matt Harden


From michaelw@debian.org Sun Apr 22 15:44:54 2001 Date: Sun, 22 Apr 2001 16:44:54 +0200 From: Michael Weber michaelw@debian.org Subject: The (Interactive) Glasgow Haskell Compiler -- version 5.00
>     The (Interactive) Glasgow Haskell Compiler -- version 5.00
>    ============================================================
> 
> We are pleased to announce a new major release of the Glasgow Haskell
> Compiler (GHC), version 5.00.  The source distribution is freely
> available via the World-Wide Web and through anon. FTP, under a
> BSD-style license.  See below for download details.  Pre-built
> packages for Linux, FreeBSD, Solaris and Win32 are also available.
[...]


Debian packages for GHC 5.00 are available for some days now in the
'unstable' distribution.  They should have hit the mirrors already, so
please choose the nearest one.  More info on that below.


Important Changes/Notes
=======================
* It is possible now to install the new packages of ghc4 and ghc5
  simultaneously.  The system-wide default (/usr/bin/ghc) can be
  chosen via the 'alternatives' system.  For more info on that, refer
  to the according docs[1].


* The ghc[45] and related packages are now dependent on libgmp3(-dev)
  instead of libgmp2(-dev).  This is due to some forthcoming changes
  in Debian and because libgmp2 isn't maintained upstream for some
  time now.


* Also, there are new packages for happy and c2hs available.

  happy is the latest CVS version, since 1.9 didn't play with ghc5 well.
  It should work with both ghc4 and ghc5 now.
  
  c2hs is compiled for ghc5, so it won't work with ghc4.  If you are
  still dependent on ghc4&c2hs, you may want to recompile it
  yourself[2] and mark it as 'hold'.


* As usual, the packages come with all sorts of documentation.
  They're viewable via the 'doc-base' infrastructure at
  	http://localhost/doc/HTML/
	
  (provided the 'dhelp' package and the usual WWW tools are installed)
  
  Along with other formats like PostScript/DVI, the HTML documentation
  also is browseable at: /usr/share/doc/ghc*/*
  

[1] man update-alternatives
[2] 1) make ghc4 the default compiler
    2) install all build dependencies (with apt-get >= 0.5.3, you can
       achieve this with: ``apt-get build-dep c2hs'')
    3) build the source:  ``apt-get source --compile c2hs''.  That
       should download the c2hs sources and produce packages suited
       for use with ghc4.


Availability
============
Currently, the latest packages on the Debian servers are for
'unstable' (aka sid). They will hit the 'testing' distribution (aka
woody) in about 10 days, provided no critical bugs pop up during that
period.

As a consequence, GHC is built against the latest libraries in
'unstable', including libc6 (>= 2.2.2-2).  I am sorry, but at the
moment I cannot make any promises about when packages for 'stable'
(aka potato) will be available.

However, a complete list of all mirrors is available from:
	http://www.debian.org/misc/README.mirrors

You can use the package `netselect'[3] to determine the fastest of a
list of servers.


[3] http://packages.debian.org/stable/net/netselect.html


APT lines:
	deb     http://ftp.debian.org/debian/ unstable main contrib
	deb-src http://ftp.debian.org/debian/ unstable main contrib


WWW:
	http://packages.debian.org/unstable/devel/ghc4.html
	http://packages.debian.org/unstable/devel/ghc5.html
	http://packages.debian.org/unstable/devel/happy.html
	http://packages.debian.org/unstable/devel/c2hs.html


Name         Version              Description
============-====================-====================================================================================
ghc4         4.08.1-5             GHC - the Glasgow Haskell Compilation system
ghc4-doc     4.08.1-5             Documentation for GHC - the Glasgow Haskell Compilation system
ghc4-libsrc  4.08.1-5             Library Sources of GHC - the Glasgow Haskell Compilation system
ghc4-prof    4.08.1-5             Profiling Libs for GHC - the Glasgow Haskell Compilation system

ghc5         5.00-1               GHC - the Glasgow Haskell Compilation system
ghc5-doc     5.00-1               Documentation for GHC - the Glasgow Haskell Compilation system
ghc5-libsrc  5.00-1               Library Sources of GHC - the Glasgow Haskell Compilation system
ghc5-prof    5.00-1               Profiling Libs for GHC - the Glasgow Haskell Compilation system

c2hs         0.8.2-2              C->Haskell Interface Generator
happy        1.9+1.10.20010417-1  The Parser generator for Haskell


Cheers,
Michael


From rrt@dcs.gla.ac.uk Mon Apr 23 11:41:12 2001 Date: Mon, 23 Apr 2001 11:41:12 +0100 (BST) From: Reuben Thomas rrt@dcs.gla.ac.uk Subject: New InstallShield: Free At Last
I've uploaded a new InstallShield for GHC 4.08.2 for Windows which includes
*all* the programs required to use and even rebuild GHC from source [GHC
developers should note that it doesn't include everything needed to build
from CVS; see the most recent 5.00 docs in CVS for details]. This means that
there's no longer any need to install Cygwin.

Since GHC needs bash to work, and building it requires mv, rm and cp, plus
many other basic utilities, you get a reasonably nice minimal command-line
environment anyway; I've added ls to the mix for extra comfort.

Although the InstallShield is now 20M, overall there's far less to download,
and now GHC should break far less often. Another implication of this
development is that the Windows version of 5.00 should now happen sooner
rather than later.

One caveat: the installation instructions on haskell.org are now somewhat
out of date. I'll try to correct that soonish.

-- 
http://sc3d.org/rrt/ | Si hoc legere scis nimium eruditionis habes.



From simonmar@microsoft.com Mon Apr 23 14:56:02 2001 Date: Mon, 23 Apr 2001 14:56:02 +0100 From: Simon Marlow simonmar@microsoft.com Subject: Stack trace on error (and packages)
> Also, less importantly, how do I generate packages?  I have a bunch of
> .o files (modules) all compiled using -package-name and -c,=20
> but I can't
> find the correct ghc flag to link them into a library (.a/Linux).

You use the usual 'ar' tool for making a .a library, something like:

	$ ar cru libfoo.a a.o b.o c.o

To make this into a package, see the section on packages in the user's
guide:

	http://www.haskell.org/ghc/docs/5.00/set/packages.html

Cheers,
	Simon


From simonmar@microsoft.com Mon Apr 23 15:00:08 2001 Date: Mon, 23 Apr 2001 15:00:08 +0100 From: Simon Marlow simonmar@microsoft.com Subject: The (Interactive) Glasgow Haskell Compiler -- version 5.00
> Mon, 16 Apr 2001 00:15:39 +1000, Manuel M. T. Chakravarty=20
> <chak@cse.unsw.edu.au> pisze:
>=20
> > The source tar ball misses the configure scripts (it has the
> > `configure.in's, but the source tar ball should be
> > autoconf'ed, shouldn't it?)
>=20
> BTW, IMHO 'make maintainer-clean' should not delete configure scripts
> (comments say that it doesn't, but it does).

I dunno.  'make distclean' leaves the configure scripts in place, 'make
maintainer-clean' is supposed to get you back to a pristine tree as it
would be if it were just checked out from CVS.

Cheers,
	Simon


From olaf@cs.york.ac.uk Mon Apr 23 14:57:50 2001 Date: Mon, 23 Apr 2001 14:57:50 +0100 From: Olaf Chitil olaf@cs.york.ac.uk Subject: An attempt at foldr/build fusion for zip
Hi Matt,

> I think I may have found a way to get zip & friends to fuse with *both*
> of their input lists.
> ...
> I have no idea
> what kind of code this would actually end up creating.

However, that is the important point. The goal of deforestation/fusion
is to optimise a program. Removing data structures is not the final
goal. In principal you can replace all algebraic data types by higher
order functions (at least with the second order types that ghc allows).
You just don't gain anything by doing it.

I'm sorry that I don't have the time to look into your definition in
detail. But basically you replace the intermediate list by higher order
functions. Your foldr2_both does about the same amount of work as
foldr2. Fusion of foldr2 with both arguments should give an expression
without any recursively defined function (i.e. any foldr variant).

Btw: The real benefit of deforestation does not come from saving the
time for constructing and destructing the intermediate list. The real
benefit comes from moving the code for the construction of an element
next to the code for destructing the element which usally enables many
further optimisations.

A solution to the zip fusion problem is presented by John Launchbury,
Sava Krstic, and Tim Sauerwein in:
http://www.cse.ogi.edu/PacSoft/publications/phaseiiiq13papers/zipfusion.pdf
I haven't yet looked into it in detail. Some problems with this approach
are mentioned in the paper and I suppose they are the reason why the
approach is not used in ghc.

> \begin{code}
> newtype BuildZip a b = BZ ((a -> (BuildZip a b) -> b) -> b)
> 
> bz :: (forall b. (a->b->b)->b->b) -> b -> BuildZip a b
> bz f n = f (\x xs -> BZ (\c -> c x xs)) (BZ (\_ -> n))
> {-# INLINE bz #-}
> 
> foldr2_both :: (a->b->c->c) -> BuildZip a c -> BuildZip b c -> c
> foldr2_both k (BZ xs) (BZ ys) =
>        xs (\x xs' ->
>        ys (\y ys' ->
>            k x y (foldr2_both k xs' ys')
>        ) )
> 
> {-# RULES
> "foldr2/both"   forall k n (f::forall z.(a->z->z)->z->z)
>                            (g::forall z.(b->z->z)->z->z) .
>                   foldr2 k n (build f) (build g) =
>                     foldr2_both k (bz f n) (bz g n)
>  #-}
> \end{code}

Olaf

-- 
OLAF CHITIL, 
 Dept. of Computer Science, University of York, York YO10 5DD, UK. 
 URL: http://www.cs.york.ac.uk/~olaf/
 Tel: +44 1904 434756; Fax: +44 1904 432767


From simonmar@microsoft.com Mon Apr 23 15:36:09 2001 Date: Mon, 23 Apr 2001 15:36:09 +0100 From: Simon Marlow simonmar@microsoft.com Subject: how to implement timeouts for IO operations?
The correct way to implement timeout in GHC 5.00 is below.  This should
really be in a library somewhere.

This implementation works for GHC's current "blocking" semantics for
throwTo, but if we change the semantics of throwTo to match the
asynchronous exceptions paper
(http://www.haskell.org/~simonmar/papers/async.ps.gz) then a different
implementation of timeout will be needed.

Cheers,
	Simon

------------------------------------------------------------------------
-----
import Dynamic
import Unique
import Exception
import Concurrent

data TimeOut =3D TimeOut Unique

timeOutTc =3D mkTyCon "TimeOut";
instance Typeable TimeOut where { typeOf _ =3D mkAppTy timeOutTc [] }

timeout secs on_timeout action
  =3D do {
       parent  <- myThreadId;
       i       <- newUnique;
       block (do
          timeout <- forkIO (timeout_thread secs parent i);
          Exception.catchDyn
            ( unblock (
                do {
                   result <- action;
                   killThread timeout;
                   return result;
                   }
              )
            )
            ( \exception ->=20
                case exception of
                    TimeOut u | u =3D=3D i -> unblock on_timeout
                    other -> do {=20
                                killThread timeout;
                                throwDyn exception=20
                                }
            )
         )
       }

timeout_thread secs parent i
  =3D do {=20
       threadDelay (secs * 1000000);
       throwTo parent (DynException (toDyn (TimeOut i)))
       }



From qrczak@knm.org.pl Mon Apr 23 16:30:05 2001 Date: 23 Apr 2001 15:30:05 GMT From: Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl Subject: An attempt at foldr/build fusion for zip
Sun, 22 Apr 2001 08:45:45 -0500, Matt Harden <matth@mindspring.com> pisze:

> I think I may have found a way to get zip & friends to fuse with *both*
> of their input lists.

I tried to put in PrelList, changed foldr2_both to use a local
recursive function which doesn't pass k around which allows to inline
k, and a test shows that it's unfortunately slightly slower than
the original.

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



From qrczak@knm.org.pl Mon Apr 23 16:42:36 2001 Date: 23 Apr 2001 15:42:36 GMT From: Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl Subject: how to implement timeouts for IO operations?
Mon, 23 Apr 2001 15:36:09 +0100, Simon Marlow <simonmar@microsoft.com> pisze:

> The correct way to implement timeout in GHC 5.00 is below.  This should
> really be in a library somewhere.

IMHO "unique exceptions" should be factored out and available in a
standalone way.

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



From John.Velman@HSC.com Mon Apr 23 17:00:54 2001 Date: Mon, 23 Apr 2001 09:00:54 -0700 From: John.Velman@HSC.com John.Velman@HSC.com Subject: New InstallShield: Free At Last
This sounds good.  One question:  Can this live gracefully with
an already complete Cygwin installation?  I.e., will I automatically
end up with two versions of bash, mv, cp, and so on, and can they
live together?

Thanks,

John Velman




Reuben Thomas <rrt@dcs.gla.ac.uk>@haskell.org on 04/23/2001 03:41:12 AM

Sent by:  glasgow-haskell-users-admin@haskell.org


To:    GHC users mailing list <glasgow-haskell-users@haskell.org>
cc:

Subject:  New InstallShield: Free At Last


I've uploaded a new InstallShield for GHC 4.08.2 for Windows which includes
*all* the programs required to use and even rebuild GHC from source [GHC
developers should note that it doesn't include everything needed to build
from CVS; see the most recent 5.00 docs in CVS for details]. This means
that
there's no longer any need to install Cygwin.

Since GHC needs bash to work, and building it requires mv, rm and cp, plus
many other basic utilities, you get a reasonably nice minimal command-line
environment anyway; I've added ls to the mix for extra comfort.

Although the InstallShield is now 20M, overall there's far less to
download,
and now GHC should break far less often. Another implication of this
development is that the Windows version of 5.00 should now happen sooner
rather than later.

One caveat: the installation instructions on haskell.org are now somewhat
out of date. I'll try to correct that soonish.

--
http://sc3d.org/rrt/ | Si hoc legere scis nimium eruditionis habes.


_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users





From michael.weber@post.rwth-aachen.de Mon Apr 23 17:31:44 2001 Date: Mon, 23 Apr 2001 18:31:44 +0200 From: Michael Weber michael.weber@post.rwth-aachen.de Subject: make maintainer-clean (was: Re: The (Interactive) Glasgow Haskell Compiler -- version 5.00)
On Mon, Apr 23, 2001 at 15:00:08 +0100, Simon Marlow wrote:
> > Mon, 16 Apr 2001 00:15:39 +1000, Manuel M. T. Chakravarty 
> > <chak@cse.unsw.edu.au> pisze:
> > 
> > > The source tar ball misses the configure scripts (it has the
> > > `configure.in's, but the source tar ball should be
> > > autoconf'ed, shouldn't it?)
> > 
> > BTW, IMHO 'make maintainer-clean' should not delete configure scripts
> > (comments say that it doesn't, but it does).
> 
> I dunno.  'make distclean' leaves the configure scripts in place, 'make
> maintainer-clean' is supposed to get you back to a pristine tree as it
> would be if it were just checked out from CVS.

erm, not that I say, sticking to the standards is mandatory, but... ;)

$ info standards 'Managing Releases' 'Makefile Conventions' 'Standard Targets'
     [...]
     The reason we say "almost everything" is that running the command
     `make maintainer-clean' should not delete `configure' even if
     `configure' can be remade using a rule in the Makefile.  More
     generally, `make maintainer-clean' should not delete anything that
     needs to exist in order to run `configure' and then begin to build
     the program.  This is the only exception; `maintainer-clean' should
     delete everything else that can be rebuilt.
     [...]


There should be an additional target, e.g. "make cvs-clean", or
similar.


Cheers,
Michael
-- 
 /~\ ASCII ribbon | "I would rather spend 10 hours reading someone else's
 \ / campaign     |  source code than 10 minutes listening to Musak waiting
  X  against      |  for technical support which isn't."
 / \ HTML mail    |      -- Dr. Greg Wettstein, Roger Maris Cancer Center


From v-julsew@microsoft.com Fri Apr 20 10:27:26 2001 Date: Fri, 20 Apr 2001 02:27:26 -0700 From: Julian Seward (Intl Vendor) v-julsew@microsoft.com Subject: The (Interactive) Glasgow Haskell Compiler -- version 5.00
Thanks, Tom & Manuel.  I've put them on the web page.

| There are now also x86 RPMS for RedHat Linux 6.2 at
|=20
|  =20
| ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/i386-rh6.2/
| ghc-5.00-2.i386.rpm
|  =20
| ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/i386-rh6.2/
| ghc-prof-5.00-2.i386.rpm
|=20
| This build has been kindly contributed by Tom Moertel.
|=20
| Manuel
|=20


From mechvel@math.botik.ru Tue Apr 24 09:13:22 2001 Date: Tue, 24 Apr 2001 12:13:22 +0400 From: S.D.Mechveliani mechvel@math.botik.ru Subject: -optCrts-M28m
Could  ghc-5.00  explain, please, some changes in the compiler and
RTS options?

1.  -hi-diffs  worked in ghc-4.08 and now does not.

2.  I applied   -optCrts-G3 -optCrts-F1.5  -optCrts-M28m

to compile certain large module on  32Mb RAM machine.
Now, what to apply for this with  ghc-5.00 ?
  
Thank you in advance for the help.

-----------------
Serge Mechveliani
mechvel@botik.ru


From ger@tzi.de Tue Apr 24 10:57:07 2001 Date: Tue, 24 Apr 2001 11:57:07 +0200 From: George Russell ger@tzi.de Subject: Why does --make only allow one module?
ghc --make would be wonderful for UniForM, which at the moment consists of
a large selection of libraries, were it not for the restriction that
ghc --make insists on only having one module as an argument.  Er why?
At this rate I shall be driven to writing an otherwise useless module
which imports all the modules in each directory, since ghc --make does
indeed look a lot faster than compiling each module individually.
(In particular, we win big here, I think because the NFS system is
very inefficient and makes reading all the .hi files very expensive.)

Actually I'd like to just give ghc --make a list of ALL the source files
and let it figure out the dependencies.  This could also include
object files (compiled from C) which were to be linked in, for example.


From stolz@I2.Informatik.RWTH-Aachen.DE Tue Apr 24 15:19:21 2001 Date: Tue, 24 Apr 2001 16:19:21 +0200 From: Volker Stolz stolz@I2.Informatik.RWTH-Aachen.DE Subject: [ghci] Comparison with Hugs
In Hugs I can throw some definitions into a file and load it
on the shell command line or using ":l" in Hugs.

ghci however will complain that "main" is missing and even won't keep
the defined functions in scope. Is there anything I can do about that?
It even doesn't invoke main if it's present.

I could hack ghci do add "main = print 1" in case main is undefined,
but that's not really something I'd like to admit afterwards...
-- 
Abstrakte Syntaxträume.
Volker Stolz * stolz@i2.informatik.rwth-aachen.de * PGP + S/MIME


From qrczak@knm.org.pl Tue Apr 24 16:07:50 2001 Date: 24 Apr 2001 15:07:50 GMT From: Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl Subject: [ghci] Comparison with Hugs
Tue, 24 Apr 2001 16:19:21 +0200, Volker Stolz <stolz@I2.Informatik.RWTH-Aachen.DE> pisze:

> ghci however will complain that "main" is missing and even won't keep
> the defined functions in scope. Is there anything I can do about that?

Add 'module Foo where' at the top of the file (preferably with the
module name matching the filename).

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



From v-julsew@microsoft.com Tue Apr 24 11:24:06 2001 Date: Tue, 24 Apr 2001 03:24:06 -0700 From: Julian Seward (Intl Vendor) v-julsew@microsoft.com Subject: -optCrts-M28m
| 2.  I applied   -optCrts-G3 -optCrts-F1.5  -optCrts-M28m
|=20
| to compile certain large module on  32Mb RAM machine.
| Now, what to apply for this with  ghc-5.00 ?

+RTS -G3 -F1.5 -M28m -RTS

J


From vkoch@nvsmedia.com Tue Apr 24 22:18:00 2001 Date: Tue, 24 Apr 2001 17:18:00 -0400 From: vince koch vkoch@nvsmedia.com Subject: HINSTANCE from main()
Axel -

While browising FAQs and message boards I found a question you had
posted a few months ago.  I decided to write
you in case you had not learned the answer yet.  (I remember this answer
was pretty tough to find when I needed it!)

===========================================================================

Hi all,

I tried to write a Win32 program in with GHC 4.05 but I am stumbeling
over
the definition

type WNDCLASS =
 (ClassStyle,  -- style
  HINSTANCE,   -- hInstance
  MbHICON,     -- hIcon
  MbHCURSOR,   -- hCursor
  MbHBRUSH,    -- hbrBackground
  MbLPCSTR,    -- lpszMenuName
  ClassName)   -- lpszClassName

which looks fine if I'd knew where to get hInstance. main doesn't give
it
to me. Can specify something like

winMain hInstance ... =

as my main program entry? Or a more sensible question: Is there any
userguide on how to use the Win32 library?

Cheers,
Axel.

===========================================================================

You can get a handle to the current instance of your app in one of 2
ways that I am aware of...
1) You can replace your main() with WinMain (defined below) in which
case windows will pass you the instance,
and you can either pass it into other functions or use it directly

int WINAPI WinMain(
  HINSTANCE hInstance,  // handle to current instance
  HINSTANCE hPrevInstance,  // handle to previous instance
  LPSTR lpCmdLine,      // pointer to command line
  int nCmdShow          // show state of window
);

OR

2) you can call GetModuleHandle (defined below) and pass in NULL for the
lpModuleName and cast the resulting
HMODULE into a HINSTANCE as shown below

HMODULE GetModuleHandle(
  LPCTSTR lpModuleName   // address of module name to return handle for
);

To Use:
    HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(NULL);



Good luck!
Vince



From mechvel@math.botik.ru Wed Apr 25 06:10:14 2001 Date: Wed, 25 Apr 2001 09:10:14 +0400 From: S.D.Mechveliani mechvel@math.botik.ru Subject: -make
Hello,

I have two questions on  ghc-5.00  -make.

The User's Guide says in Section 4.5 that it is simpler to use 
-make  than the Makefile technique. 

1. I try       ghc -make Main.hs
           
with  Main.hs  containing   main = putStr "hello\n"

(in ghc-5.00, binary, i386-unknown, Linux),  
and it reports
               ghc-5.00: unrecognised flag: -make
- ?  


2. How to simplify (eliminate?) Makefile.
-----------------------------------------

My project has many .hs files  in the directories  
   ./source/
   ./source/auxil/
   ./source/pol/factor/
   ...
`make ...' compiles them putting  .hi, .o  files into  ./export/,
then, applies `ar' to make  .a  library.
To do all this, Makefile includes the rules like 

  .hs.o:
         $(HC) -c $< $(HCFlags)
 
and applies the compiler $(HC) with the flags

      ...  -syslib data  -recomp ...
      -i$(E) -odir $(E)  -ohi $(E)/$(notdir $*).hi  $($*_flags)
      ...
Now, this Makefile does not work under  ghc-5.00,  because second
  compilation cannot find  .hi  file of the first compilation:

  ..ghc -c source/auxil/Prelude_.hs -fglasgow-exts ...
   -recomp -iexport -odir export  -ohi        export/Prelude_.hi  
   +RTS -G3 -F1.5 -M29m -RTS -Onot
  ...
  ..ghc -c source/parse/Iparse_.hs -fglasgow-exts ...
   -recomp -iexport -odir export  -ohi        export/Iparse_.hi 
   +RTS -G3 -F1.5 -M29m -RTS -Onot

  source/parse/Iparse_.hs:20:
    failed to load interface for `Prelude_':
        Bad interface file: export/Iparse_.hi
            does not exist

Also what  -make  can do to replace some large part of Makefile.
For 
(a) Makefile has rather odd language, it is not good to force the
    functional programmer to look into it,
(b) one has to think of Makefile versions for different operation 
    systems.


Thank you in advance for the help.

-----------------
Serge Mechveliani
mechvel@botik.ru









From simonmar@microsoft.com Wed Apr 25 11:04:06 2001 Date: Wed, 25 Apr 2001 11:04:06 +0100 From: Simon Marlow simonmar@microsoft.com Subject: make maintainer-clean (was: Re: The (Interactive) Glasgow Haskell Compiler -- version 5.00)
> erm, not that I say, sticking to the standards is mandatory, but... ;)
>=20
> $ info standards 'Managing Releases' 'Makefile Conventions'=20
> 'Standard Targets'
>      [...]
>      The reason we say "almost everything" is that running the command
>      `make maintainer-clean' should not delete `configure' even if
>      `configure' can be remade using a rule in the Makefile.  More
>      generally, `make maintainer-clean' should not delete=20
> anything that
>      needs to exist in order to run `configure' and then=20
> begin to build
>      the program.  This is the only exception;=20
> `maintainer-clean' should
>      delete everything else that can be rebuilt.
>      [...]
>=20
>=20
> There should be an additional target, e.g. "make cvs-clean", or
> similar.

Oh blimey.  Ok, I'll make it not delete configure.

Cheers,
	Simon


From simonmar@microsoft.com Wed Apr 25 11:09:00 2001 Date: Wed, 25 Apr 2001 11:09:00 +0100 From: Simon Marlow simonmar@microsoft.com Subject: Why does --make only allow one module?
> ghc --make would be wonderful for UniForM, which at the=20
> moment consists of
> a large selection of libraries, were it not for the restriction that
> ghc --make insists on only having one module as an argument.  Er why?
> At this rate I shall be driven to writing an otherwise useless module
> which imports all the modules in each directory, since ghc --make does
> indeed look a lot faster than compiling each module individually.
> (In particular, we win big here, I think because the NFS system is
> very inefficient and makes reading all the .hi files very expensive.)
>=20
> Actually I'd like to just give ghc --make a list of ALL the=20
> source files
> and let it figure out the dependencies.  This could also include
> object files (compiled from C) which were to be linked in,=20
> for example.

It's something we'd like to do, but haven't got around to yet.  Perhaps
for 5.01.

Cheers,
	Simon


From simonmar@microsoft.com Wed Apr 25 11:28:17 2001 Date: Wed, 25 Apr 2001 11:28:17 +0100 From: Simon Marlow simonmar@microsoft.com Subject: -make
> I have two questions on  ghc-5.00  -make.
>=20
> The User's Guide says in Section 4.5 that it is simpler to use=20
> -make  than the Makefile technique.=20
>=20
> 1. I try       ghc -make Main.hs
>           =20
> with  Main.hs  containing   main =3D putStr "hello\n"
>=20
> (in ghc-5.00, binary, i386-unknown, Linux), =20
> and it reports
>                ghc-5.00: unrecognised flag: -make
> - ? =20

The flag is actually '--make' (note the double dash).  Apparently the
documentation system has some problems rendering the double dash in
printed mode.

> 2. How to simplify (eliminate?) Makefile.
> -----------------------------------------
>=20
> My project has many .hs files  in the directories =20
>    ./source/
>    ./source/auxil/
>    ./source/pol/factor/
>    ...
> `make ...' compiles them putting  .hi, .o  files into  ./export/,
> then, applies `ar' to make  .a  library.
> To do all this, Makefile includes the rules like=20
>=20
>   .hs.o:
>          $(HC) -c $< $(HCFlags)
> =20
> and applies the compiler $(HC) with the flags
>=20
>       ...  -syslib data  -recomp ...
>       -i$(E) -odir $(E)  -ohi $(E)/$(notdir $*).hi  $($*_flags)
>       ...
> Now, this Makefile does not work under  ghc-5.00,  because second
>   compilation cannot find  .hi  file of the first compilation:
>=20
>   ..ghc -c source/auxil/Prelude_.hs -fglasgow-exts ...
>    -recomp -iexport -odir export  -ohi        export/Prelude_.hi =20
>    +RTS -G3 -F1.5 -M29m -RTS -Onot
>   ...
>   ..ghc -c source/parse/Iparse_.hs -fglasgow-exts ...
>    -recomp -iexport -odir export  -ohi        export/Iparse_.hi=20
>    +RTS -G3 -F1.5 -M29m -RTS -Onot
>=20
>   source/parse/Iparse_.hs:20:
>     failed to load interface for `Prelude_':
>         Bad interface file: export/Iparse_.hi
>             does not exist

This is indeed a bug: -ohi doesn't work properly in 5.00.  I'm fixing it
right now.

> Also what  -make  can do to replace some large part of Makefile.
> For=20
> (a) Makefile has rather odd language, it is not good to force the
>     functional programmer to look into it,
> (b) one has to think of Makefile versions for different operation=20
>     systems.

The simplest way to work is to put the objects and .hi files in the same
directory as the source.  Then you can use --make like this:

	$ ghc --make -i<dir1>:<dir2>:... Main

to put the objects in a single directory, you can use -odir <dir>.
Unfortunately the .hi files can't be saved elsewhere when using --make.

Cheers,
	Simon


From simonmar@microsoft.com Wed Apr 25 11:07:56 2001 Date: Wed, 25 Apr 2001 11:07:56 +0100 From: Simon Marlow simonmar@microsoft.com Subject: -optCrts-M28m
> Could  ghc-5.00  explain, please, some changes in the compiler and
> RTS options?
>=20
> 1.  -hi-diffs  worked in ghc-4.08 and now does not.

It's now called -ddump-hi-diffs.

Cheers,
	Simon


From khchoi@ruby.kaist.ac.kr Wed Apr 25 14:13:25 2001 Date: Wed, 25 Apr 2001 22:13:25 +0900 (KST) From: Kwanghoon Choi khchoi@ruby.kaist.ac.kr Subject: haskell.runtime.* ??
Hello,

I  managed  to restore an option for GHC 5.00 to produce 
java output but I realized that I also need some runtime 
system  to  run  the  java  program  produced  by GHC. I 
examined  the GHC source tree and the GHC website but in 
vain. Where do I get the runtime system?

Thanks in advance.

Kwanghoon





From mechvel@math.botik.ru Thu Apr 26 05:42:00 2001 Date: Thu, 26 Apr 2001 08:42:00 +0400 From: S.D.Mechveliani mechvel@math.botik.ru Subject: memory in --make
Hello,

It occurs that                         ghc-5.00 --make  
spends the memory in a particular way.
Making my project via Makefile (envoking ghc driver many times)
succeeds within  -M29m.
While                   ghc --make ... -Mxxx  Mk.hs
needs more than  50Mb,
probably, because it keeps much intermediate information between 
compiling the modules.
Still I managed to `make' it with  -M29m  by issueing the latter
command two times more, after the  insufficient-heap  break.
ghc --make   still looks faster and better to arrange.
Each time it compiles only remainging modules.
Maybe, something can be done to avoid these heap-exhausted breaks?
For, seeing that some modules remain to compile and heap is
exhausted, ghc can save the intermediate information to disk 
giving the room for the next module compilation.
Also it can restart the driver itself - with appropriate message
- ?

-----------------
Serge Mechveliani
mechvel@botik.ru 




From mechvel@math.botik.ru Thu Apr 26 06:42:52 2001 Date: Thu, 26 Apr 2001 09:42:52 +0400 From: S.D.Mechveliani mechvel@math.botik.ru Subject: :! ghc -c vs :c
The ghc interactive  ghci  compiles the module by the command
                                                 
                           :! ghc -c 

Has it sense to provide a command   :compile   (:c),

having a meaningful name and a format similar to other commands,
like say  :load
?

-----------------
Serge Mechveliani
mechvel@botik.ru


From mechvel@math.botik.ru Thu Apr 26 08:58:45 2001 Date: Thu, 26 Apr 2001 11:58:45 +0400 From: S.D.Mechveliani mechvel@math.botik.ru Subject: :l XX libFoo.a
The  :load  command of the  ghc-5.00  interpreter 
first searches the needed compiled modules (*.o) and loads them
when finds.
But how to make it to search them in the object code library  
xxx/libFoo.a  ?  
For it is better to keep the fixed *.o files in a library.
And `:load' works in the above situation similarly as  
                                                   ghc -o XX.o ...
I tried               :l XX libFoo.a,
but it does not work.

-----------------
Serge Mechveliani
mechvel@botik.ru



From wbuss@telda.net Thu Apr 26 09:21:29 2001 Date: 26 Apr 2001 10:21:29 +0200 From: Wolfhard =?iso-8859-1?q?Bu=DF?= wbuss@telda.net Subject: Building nhc98-1.02 with ghc-5.00
Hello,
the building of nhc98-1.02 with ghc-5.00 aborts
with the message:

Main.hs:8:
    Failed to find interface decl for `PrelGHC.(#,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,#)'
    from module `PrelGHC'

Any hints for interpretation?

Kind regards,
Wolfhard.



From simonmar@microsoft.com Thu Apr 26 09:49:00 2001 Date: Thu, 26 Apr 2001 09:49:00 +0100 From: Simon Marlow simonmar@microsoft.com Subject: :! ghc -c vs :c
> The ghc interactive  ghci  compiles the module by the command
>                                                 =20
>                            :! ghc -c=20
>=20
> Has it sense to provide a command   :compile   (:c),
>=20
> having a meaningful name and a format similar to other commands,
> like say  :load
> ?

Yes, this is another thing we'd like to do, but haven't got around to
yet.  (you can always define your own :compile command using :def of
course, but the benefit of a built-in one would be that it could take
advantage of the in-memroy interfaces rather than reading them from the
disk).

Cheers,
	Simon


From simonmar@microsoft.com Thu Apr 26 09:55:42 2001 Date: Thu, 26 Apr 2001 09:55:42 +0100 From: Simon Marlow simonmar@microsoft.com Subject: :l XX libFoo.a
> The  :load  command of the  ghc-5.00  interpreter=20
> first searches the needed compiled modules (*.o) and loads them
> when finds.
> But how to make it to search them in the object code library =20
> xxx/libFoo.a  ? =20
> For it is better to keep the fixed *.o files in a library.
> And `:load' works in the above situation similarly as =20
>                                                    ghc -o XX.o ...
> I tried               :l XX libFoo.a,
> but it does not work.

GHCi can't load ordinary .a libraries, only .o/.so objects.  However,
you can make a .o from a .a using something like

	$ ld --whole-archive -o Foo.o -lFoo

Perhaps we'll have a way to make this slightly less painful in the
future.

Cheers,
	Simon


From qrczak@knm.org.pl Thu Apr 26 11:44:53 2001 Date: Thu, 26 Apr 2001 12:44:53 +0200 (CEST) From: Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl Subject: :! ghc -c vs :c
On Thu, 26 Apr 2001, Simon Marlow wrote:

> Yes, this is another thing we'd like to do, but haven't got around to
> yet.  (you can always define your own :compile command using :def of
> course, but the benefit of a built-in one would be that it could take
> advantage of the in-memroy interfaces rather than reading them from the
> disk).

IMHO to make compilation in ghci convenient the set of visible names from
compiled modules should not differ that much from names visible from
interpreted modules. It's not nice that even Prelude names are not in
scope when the main module is compiled.

Especially if :c without parameters compiled the main module by default.

I understand that there are technical difficulties of inavailability of
the source context inside compiled modules. One can emulate a better
behavior by writing a module consisting of appropriate imports, so why
ghci can't do that for me? Let's try to see how it could look like.

Unqualified names in scope are drawn from three sources:

1. Names exported by a set of modules chosen by the user. Modules can be
   individually added to and removed from this set. Probably the full
   power of imports should be supported:
       :import Module
       :import Module (foo, bar)
       :import Module hiding (bar, baz)
       :import Module as M -- Perhaps not needed because qualified names
                           -- are managed in a different way.

   Mentioning the same module twice combines the two effects, as for
   imports in the source. Prelude is implicitly in this set except if it
   is included explicitly, as for imports in the source. There is also
       :unimport Module
   and a way to display the active imports.

2. All top level definitions and things imported by a chosen source
   module (i.e. names available inside it), if one is chosen; it must be
   possible to forget it. When the user chooses a module for which both
   the source and *.o is available, the module is interpreted. It's
   impossible to choose a module without the source.

   Although it would make sense to allow more than one module available
   this way, it should probably be simplified to be at most one,
   i.e. choosing some forgets the previous one.

   Using unqualified ambiguous names coming from combined 1. and 2. is
   an error.

   Note that the module in 2. needs not to be present in the set of 1.
   Particularly when the chosen module reexports some variables qualified
   and doesn't have them available unqualified, they are not available.

3. Variables bound interactively. I'm not sure when they should be
   forgotten. If choosing another module in 2. must forget them due to
   some technical reasons, then ok, but I would prefer to forget them
   explicitly (not necessarily individually). These definitions cover
   other things with the same names, as if we were inside a 'do' block.

-- 
Marcin 'Qrczak' Kowalczyk




From olaf@cs.york.ac.uk Thu Apr 26 16:07:14 2001 Date: Thu, 26 Apr 2001 16:07:14 +0100 From: Olaf Chitil olaf@cs.york.ac.uk Subject: Building nhc98-1.02 with ghc-5.00
> the building of nhc98-1.02 with ghc-5.00 aborts
> with the message:
> 
> Main.hs:8:
>     Failed to find interface decl for `PrelGHC.(#,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,#)'
>     from module `PrelGHC'
> 
> Any hints for interpretation?

I suspect that is because nhc98 defines a data type with a single
constructor that has about 75 arguments. (It is to hold all compiler
flags and it is actually a record.) It seems that the new ghc-5.00 tries
to implement that data type internally in terms of an unboxed tuple.
However, ghc-5.00 doesn't implement unboxed tuples of that size.

So, ghc guys, does that mean that ghc-5.00 cannot handle any data
constructors with many arguments? ghc-4.08 and all other Haskell systems
certainly can handle such data constructors ;-)

Cherio,
Olaf

-- 
OLAF CHITIL, 
 Dept. of Computer Science, University of York, York YO10 5DD, UK. 
 URL: http://www.cs.york.ac.uk/~olaf/
 Tel: +44 1904 434756; Fax: +44 1904 432767


From mechvel@math.botik.ru Fri Apr 27 10:09:09 2001 Date: Fri, 27 Apr 2001 13:09:09 +0400 From: S.D.Mechveliani mechvel@math.botik.ru Subject: memory map in ghci
Dear GHC-5.00,

I cannot find where it is explained the memory distribution used by
ghci.
For example, after     ghci +RTS -M16m -RTS
                       ...
                       Prelude> :l XX
                       ...      (YY.o loaded      ...)
                       ...      (XX   interpreted ...)

do  YY.o, XX  take any of these  16Mb ?

Are there any commands in  ghci  to get the memory map?
It is something like
  space taken by loaded compiled programs,
                        interpreted programs,
              by data,
  free space for program,
  free space for data,
  space for stack.

Is the interpreted program treated as data? 

-----------------
Serge Mechveliani
mechvel@botik.ru




From simonmar@microsoft.com Fri Apr 27 10:19:03 2001 Date: Fri, 27 Apr 2001 10:19:03 +0100 From: Simon Marlow simonmar@microsoft.com Subject: Building nhc98-1.02 with ghc-5.00
> the building of nhc98-1.02 with ghc-5.00 aborts
> with the message:
>=20
> Main.hs:8:
>     Failed to find interface decl for=20
> `PrelGHC.(#,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> ,,,,,,,,,,,,,,,,,,,,,,,#)'
>     from module `PrelGHC'
>=20
> Any hints for interpretation?

Workaround: compile this particular module without -O, or with -fno-cpr.

Cheers,
	Simon


From mechvel@math.botik.ru Fri Apr 27 11:26:17 2001 Date: Fri, 27 Apr 2001 14:26:17 +0400 From: S.D.Mechveliani mechvel@math.botik.ru Subject: heap and code in ghci
To my request 

>> I cannot find where it is explained the memory distribution used by
>> ghci.
>> [..]

Simon Marlow  writes

> Interpreted code lives in the heap, and is garbage collected as normal.

> Object code is loaded outside the heap.  It takes up real memory 
> in the process, because the data has to be relocated when it is 
> loaded.  
> [..]


Let, for example, all the  .o  modules were prepared, and we 
command
         ghci ... +RTS -Mxxm -RTS
         ...
           Loading package std ... linking ... done.
         Prelude> :l BPrelude
         ...

and then try to find  sum [1..n].
In my experiment
  xx =  7                   does not allow to load the program,
        8,  sum [1..66000]  yields  "Heap exhausted",
       10,  sum [1..77000]  yields  2964538500. 

Probably, this  xx Mb  is for  binary program + heap.
ghci  loads .o modules, they take some part of  xx,
and all the rest is for the heap.
Right?

Thank you in advance for the explanation.

-----------------
Serge Mechveliani
mechvel@botik.ru








From simonmar@microsoft.com Fri Apr 27 10:17:05 2001 Date: Fri, 27 Apr 2001 10:17:05 +0100 From: Simon Marlow simonmar@microsoft.com Subject: memory map in ghci
> I cannot find where it is explained the memory distribution used by
> ghci.
> For example, after     ghci +RTS -M16m -RTS
>                        ...
>                        Prelude> :l XX
>                        ...      (YY.o loaded      ...)
>                        ...      (XX   interpreted ...)
>=20
> do  YY.o, XX  take any of these  16Mb ?
>=20
> Are there any commands in  ghci  to get the memory map?
> It is something like
>   space taken by loaded compiled programs,
>                         interpreted programs,
>               by data,
>   free space for program,
>   free space for data,
>   space for stack.
>=20
> Is the interpreted program treated as data?=20

Object code is loaded outside the heap.  It takes up real memory in the
process, because the data has to be relocated when it is loaded.  Object
code is never released or unloaded: if you load a newly compiled version
of the same module, GHCi just allocates more memory for it.  The reason
is that objects in the heap may still have references to the old code,
and trying to detect/prevent this is hard.

Interpreted code lives in the heap, and is garbage collected as normal.

Cheers,
	Simon


From mechvel@math.botik.ru Fri Apr 27 12:28:19 2001 Date: Fri, 27 Apr 2001 15:28:19 +0400 From: S.D.Mechveliani mechvel@math.botik.ru Subject: memory distribution in ghci
It looks, there remains a questions on memory distribution in 
                                           ghc-5.00 -interpreted :

can  ghci  provide a command measuring the part of heap taken
by interpreted programs, 
by interfaces?
(or, at least, their sum)

For, with -O and much in-lining, the interfaces may be very large. 
Also compare it to the _batch_ mode: commanding

                       ghc -o run Foo.o
                       ./run +RTS -MXXm -RTS

the user is sure that XX Mb is only for the `real' computation data.

-----------------
Serge Mechveliani
mechvel@botik.ru







From simonmar@microsoft.com Fri Apr 27 11:57:29 2001 Date: Fri, 27 Apr 2001 11:57:29 +0100 From: Simon Marlow simonmar@microsoft.com Subject: ANNOUNCE: Happy 1.10 released
ANNOUNCING  Happy 1.10  - The LALR(1) Parser Generator for Haskell
-----------------------------------------------------------------

I'm pleased to announce version 1.10 of Happy, the parser generator
system for Haskell.  Changes in this version, relative to version 1.10
(the previous full release):

        * bugfixes, and minor performance improvements,

        * most of the examples work again.

Happy is available in source form, which can be compiled with GHC
version 4.xx (4.08 or 5.00 recommended), and we also provide binaries
for some architectures.  The Happy homepage with links to the various
distributions lives at:

        http://www.haskell.org/happy/

Please send any bug reports and comments to simonmar@microsoft.com.


From simonmar@microsoft.com Fri Apr 27 11:32:40 2001 Date: Fri, 27 Apr 2001 11:32:40 +0100 From: Simon Marlow simonmar@microsoft.com Subject: heap and code in ghci
> Let, for example, all the  .o  modules were prepared, and we=20
> command
>          ghci ... +RTS -Mxxm -RTS
>          ...
>            Loading package std ... linking ... done.
>          Prelude> :l BPrelude
>          ...
>=20
> and then try to find  sum [1..n].
> In my experiment
>   xx =3D  7                   does not allow to load the program,
>         8,  sum [1..66000]  yields  "Heap exhausted",
>        10,  sum [1..77000]  yields  2964538500.=20
>=20
> Probably, this  xx Mb  is for  binary program + heap.
> ghci  loads .o modules, they take some part of  xx,
> and all the rest is for the heap.
> Right?

Nope.  The -M flag affects the size of the heap only; object files are
loaded outside the heap.  If you're running out of heap with a maximum
size of 8M, it's probably because the heap is full of interfaces (i.e.
the in-memory copy of the .hi file).

Cheers,
	Simon


From simonmar@microsoft.com Fri Apr 27 14:00:16 2001 Date: Fri, 27 Apr 2001 14:00:16 +0100 From: Simon Marlow simonmar@microsoft.com Subject: memory distribution in ghci
> It looks, there remains a questions on memory distribution in=20
>                                            ghc-5.00 -interpreted :
>=20
> can  ghci  provide a command measuring the part of heap taken
> by interpreted programs,=20
> by interfaces?
> (or, at least, their sum)

Ah, I see now.  You'd like to know how much memory your program is
using, compared to GHCi itself?  Hmm.  Unfortunately I can't see a good
way to do this I'm afraid.  However, you can always compile the program
and use profiling...

> For, with -O and much in-lining, the interfaces may be very large.=20

You really don't want to use -O with GHCi (in fact, at the moment you
can't).=20

Cheers,
	Simon


From info@businessesforsale.com" Search over 12,000 businesses for sale at: http://www.BusinessesForSale.com The leading global website for businesses for sale - everything from bars and hotels to pet shops and newsagents. Regards The BusinessesForSale.com team. -------------------------------------------------------------------------- To be removed from this mailing list please reply with the word remove in the email and ensure it contains the original text. glasgow-haskell-users@dcs.gla.ac.uk Ref: Biz-Opp-A2-20010427 From michaelw@debian.org Fri Apr 27 17:44:19 2001 Date: Fri, 27 Apr 2001 18:44:19 +0200 From: Michael Weber michaelw@debian.org Subject: The (Interactive) Glasgow Haskell Compiler -- version 5.00
On Sun, Apr 22, 2001 at 16:44:54 +0200, Michael Weber wrote:
> >     The (Interactive) Glasgow Haskell Compiler -- version 5.00
> >    ============================================================
> > 
> > We are pleased to announce a new major release of the Glasgow Haskell
> > Compiler (GHC), version 5.00.  The source distribution is freely
> > available via the World-Wide Web and through anon. FTP, under a
> > BSD-style license.  See below for download details.  Pre-built
> > packages for Linux, FreeBSD, Solaris and Win32 are also available.
> [...]
> Debian packages for GHC 5.00 are available for some days now in the
> 'unstable' distribution.  They should have hit the mirrors already, so
> please choose the nearest one.  More info on that below.
[...]

> Availability
> ============
[...]

> As a consequence, GHC is built against the latest libraries in
> 'unstable', including libc6 (>= 2.2.2-2).  I am sorry, but at the
> moment I cannot make any promises about when packages for 'stable'
> (aka potato) will be available.


Ok, big thanks to Kevin Glynn, who provided me with a Debian potato
machine and allowed me to burn quite some CPU cycles [Hi Kevin! =)].
There are now updated packages for ghc4, ghc5 and happy for POTATO
available (libc6 >= 2.1.2).

So, basically, potato (aka current 'stable') users need not upgrade to
'testing' or 'unstable' to get a running GHC 5.00 (or GHCi).

The packages are available at my APT store (see below), but NOT from
Debian directly.


IMPORTANT NOTE:
===============

These packages depend on libgmp3, just like the packages in
'unstable', so you need the libgmp3(-dev) packages.  Since they are
not available for potato, I recompiled them and made them available,
too.

To make things even more complicated, libgmp3 does not play well with
the libgmp2 provided by potato, so I rebuild new libgmp2 packages,
too.  I did my best to nevertheless provide a smooth upgrade path to
the woody or sid distributions, so this should not lead to any
problems at all.  If there is something, that does not work, please
let me know ASAP.

However, for APT users this should be quite unimportant, since APT
should pull in the necessary stuff on it's own.  If not, again please
let me know.  You can also try to upgrade libgmp2 first, then install
libgmp3(-dev), and then the GHC suite.  In any case, please let me
know about any trouble you experienced.


APT lines:
	deb     http://www-i2.informatik.rwth-aachen.de/Software/Haskell/debian potato/
	deb-src http://www-i2.informatik.rwth-aachen.de/Software/Haskell/debian potato/


Cheers,
Michael
-- 
() ASCII ribbon campaign |  Chair for Computer Science  II  | GPG: F65C68CD
/\ against HTML mail     |       RWTH Aachen, Germany       | PGP: 1D0DD0B9


From pasch@netzGeneration.com Fri Apr 27 23:13:48 2001 Date: Sat, 28 Apr 2001 00:13:48 +0200 From: Thomas Pasch pasch@netzGeneration.com Subject: GHC and the Lazy Functional State Threads Paper
Hello, 

to get a better understanding I tried to get the
code from 'Lazy Functional State Thread' to work.
But I encounter some error messages that I don't
fully understand.

> module Lfs where
> 
> import PrelGHC
> import GlaExts
> import ST
> import qualified MArray
> import qualified Array
> 
> newArr = newSTArray
> readArr = readSTArray
> writeArr = writeSTArray
> -- Error: Ambiguous type variable(s) `ix' in the constraint `Ix ix'   
> freezeArr = freezeSTArray 
> 
> thenST_ a b = a `thenST` \_ -> b
> 
> accumArray bnds f z ivs 
>     = runST
>       (newArr bnds z `thenST` \a ->
>        fill a f ivs `thenST_`
>        freezeArr a)
> 
> fill a f [] = returnST ()
> fill a f ((i,v):ivs)
>      = readArr a i `thenST` \x ->
>        writeArr a i (f x v) `thenST_`
>        fill a f ivs
> 
> -- in GlaExts: seqST = (>>) 
> seqST2 = foldr thenST_ (returnST ())
> 
> accumArray2 bnds f z ivs 
>     = runST 
>       (newArr bnds z `thenST` \a ->
>        seqST2 (map (update a f) ivs) `thenST_`
>        freezeArr a)
> 
> update a f (i,v) 
>     = readArr a i `thenST` \x ->
>       writeArr a i (f x v)
> 
> putString [] = returnST ()
> --  Error: Couldn't match `ST s a' against `IO ()' 
> putString (c:cs) = putChar c `thenST_`
> 		   putString cs
> 
> -- Error: Couldn't match `ST s a' against `[b]'  
> putString2 cs = seqST (map putChar cs)
> 
> main = putStrLn "Hello, world"
> 

How to change the code to get it to work? Why is
there a different definition of seqST in GlaExts?

Best regards,

Thomas

PS:
When I change the definition of the mutable Array to

> newArr = MArray.newArray
> readArr = MArray.readArray
> writeArr = MArray.writeArray
> freezeArr = MArray.freeze

I get Error in accumArray and accumArray2. I guess
this is because of the fact that a STArray is only 
one possible MArray and there are other possiblities,
right?


From pasch@netzGeneration.com Fri Apr 27 23:14:40 2001 Date: Sat, 28 Apr 2001 00:14:40 +0200 From: Thomas Pasch pasch@netzGeneration.com Subject: Shared Libraries
Hello,

In the windows version of ghc, 
there seems to be the possiblity to compile
the libraries as shared 'dll's. Is the 
same possible for the unix version?

The question is because I think the ghc 
executables are really blown up. A simple
'Hello, world' has 358 KBytes and the hello
example of the GTK+ bindings is as big as
2.2 MBytes, although it is link dynamically
against:

> ldd hello
        libgthread-1.2.so.0 => /usr/lib/libgthread-1.2.so.0 (0x40025000)
        libgtk-1.2.so.0 => /usr/lib/libgtk-1.2.so.0 (0x40028000)
        libgdk-1.2.so.0 => /usr/lib/libgdk-1.2.so.0 (0x40155000)
        libgmodule-1.2.so.0 => /usr/lib/libgmodule-1.2.so.0 (0x4018a000)
        libglib-1.2.so.0 => /usr/lib/libglib-1.2.so.0 (0x4018d000)
        libdl.so.2 => /lib/libdl.so.2 (0x401b1000)
        libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x401b4000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x401bc000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x401cb000)
        libm.so.6 => /lib/libm.so.6 (0x402ae000)
        libgmp.so.3 => /usr/lib/libgmp.so.3 (0x402cc000)
        libc.so.6 => /lib/libc.so.6 (0x402ed000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x40400000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)   

Best regards,

Thomas


From qrczak@knm.org.pl Fri Apr 27 22:57:19 2001 Date: 27 Apr 2001 21:57:19 GMT From: Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl Subject: GHC and the Lazy Functional State Threads Paper
Sat, 28 Apr 2001 00:13:48 +0200, Thomas Pasch <pasch@netzGeneration.com> pisze:

> > newArr = newSTArray
> > readArr = readSTArray
> > writeArr = writeSTArray
> > -- Error: Ambiguous type variable(s) `ix' in the constraint `Ix ix'   
> > freezeArr = freezeSTArray 

Monomorphism restriction strikes again. Constrained type variables
of variable bindings without type signatures get a single type.
Solution: add explicit type signatures:

newArr:: Ix i => (i,i) -> e -> ST s (STArray s i e)
newArr = newSTArray
readArr:: Ix i => STArray s i e -> i -> ST s e
readArr = readSTArray
writeArr:: Ix i => STArray s i e -> i -> e -> ST s ()
writeArr = writeSTArray
freezeArr:: Ix i => STArray s i e -> ST s (Array i e)
freezeArr = freezeSTArray

or (with ghc >= 5.00) compile with -fno-monomorphism-restriction.

Welcome to the club of people who think that the monomorphism
restriction should be removed.

> > putString [] = returnST ()
> > --  Error: Couldn't match `ST s a' against `IO ()' 
> > putString (c:cs) = putChar c `thenST_`
> > 		   putString cs

The 'Lazy Functional State Threads' paper was written a long time ago,
where monads were not a standard part of Haskell. I think that its IO
was a special case of ST, which is not true anymore. There are stToIO
and unsafeIOToST functions in module ST, but you should not really
perform IO from the ST monad.

> > -- Error: Couldn't match `ST s a' against `[b]'  
> > putString2 cs = seqST (map putChar cs)

Use seqST2, which is now available under the name sequence_ (works
for arbitrary monad; at the time where the paper was written it was
not even possible to define the Monad class, because it has a higher
order kind).

> Why is there a different definition of seqST in GlaExts?

Because it's newer than the paper - actually this module is already
obsolete:-)

For the ST monad you can use standard overloaded monadic functions
and operators: >>=, >>, return, sequence, sequence_, mapM, mapM_ etc.

> When I change the definition of the mutable Array to
> 
> > newArr = MArray.newArray
> > readArr = MArray.readArray
> > writeArr = MArray.writeArray
> > freezeArr = MArray.freeze
> 
> I get Error in accumArray and accumArray2. I guess this is because
> of the fact that a STArray is only one possible MArray and there
> are other possiblities, right?

Right: nothing determines which mutable array type to use, and its
type doesn't appear in the result, so it's ambiguous. But it's not
the whole story. This is a really weird case.

The MArray class is defined over the array type, the monad, and the
element type. The element type is there because some arrays (namely
STUArray and IOUArray among these privided by ghc) are not fully
polymorphic wrt. the element type, but have different implementations
for different element types (and store element values unboxed instead
of under generic object pointers).

The ST and STArray types are parametrized by a dummy type variable,
and the runST function has a special type with forall in the argument.
This ensures that the result of a computation run by runST doesn't
depend on values which are mutable in this computation, i.e. that
mutable values don't escape their state thread, so separate state
threads are truly independent.

The result of accumArray is an immutable array. So it should be legal
to return it from a computation run by runST... Unfortunately it does
depend on the dummy type variable! It's because it requires that the
mutable array used to build the result accepts the given element type.

The MArray constraint applies to the element type and to the monad.
The monad type contains the dummy type variable. So although in
practice all MArray instances with ST s as the monad work for all
choices of s, the type of a general MArray constraint looks as if it
could place constraints on s, and such type is rejected by runST.

Fortunately you must resolve the mutable array type anyway. You can
choose STArray, which is fully polymorphic wrt. the element type
This causes the resulting type not depend on the dummy type variable:
an unusual case where the type inferred as the most general type
is not really most general!

So you can fix it for example by using a specialized version of
freezeArr inside accumArray, of type
    (Ix i, IArray a e) => STArray s i e -> ST s (a i e)
This will give quite general type of accumArray: arbitrary immutable
array from the IArray class.

If the immutable array type used was particularly UArray, it would
be more efficient to use the corresponding STUArray instead of
STArray, so freezing could just copy a memory block (there are magic
specializations in ghc's libraries for such case). But if the element
type was to remain generic, the type would have to be constrained
over STUArray: the compiler doesn't know that UArray and STUArray
are in practice defined for the same element types. The STUArray
type includes the dummy type variable, so it doesn't work in runST,
as explained above. Sorry.

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



From mechvel@math.botik.ru Sat Apr 28 08:04:18 2001 Date: Sat, 28 Apr 2001 11:04:18 +0400 From: S.D.Mechveliani mechvel@math.botik.ru Subject: memory distribution in ghci
To my request

> [..]
> can  ghci  provide a command measuring the part of heap taken
> by interpreted programs,
> by interfaces?
> (or, at least, their sum)

Simon Marlow  <simonmar@microsoft.com> writes


> Ah, I see now.  You'd like to know how much memory your program is
> using, compared to GHCi itself?  Hmm.  Unfortunately I can't see a good
> way to do this I'm afraid.  

In                            ghci ... +RTS -Mxxxm -RTS
xxx  sets the volum bound for  
                    (1) `real' data          +  
                    (2) interpreted program  + 
                    (3) interfaces of pre-compiled loaded .o modules.

Please, confirm, whether I understand correct?
And many users would like to measure (1) within the  ghci  loop.

The statistic like   Prelude> List.sort [1..10]
                     [1,2,3,4,5,6,7,8,9,10]
                     (0.53 secs, 7109100 bytes)

includes the number of allocations, which cannot help to detect (1)
(can it?)
This is a user's wish for the future  ghci  version.

I do not know, whether it is hard to develop.
If it is hard, personally, I would not suffer much.
Because, getting "heap exhausted", one can run  ghci  once more,
with larger  xxx,  and performing the same computation to detect
approximately which part of  xxx  is taken by the `real' data.
But this looks awkward.

Another wish: to document the  ghci  memory management
-------------
which we are discussing now.
Because GHC could simply give a reference to the manual section.


> However, you can always compile the program
> and use profiling...

Suppose User demonstrates an Haskell application A to the Listener. 
Naturally, most of  A  constitutes its `library'  L,  and  L  was 
compiled to .o files
                     (desirably, gathered in the  libL.a  archive).

ghci  invokes, loads the _interpreted_ demonstration code  D,
much smaller than  L,  but importing items from  L.
Naturally, Listener asks something like 
"and how much memory needs to compute this matrix?".

In many other system, the interactive command, say, `:size'
gives immediately some interpreter memory map and the sizes taken
by `code' and `data'.
And you suggest to wait 2 hours to re-compile _everything_ with 
profiling. The Listener would not wait.


>> For, with -O and much in-lining, the interfaces may be very large.

> You really don't want to use -O with GHCi (in fact, at the moment you
> can't).

This may be serious. For example,  putStr $ show (sum1 [1..n])

will need a constant memory or O(n) memory depending on the  -O
possibility.
The docs on ghc-5.00 say that it joins "the best of the two worlds" - 
interpreted code calling for the fast code compiled earlier. 

Generally, I like only scientifically designed `interpreters' and
always advised not to spend efforts to .o compilation.
But as nobody agrees with me, as the o-compilation fiesta continues, 
then, why to spend effort in vain?

-----------------
Serge Mechveliani
mechvel@botik.ru






From mechvel@math.botik.ru Sat Apr 28 08:33:11 2001 Date: Sat, 28 Apr 2001 11:33:11 +0400 From: S.D.Mechveliani mechvel@math.botik.ru Subject: memory destribution
Here is another expression of what I wrote recently on the memory 
destribution.
Probbaly, it suffices to have the garbage collection command.
For example,  Hugs  can do

  Prelude> :gc
  Garbage collection recovered 240372 cells
  ...
It is clear then, how much the user has for further computation.

-----------------
Serge Mechveliani
mechvel@botik.ru


From simonpj@microsoft.com Sun Apr 29 20:16:24 2001 Date: Sun, 29 Apr 2001 12:16:24 -0700 From: Simon Peyton-Jones simonpj@microsoft.com Subject: haskell.runtime.* ??
I'm afraid that no one ever completed the GHC Haskell->Java
story.  The idea is that the JVM is the runtime, but of
course you need to implement the standard libraries somehow,=20
and all the primitive operations GHC uses.   Not a trivial
task, but one we are undertaking for .NET.

Bottom line: the reason you can't find a runtime is because
you are supposed to compile the Java with a Java compiler
and run that.  But you'll need to do more than that to
actually run programs

Simon

| -----Original Message-----
| From: Kwanghoon Choi [mailto:khchoi@ruby.kaist.ac.kr]
| Sent: 25 April 2001 14:13
| To: glasgow-haskell-users@haskell.org
| Subject: haskell.runtime.* ??
|=20
|=20
|=20
| Hello,
|=20
| I  managed  to restore an option for GHC 5.00 to produce=20
| java output but I realized that I also need some runtime=20
| system  to  run  the  java  program  produced  by GHC. I=20
| examined  the GHC source tree and the GHC website but in=20
| vain. Where do I get the runtime system?
|=20
| Thanks in advance.
|=20
| Kwanghoon
|=20
|=20
|=20
|=20
| _______________________________________________
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users@haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
|=20


From simonmar@microsoft.com Mon Apr 30 11:28:51 2001 Date: Mon, 30 Apr 2001 11:28:51 +0100 From: Simon Marlow simonmar@microsoft.com Subject: Shared Libraries
> In the windows version of ghc,=20
> there seems to be the possiblity to compile
> the libraries as shared 'dll's. Is the=20
> same possible for the unix version?
>=20
> The question is because I think the ghc=20
> executables are really blown up. A simple
> 'Hello, world' has 358 KBytes and the hello
> example of the GTK+ bindings is as big as
> 2.2 MBytes, although it is link dynamically
> against:

358K looks a bit large: is that stripped?  I normally see a 150K-ish
minimum.  Most of that is the runtime system and garbage collector.

To answer your question: we don't currently have a way to make shared
libraries for Haskell code on Unix boxes.  I've made various attempts at
this in the past and didn't have much success - take a look back through
the glasgow-haskell-{users,bugs} archives for some more info on the
topic.

BTW, shared libraries aren't that big a deal.  You won't see any memory
savings unless you've got several Haskell programs running, and there
would certainly be a performance hit.  Also, there wouldn't be any of
the other "hot-swappable" advantages you normally get with shared
libraries, because GHC-compiled Haskell libraries tend to have a much
more intimate relationship with each other than C libraries.

Cheers,
	Simon


From simonmar@microsoft.com Mon Apr 30 11:46:30 2001 Date: Mon, 30 Apr 2001 11:46:30 +0100 From: Simon Marlow simonmar@microsoft.com Subject: memory distribution in ghci
> > Ah, I see now.  You'd like to know how much memory your program is
> > using, compared to GHCi itself?  Hmm.  Unfortunately I=20
> can't see a good
> > way to do this I'm afraid. =20
>=20
> In                            ghci ... +RTS -Mxxxm -RTS
> xxx  sets the volum bound for =20
>                     (1) `real' data          + =20
>                     (2) interpreted program  +=20
>                     (3) interfaces of pre-compiled loaded .o modules.
>=20
> Please, confirm, whether I understand correct?

Yes, that's right.

> And many users would like to measure (1) within the  ghci  loop.
>=20
> The statistic like   Prelude> List.sort [1..10]
>                      [1,2,3,4,5,6,7,8,9,10]
>                      (0.53 secs, 7109100 bytes)
>=20
> includes the number of allocations, which cannot help to detect (1)
> (can it?)

No, it can't.

> This is a user's wish for the future  ghci  version.
>=20
> I do not know, whether it is hard to develop.
> If it is hard, personally, I would not suffer much.

It's hard, because the three kinds of data you mention above can't
easily be separated.  It's entirely possible, due to the fact that GHCi
is sharing the heap with the running interpreted program, that the data
in use by the program could end up pointing to compiler data structures
(perhaps because parts of the code are lazilly compiled).

Furthermore, having an indication of the memory residency of the
interpreted program isn't much of an indication of the residency of a
compiled program, which is after all what really matters.  If you want
speed or memory efficiency, just compile the program.

> Another wish: to document the  ghci  memory management
> -------------
> which we are discussing now.
> Because GHC could simply give a reference to the manual section.

I'll elaborate in the GHCi documentation.

> > However, you can always compile the program
> > and use profiling...
>=20
> Suppose User demonstrates an Haskell application A to the Listener.=20
> Naturally, most of  A  constitutes its `library'  L,  and  L  was=20
> compiled to .o files
>                      (desirably, gathered in the  libL.a  archive).
>=20
> ghci  invokes, loads the _interpreted_ demonstration code  D,
> much smaller than  L,  but importing items from  L.
> Naturally, Listener asks something like=20
> "and how much memory needs to compute this matrix?".
>=20
> In many other system, the interactive command, say, `:size'
> gives immediately some interpreter memory map and the sizes taken
> by `code' and `data'.
> And you suggest to wait 2 hours to re-compile _everything_ with=20
> profiling. The Listener would not wait.
>=20
> >> For, with -O and much in-lining, the interfaces may be very large.
>=20
> > You really don't want to use -O with GHCi (in fact, at the=20
> moment you
> > can't).
>=20
> This may be serious. For example,  putStr $ show (sum1 [1..n])
>=20
> will need a constant memory or O(n) memory depending on the  -O
> possibility.

True.  But compiling with optimsation takes 2-3 times longer than
interpreting - if you're prepared to wait that long, you might as well
compile instead.  Compiling will give more of a performance boost in
general (about 10x) than turning on -O (perhaps 2x).

Cheers,
	Simon


From rrt@dcs.gla.ac.uk Mon Apr 30 16:14:25 2001 Date: Mon, 30 Apr 2001 16:14:25 +0100 (BST) From: Reuben Thomas rrt@dcs.gla.ac.uk Subject: Happy 1.10 Windows InstallShield available
An InstallShield distribution of Happy 1.10 for Windows is now available
from the Happy page (www.haskell.org/happy/).



From emeijer@microsoft.com Mon Apr 30 23:51:56 2001 Date: Tue, 1 May 2001 00:51:56 +0200 From: Erik Meijer emeijer@microsoft.com Subject: : RE: haskell.runtime.* ??
There is a working GHC-to-.Net runtime available at
www.mondrian-script.org <http://www.mondrian-script.org/> ; reving the
Jva a backend should not be too much of a problem.


Erik

=20

=20

Message: 1
Subject: RE:  haskell.runtime.* ??
Date: Sun, 29 Apr 2001 12:16:24 -0700
From: "Simon Peyton-Jones" < simonpj@microsoft.com
<mailto:simonpj@microsoft.com> >
To: "Kwanghoon Choi" < khchoi@ruby.kaist.ac.kr
<mailto:khchoi@ruby.kaist.ac.kr> >,
< glasgow-haskell-users@haskell.org
<mailto:glasgow-haskell-users@haskell.org> >

I'm afraid that no one ever completed the GHC Haskell->Java
story.  The idea is that the JVM is the runtime, but of
course you need to implement the standard libraries somehow,=3D20
and all the primitive operations GHC uses.   Not a trivial
task, but one we are undertaking for .NET.

Bottom line: the reason you can't find a runtime is because
you are supposed to compile the Java with a Java compiler
and run that.  But you'll need to do more than that to
actually run programs

Simon



From joe@isun.informatik.uni-leipzig.de Mon Apr 2 07:43:07 2001 From: joe@isun.informatik.uni-leipzig.de (Johannes Waldmann) Date: Mon, 2 Apr 2001 08:43:07 +0200 (MET DST) Subject: process file table full? Message-ID: <200104020643.IAA07017@isun11.informatik.uni-leipzig.de> Dear all, I was running a ghc compiled executable, (containing -syslib net -syslib concurrent) and got this after a while Fail: resource exhausted Action: openFile Reason: process file table full connect-985988146.log what could be the reasons? something related to sockets? -- -- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ -- -- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 -- From ltaesch@europemail.com Mon Apr 2 13:36:30 2001 From: ltaesch@europemail.com (ltaesch@europemail.com) Date: Mon, 2 Apr 2001 08:36:30 -0400 (EDT) Subject: package ? 4.0.8.2 Message-ID: <010402083630EK.05104@weba2.iname.net> im new to ghc. i just could not find how to include lib/package in the compile... by browsing the web, i found that http://www.cs.mu.oz.au/fpu/ghc-guides/set/packages.html#LISTING-PACKAGES have a 3.8 section about package, whereas haskell.org/ghc/documentation dont ! also ghc --list-packages doesnt not work on my win install (fresh from the day before) also, the doc mention a packages.conf file. where is this one ? (on win) are there some changes currently worked on packages ? thanks Luc ------------------------------------------------------ Get free personalized email at http://four11.iname.com From christian.lescher@icn.siemens.de Mon Apr 2 14:11:57 2001 From: christian.lescher@icn.siemens.de (Lescher Christian) Date: Mon, 2 Apr 2001 15:11:57 +0200 Subject: Difficulties compiling hmake / HaXml Message-ID: <353063C297A9D3118F760008C791E26901F86510@MCHH263E> Now that I made it through the hmake compilation and went on to the haXml tools I come to another problem with compiling haXml. The error message (below) lead me to the missing file (IOExts.hi) which I found in "/lib/imports/lang". I searched the Makefile and recognized the "HFLAGS" variable wich seems to be set for the ghc-compiler and the path to the "lang" directory. But, as there is an error message what is wrong ? Is there a problem with the Makefile or the directory structure? Can you help me go on? Cheers, Christian C:\test-haxml>make cd lib; hmake XmlLib.hs ghc -c -o Pretty.o Pretty.lhs ghc -c -o XmlTypes.o XmlTypes.hs ghc -c -o XmlPP.o XmlPP.hs ghc -c -o XmlLex.o XmlLex.hs ghc -c -o ParseSTLib.o ParseSTLib.hs ghc -c -o XmlHtmlParse.o XmlHtmlParse.hs ghc -c -o XmlParse.o XmlParse.hs XmlParse.hs:39: Could not find interface file for `IOExts' in the directories ./*.hi C:/ghc/ghc-4.08.2/lib/imports/std/*.hi Compilation had errors make: *** [XmlLib] Error 1 From simonmar@microsoft.com Mon Apr 2 14:29:48 2001 From: simonmar@microsoft.com (Simon Marlow) Date: Mon, 2 Apr 2001 14:29:48 +0100 Subject: package ? 4.0.8.2 Message-ID: <9584A4A864BD8548932F2F88EB30D1C60171F59D@TVP-MSG-01.europe.corp.microsoft.com> > im new to ghc. >=20 > i just could not find how to include lib/package in the compile... >=20 >=20 > by browsing the web, i found that =20 > http://www.cs.mu.oz.au/fpu/ghc-guides/set/packages.html#LISTING-PACKAGES > have a 3.8 section about package, whereas haskell.org/ghc/documentation dont ! > > also ghc --list-packages doesnt not work on my win install (fresh from the day=20 > before) > > also, the doc mention a packages.conf file. > where is this one ? (on win) GHC 4.08.2 doesn't have package.conf, or the ghc-pkg tool. These are in the forthcoming GHC 5.00 only; presumably the documentation you are looking at is for a newer version of GHC. Cheers, Simon From keving@cs.mu.OZ.AU Tue Apr 3 00:13:11 2001 From: keving@cs.mu.OZ.AU (Kevin Glynn) Date: Tue, 3 Apr 2001 09:13:11 +1000 Subject: package ? 4.0.8.2 In-Reply-To: <9584A4A864BD8548932F2F88EB30D1C60171F59D@TVP-MSG-01.europe.corp.microsoft.com> References: <9584A4A864BD8548932F2F88EB30D1C60171F59D@TVP-MSG-01.europe.corp.microsoft.com> Message-ID: <15049.1927.504841.563033@zip.cs.mu.oz.au> Apologies, this is a local copy of the GHC documentation I use for speedy access. Somehow it appears to be halfway between 4.08 and 5.00. I've made it clearer on the fpu pages now. Slightly off-topic. Could you make a copy of the CVS versions of the documentation available from the GHC pages? I still haven't worked out how to get the right docbook stuff installed under Debian ... thanks k Simon Marlow writes: > > im new to ghc. > > > > i just could not find how to include lib/package in the compile... > > > > > > by browsing the web, i found that > > > http://www.cs.mu.oz.au/fpu/ghc-guides/set/packages.html#LISTING-PACKAGES > > > have a 3.8 section about package, whereas > haskell.org/ghc/documentation dont ! > > > > also ghc --list-packages doesnt not work on my win install (fresh from > the day > > before) > > > > also, the doc mention a packages.conf file. > > where is this one ? (on win) > > GHC 4.08.2 doesn't have package.conf, or the ghc-pkg tool. These are in > the forthcoming GHC 5.00 only; presumably the documentation you are > looking at is for a newer version of GHC. > > Cheers, > Simon > > _______________________________________________ > Glasgow-haskell-users mailing list > Glasgow-haskell-users@haskell.org > http://www.haskell.org/mailman/listinfo/glasgow-haskell-users > From joe@isun.informatik.uni-leipzig.de Tue Apr 3 07:21:51 2001 From: joe@isun.informatik.uni-leipzig.de (Johannes Waldmann) Date: Tue, 3 Apr 2001 08:21:51 +0200 (MET DST) Subject: process file table full? Message-ID: <200104030621.IAA08200@isun11.informatik.uni-leipzig.de> Yesterday I asked for the posssible reasons of > Fail: resource exhausted > Action: openFile > Reason: process file table full connect-985988146.log Writing that particular file wasn't the cause, but just a symptom. It seems that I forgot to close filehandles obtained from Socket.accept. I somehow thought they were garbage collecteted, but apparently the weren't. -- -- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ -- -- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 -- From simonpj@microsoft.com Tue Apr 3 08:43:59 2001 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Tue, 3 Apr 2001 00:43:59 -0700 Subject: package ? 4.0.8.2 Message-ID: <37DA476A2BC9F64C95379BF66BA2690260DCE1@red-msg-09.redmond.corp.microsoft.com> Julian is planning to make the nightly-build documentation visible from the GHC home page. (aren't you, Julian?!) Simon | -----Original Message----- | From: Kevin Glynn [mailto:keving@cs.mu.OZ.AU]=20 | Sent: 03 April 2001 00:13 | To: Simon Marlow | Cc: ltaesch@europemail.com; glasgow-haskell-users@haskell.org | Subject: RE: package ? 4.0.8.2 |=20 |=20 |=20 | Apologies, this is a local copy of the GHC documentation I=20 | use for speedy access. Somehow it appears to be halfway=20 | between 4.08 and 5.00. I've made it clearer on the fpu pages now. |=20 | Slightly off-topic. Could you make a copy of the CVS=20 | versions of the documentation available from the GHC pages? I=20 | still haven't worked out how to get the right docbook stuff=20 | installed under Debian ... |=20 | thanks | k |=20 |=20 |=20 | Simon Marlow writes: | > > im new to ghc. | > >=20 | > > i just could not find how to include lib/package in the=20 | compile... > >=20 | > >=20 | > > by browsing the web, i found that =20 | > > | >=20 | http://www.cs.mu.oz.au/fpu/ghc-guides/set/packages.html#LISTIN G-PACKAGES >=20 > > have a 3.8 section about package, whereas > haskell.org/ghc/documentation dont ! > > > > also ghc --list-packages doesnt not work on my win install (fresh from > the day=20 > > before) > > > > also, the doc mention a packages.conf file. > > where is this one ? (on win) >=20 > GHC 4.08.2 doesn't have package.conf, or the ghc-pkg tool. These are in > the forthcoming GHC 5.00 only; presumably the documentation you are > looking at is for a newer version of GHC. >=20 > Cheers, > Simon >=20 > _______________________________________________ > Glasgow-haskell-users mailing list > Glasgow-haskell-users@haskell.org > http://www.haskell.org/mailman/listinfo/glasgow-haskell-users >=20 _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users From simonmar@microsoft.com Tue Apr 3 09:38:50 2001 From: simonmar@microsoft.com (Simon Marlow) Date: Tue, 3 Apr 2001 09:38:50 +0100 Subject: process file table full? Message-ID: <9584A4A864BD8548932F2F88EB30D1C60171F5A1@TVP-MSG-01.europe.corp.microsoft.com> > Yesterday I asked for the posssible reasons of >=20 > > Fail: resource exhausted > > Action: openFile > > Reason: process file table full connect-985988146.log >=20 > Writing that particular file wasn't the cause, but just a symptom. >=20 > It seems that I forgot to close filehandles obtained from=20 > Socket.accept. > I somehow thought they were garbage collecteted, but=20 > apparently the weren't. They should be garbage collected and closed automatically. But it may be some time between the handle becoming garbage and it finally being closed, so if you're accepting connections at a fast rate, it's always a good idea to close the handle explicitly when you finish with it. Cheers, Simon From christian.lescher@icn.siemens.de Tue Apr 3 12:37:18 2001 From: christian.lescher@icn.siemens.de (Lescher Christian) Date: Tue, 3 Apr 2001 13:37:18 +0200 Subject: AW: Difficulties compiling hmake / HaXml Message-ID: <353063C297A9D3118F760008C791E26901F86514@MCHH263E> Thanks for helping me out again. Now I made it through to the XML-Tools but unfortunatly they brought me another error. Below the error message I copied the 2 lines mentioned there (220 and 222) from the haskell file. cd tools; hmake DtdToHaskell -I../lib -package text ghc -package text -I../lib -c -o DtdToTypeDefPP.o DtdToTypeDefPP.hs DtdToTypeDefPP.hs:220: Data constructor not in scope: `DefaultTo' DtdToTypeDefPP.hs:222: Data constructor not in scope: `DefaultTo' Compilation had errors make: *** [DtdToHaskell] Error 1 bash-2.04$ ---------- mkAttrField e (AttDef n StringType (DefaultTo (AttValue [Left s]) f)) = (name_f e n, Defaultable String s) mkAttrField e (AttDef n _ (DefaultTo (AttValue [Left s]) f)) = (name_f e n, Defaultable (Defined (name n)) (mangle s)) From Malcolm.Wallace@cs.york.ac.uk Tue Apr 3 13:07:03 2001 From: Malcolm.Wallace@cs.york.ac.uk (Malcolm Wallace) Date: Tue, 3 Apr 2001 13:07:03 +0100 Subject: AW: Difficulties compiling hmake / HaXml In-Reply-To: <353063C297A9D3118F760008C791E26901F86514@MCHH263E> Message-ID: > Thanks for helping me out again. Now I made it through to the > XML-Tools but unfortunatly they brought me another error. > cd tools; hmake DtdToHaskell -I../lib -package text > ghc -package text -I../lib -c -o DtdToTypeDefPP.o DtdToTypeDefPP.hs > > DtdToTypeDefPP.hs:220: Data constructor not in scope: `DefaultTo' > DtdToTypeDefPP.hs:222: Data constructor not in scope: `DefaultTo' This indicates a clash between the version of XmlTypes.hs installed in -package text, and the version in your source tree in directory ../lib. Remove "-package text" from the hmake command line, and change "-I../lib" to "-i../lib" (ghc prefers -i to -I). Regards, Malcolm From christian.lescher@icn.siemens.de Tue Apr 3 14:41:56 2001 From: christian.lescher@icn.siemens.de (Lescher Christian) Date: Tue, 3 Apr 2001 15:41:56 +0200 Subject: AW: AW: Difficulties compiling hmake / HaXml Message-ID: <353063C297A9D3118F760008C791E26901F8651B@MCHH263E> I changed the hmake call to that one you suggested but sadly another error followed up. cd tools; hmake DtdToHaskell -i../lib ghc -i../lib -c -cpp -o DtdToTypeDefPP.o DtdToTypeDefPP.hs DtdToTypeDefPP.hs:94: Ambiguous occurrence `commaList' It could refer to either `commaList', defined at DtdToTypeDefPP.hs:510 or `Pretty.commaList', imported from Pretty at DtdToTypeDefPP.hs:19 DtdToTypeDefPP.hs:117: Ambiguous occurrence `commaList' It could refer to either `commaList', defined at DtdToTypeDefPP.hs:510 or `Pretty.commaList', imported from Pretty at DtdToTypeDefPP.hs:19 Compilation had errors make: *** [DtdToHaskell] Error 1 bash-2.04$ From qrczak@knm.org.pl Wed Apr 4 15:48:33 2001 From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) Date: 4 Apr 2001 14:48:33 GMT Subject: Replacing module Array by IArray References: <0057440013251785000002L452*@MHS> Message-ID: Wed, 28 Mar 2001 21:11:59 +0200, andreas.marth@daimlerchrysler.com pisze: > The module Array exports module Ix (Haskell 98 Library Report). > The module IArray doesn't export Ix (jet?). Thanks, it will export it in ghc-5.00. > I think a pack and unpack function to convert between IArray ix be > and UArray ix ube via 'amap pack/unpack' would be useful. Such conversion is as simple as \a -> listArray (bounds a) (elems a) or \a -> array (bounds a) (assocs a) so I don't think it needs a separate function. -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTĘPCZA QRCZAK From miketh@brisbane.paradigmgeo.com Thu Apr 5 07:12:17 2001 From: miketh@brisbane.paradigmgeo.com (Mike Thomas) Date: Thu, 5 Apr 2001 16:12:17 +1000 Subject: Hard earned hints for using Win32 GHC 4.08.2 and HDirect. Message-ID: <000f01c0bd97$622b4c50$0cb4a8c0@brisbane.paradigmgeo.com> Hi all. I thought I might share some hints on making HDirect work with GHC 4.08.2. Installing and checking GHC: - Get the installer from the GHC downloads page, do the installation per the instructions there, including Cygwin etc. - Remove the digit "1" from the bottom of lib/imports/win32/Win32.hi - Remove old .hi files from any program source directories you may have. - To test, try compiling the Windows hello.lhs example using the command line "ghc hello.lhs -o hello.exe -package win32" and run hello.exe. - If you get linker errors about "import____timezone_dll" from time.o, you need to add the line: push(@SysLibrary, '-lcrtdll') if ($TargetPlatform =~ /-(mingw32|cygwin32)$/); below the line: push(@SysLibrary, '-lwsock32') if ($TargetPlatform =~ /-(mingw32|cygwin32)$/); in your "bin/ghc" driver script. This is because the distribution is built with an old version of Cygwin GCC which links against crtdll.dll rather than msvcrt.dll when -mno-cygwin is set on the command line (GHC uses mingw32). By doing this, spare symbols are resolved after linkage with msvcrt.dll. DO NOT SUBSTITUTE -lmsvcrt with -lcrtdll. If you substitute, you will get errors about running out of resources on fileOpen at run time. - You may also need to update your GCC Mingw32 libraries and headers from the Sourceforge Mingw32 downloads page if you have unexplained crashes. Building HDIrect 0.17 - Uninstall previous versions of HDirect including "lib/imports/com" and associated libraries, which don't work very well with GHC 4.08.2. - Get the source from the HDirect web site and untar it somewhere. - You may need to edit "lib/WideStringSrc.c" if you use the latest Cygwin distribution to remove a clashing definition and declaration of wcslen(). - Build per the instructions in the INSTALL file. - This gives you a bare bones ihc.exe which cannot handle type libraries. - Install the freshly built lib/*.hi files in a new ghc "lib/imports/com" directory and also the libraries (libHScom.a, libhdirect.a) into ghc's "lib" directory. - Do "make clean", deleting "src/ihc.exe" by hand. - Set SUPPORT_TYPELIBS=YES in "src/Makefile" - "make boot", "make", then "make lib" as before. - You now have version 0.17 of HDirect for Windows. Question Time: Why does ihc ignore binary interfaces in type libraries such as dx7vb.dll? Cheers Mike Thomas From christian.lescher@icn.siemens.de Thu Apr 5 09:14:29 2001 From: christian.lescher@icn.siemens.de (Lescher Christian) Date: Thu, 5 Apr 2001 10:14:29 +0200 Subject: AW: Difficulties compiling hmake / HaXml Message-ID: <353063C297A9D3118F760008C791E26901F86526@MCHH263E> Finally I made it till the end, thanks to your very quick replies. I hope I didn't bother you too much with all the mails. At last I'd like to give a summary of all the changes been made to the files of the "HaXml" release. Perhaps you'll find this information usefull for further releases. system configuration: - Win NT 4.0 - cygwin 1.1.8 - ghc 4.08.2 - hmake 2.02 ;) - HaXml 1.01 The Makefile and the DtdToTypesDefPP.hs were changed. changes to Makefile: line 51: cd lib; hmake XmlLib.hs changed to cd lib; hmake XmlLib.hs -package lang line 53: cd lib; hmake Haskell2Xml.hs -> cd lib; hmake Haskell2Xml.hs -package lang -package text line 55: cd lib; hmake Xml2Haskell.hs -> cd lib; hmake Xml2Haskell.hs -package lang line 61: cd tools; hmake DtdToHaskell $(INC) mv tools/DtdToHaskell . -> cd tools; hmake DtdToHaskell -i../lib -package lang mv tools/DtdToHaskell.exe . line 65: cd examples; hmake Canonicalise $(INC) mv examples/Canonicalise . -> cd examples; hmake Canonicalise -i../lib -package lang mv examples/Canonicalise.exe . line 69: cd tools; hmake Xtract $(INC) mv tools/Xtract . -> cd tools; hmake Xtract -i../lib -package lang mv tools/Xtract.exe . line 74: mv tools/DrIFT/DrIFT . -> mv tools/DrIFT/DrIFT.exe . changes to DtdToTypesDefPP.hs: line 510: commaList = hcat . intersperse comma -> -- commaList = hcat . intersperse comma From rrt@dcs.gla.ac.uk Thu Apr 5 12:35:51 2001 From: rrt@dcs.gla.ac.uk (Reuben Thomas) Date: Thu, 5 Apr 2001 12:35:51 +0100 (BST) Subject: New InstallShield for Windows, plus mingwin fix Message-ID: I have uploaded a new GHC InstallShield for Windows that fixes many recent problems (including most of the problems with GHC that Mike Thomas reported in his list of instructions for building H/Direct). Unless the Cygwin team have acted with unwonted rapidity (which, at the time of writing, they hadn't), you'll also need to download our version of the mingwin package (or get the relevant bits from SourceForge). Our zip can simply be unpacked over an installed Cygwin tree to give you mingwin headers and libraries that really work. -- http://sc3d.org/rrt/ | certain, a. insufficiently analysed From fis@ssh.com Thu Apr 5 13:27:00 2001 From: fis@ssh.com (fis@ssh.com) Date: Thu, 5 Apr 2001 15:27:00 +0300 Subject: [Q] bootstrapping ghc on netbsd Message-ID: <200104051227.f35CR0K31090@dengue.local> Dear all, QUESTION: Is there an easy way of keeping ghc-4.08.2 from using any assembler code when compiling it from .hc files + sources? DETAILS: Why do I want to do this? gmp-2.0.2 has some problems compiling on netbsd machines that can be solved by hiding all assembler code from the compiler. Having done so, I managed to bootstrap on NetBSD 1.3.2, but still have an inplace-compiler failure on 1.5. The error message is from the gcc assembler (see below), so I thought trying a pure C variant might help somewhat. I undefined i386_{HOST,TARGET,BUILD}_ARCH in $(TOP)/mk/config.mk but it had no effect. thanks for any hints, Matthias ====================================================================== rm -f Addr.o ; if [ ! -d Addr ]; then mkdir Addr; else /usr/bin/find Addr -name '*.o' -print | xargs rm -f __rm_food ; fi ; ../../ghc/driver/ghc-inplace -recomp -cpp -fglasgow-exts -fvia-C -Rghc-timing -I../../ghc/includes -imonads -static -O -package-name lang -split-objs -c Addr.hc -o Addr.o -osuf o Funny global thing?: __stg_split_marker1: Funny global thing?: _module_registered: Funny global thing?: __init_Addr: Funny global thing?: __stg_split_marker2: Funny global thing?: __stg_split_marker3: [...] Funny global thing?: __stg_split_marker89: Funny global thing?: __stg_split_marker90: Prologue junk?: .globl __stg_split_marker2 __stg_split_marker2: ret .Lfe3: .size __stg_split_marker2,.Lfe3-__stg_split_marker2 .globl Addr_lvl_closure .data .align 4 .type Addr_lvl_closure,@object .size Addr_lvl_closure,4 Addr_lvl_closure: .long Addr_lvl_info .globl Addr_lvl_info .section .rodata .align 4 .type Addr_lvl_info,@object .size Addr_lvl_info,12 Addr_lvl_info: .long 0 .word 0 .word 0 .word 17 .word 0 .text .align 4 .globl Addr_lvl_entry .type Addr_lvl_entry,@function Addr_lvl_entry: gmake[2]: *** [Addr.o] Error 255 ====================================================================== -- Matthias Fischmann | Research Engineer | +358 (9) 8565 7474 fis@ssh.fi | SSH Communication Security Corp. | +358 (40) 752 5291 From josefs@cs.chalmers.se Thu Apr 5 16:28:40 2001 From: josefs@cs.chalmers.se (Josef Svenningsson) Date: Thu, 5 Apr 2001 17:28:40 +0200 (MET DST) Subject: About rules Message-ID: Hi all! I've been playing around with the rules facility a bit. There is a boring shortcoming when working with infix operators. It seems that the rule parser doesn't like them at all. The following example gives syntax error: {-# RULES "plus/mult" forall p . p + p = 2 * p #-} whereas the following is allright: {-# RULES "plus/mult" forall p . (+) p p = (*) 2 p #-} It's not a big problem, but it's rather inconvenient and ugly. Is it easy to fix? Cheers, /Josef From simonmar@microsoft.com Fri Apr 6 09:58:58 2001 From: simonmar@microsoft.com (Simon Marlow) Date: Fri, 6 Apr 2001 09:58:58 +0100 Subject: [Q] bootstrapping ghc on netbsd Message-ID: <9584A4A864BD8548932F2F88EB30D1C60171F5C6@TVP-MSG-01.europe.corp.microsoft.com> > QUESTION: Is there an easy way of keeping ghc-4.08.2 from using any > assembler code when compiling it from .hc files + sources? No, there isn't an easy way. When compiling via C, GHC "mangles" the assembly output from the C compiler in order to support tail calls and some other optimisations. There's a native code generator, but currenly it can't be used for some of the library code. > DETAILS: Why do I want to do this? gmp-2.0.2 has some problems > compiling on netbsd machines that can be solved by hiding all > assembler code from the compiler. I think this was a misconfiguration problem with GMP, as I mentioned in my other message to glasgow-haskell-bugs. > Having done so, I managed to > bootstrap on NetBSD 1.3.2, but still have an inplace-compiler failure > on 1.5. The error message is from the gcc assembler (see below), so I > thought trying a pure C variant might help somewhat. This is almost certainly an incompatibility between the exact flavour of GCC being used on NetBSD 1.5, and our assembly mangling machinery. If you add the flag -ddump-raw-asm, and send me the output, I might be able to tell what's wrong. Cheers, Simon From simonpj@microsoft.com Fri Apr 6 15:40:57 2001 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Fri, 6 Apr 2001 07:40:57 -0700 Subject: About rules Message-ID: <37DA476A2BC9F64C95379BF66BA26902D72E24@red-msg-09.redmond.corp.microsoft.com> No good reason. I've implemented the one-line change in my copy but we're in a code freeze until we release GHCi 5.00 on Monday. After that I'll commit it. Good idea, thank you. Simon | -----Original Message----- | From: Josef Svenningsson [mailto:josefs@cs.chalmers.se]=20 | Sent: 05 April 2001 16:29 | To: glasgow-haskell-users@haskell.org | Subject: About rules |=20 |=20 | Hi all! |=20 | I've been playing around with the rules facility a bit. There=20 | is a boring shortcoming when working with infix operators. It=20 | seems that the rule parser doesn't like them at all. The=20 | following example gives syntax error: |=20 | {-# RULES | "plus/mult" forall p . p + p =3D 2 * p | #-} |=20 | whereas the following is allright: |=20 | {-# RULES | "plus/mult" forall p . (+) p p =3D (*) 2 p | #-} |=20 | It's not a big problem, but it's rather inconvenient and=20 | ugly. Is it easy to fix? |=20 | Cheers, | /Josef |=20 |=20 | _______________________________________________ | Glasgow-haskell-users mailing list=20 | Glasgow-haskell-users@haskell.org=20 | http://www.haskell.org/mailman/listinfo/glasgow-| haskell-users |=20 From m@ryangunter.com Sat Apr 7 18:23:43 2001 From: m@ryangunter.com (Mike Gunter) Date: 07 Apr 2001 10:23:43 -0700 Subject: process file table full? In-Reply-To: "Simon Marlow"'s message of "Tue, 3 Apr 2001 09:38:50 +0100" References: <9584A4A864BD8548932F2F88EB30D1C60171F5A1@TVP-MSG-01.europe.corp.microsoft.com> Message-ID: <87wv8whbds.fsf@c966553-A.frmt1.sfba.home.com> One might think it would be best to trigger a garbage collection before giving up and raising the exception. Or no? mike "Simon Marlow" writes: > > Yesterday I asked for the posssible reasons of > > > > > Fail: resource exhausted > > > Action: openFile > > > Reason: process file table full connect-985988146.log > > > > Writing that particular file wasn't the cause, but just a symptom. > > > > It seems that I forgot to close filehandles obtained from > > Socket.accept. > > I somehow thought they were garbage collecteted, but > > apparently the weren't. > > They should be garbage collected and closed automatically. But it may > be some time between the handle becoming garbage and it finally being > closed, so if you're accepting connections at a fast rate, it's always a > good idea to close the handle explicitly when you finish with it. > > Cheers, > Simon From ltaesch@europemail.com Sun Apr 8 19:25:55 2001 From: ltaesch@europemail.com (luc) Date: Sun, 08 Apr 2001 18:25:55 +0000 Subject: failed when trying to compile FranTk with ghc Message-ID: <3AD0AD33.767DA714@europemail.com> I tried FranTk with ghc 4.08 and got : (this is the "fixed" FrankTk, alledged working with 4.06, if im not wrong) are there any difference with 4.06 and 4.08 ? ------------------------------------------------------------------------ ==fptools== gmake boot - --no-print-directory -r; in /home/luc/tmp/FranTk/src/FranSrc ------------------------------------------------------------------------ ghc -M -optdep-f -optdep.depend -optdep-o -optdepo -O -fglasgow-exts -recomp -dcore-lint -fvia-C -syslib concurrent -i../TclHaskellSrc Compatibility.ghc.hs BaseTypes.hs Force.hs MutSet.hs Event.hs BPrim.hs WorkPool.hs FranTime.hs Behavior.hs FranPrim.hs Listener.hs ColorCore.hs Vector2.hs VectorSpace.hs Point2.hs Vector3.hs Point3.hs Transform2.hs Rect.hs Transform3.hs StaticTypes.hs ColorCoreB.hs Point2B.hs Point3B.hs Vector2B.hs Vector3B.hs RectB.hs Transform2B.hs Transform3B.hs BehaviorTypes.hs VectorSpaceB.hs BehaviorIO.hs FranCore.hs FranBehavior.hs No file `PrelNumExtra.hi', `PrelNumExtra.lhs', `PrelNumExtra.hs' (reqd from file `Compatibility.ghc.hs') among import directories: ../TclHaskellSrc:. gmake[2]: *** [depend] Error 1 gmake[1]: *** [boot] Error 1 From kort@science.uva.nl Mon Apr 9 10:01:08 2001 From: kort@science.uva.nl (Jan Kort) Date: Mon, 09 Apr 2001 11:01:08 +0200 Subject: failed when trying to compile FranTk with ghc References: <3AD0AD33.767DA714@europemail.com> Message-ID: <3AD17A53.77F5DD5C@wins.uva.nl> luc wrote: > > I tried FranTk with ghc 4.08 and got : > (this is the "fixed" FrankTk, alledged working with 4.06, if im not > wrong) > > are there any difference with 4.06 and 4.08 ? Below is a list of fixes to get FranTk working with ghc4.08. Jan Run configure like normal, i.e.: ./configure --prefix=/scratch/kort/pkgs/frantk Change the file FranTk/src/FranSrc/Compatibility.ghc.hs to ======================================================================== -- this module is for GHC; GSL module Compatibility ( double2Float , yield , debugMsgLn , setDebug , mkWeakIORef , toInt , fromInt ) where import GlaExts import NumExts(doubleToFloat) import PrelRead(readDec) import IOExts import Concurrent import Exception double2Float = doubleToFloat setDebug :: Bool -> IO () setDebug _ = return () debugMsgLn :: String -> IO () debugMsgLn s = assert (trace s `seq` True) $ return () ======================================================================== In the file FranTk/src/FranTkSrc/Makefile change the line: HC_OPTS+= -i../FranSrc:../TclHaskellSrc -fallow-overlapping-instances -fallow-undecidable-instances -syslib misc to: HC_OPTS+= -i../FranSrc:../TclHaskellSrc -fallow-overlapping-instances -fallow-undecidable-instances -syslib data In the file FranTk/demos/Makefile change the line: HC_OPTS+= -i../src/FranTkSrc:../src/FranSrc:../src/TclHaskellSrc -fallow-overlapping-instances -fallow-undecidable-instances -syslib misc to: HC_OPTS+= -i../src/FranTkSrc:../src/FranSrc:../src/TclHaskellSrc -fallow-overlapping-instances -fallow-undecidable-instances -syslib data If the compiler complains about not finding the file "tcl.h", in the file FranTk/src/TclHaskellSrc/Makefile change the rule: tclhaskell.o: tclhaskell.c tclhaskell.h $(HC) -c tclhaskell.c to: tclhaskell.o: tclhaskell.c tclhaskell.h $(HC) -I/opt/arch/lib/tk8.3/include -c tclhaskell.c where /opt/arch... is the place "tcl.h" and "tk.h" are. In the directory FranTk/src/TclHaskellSrc do: rm *.hi *.o In the file FranTk/src/TclHaskellSrc/Makefile add TclPrim.hs to the HS_SRCS list. In the directory FranTk/src/FranSrc do: rm *.hi In the directory FranTk/demos do: rm *.hi And then continue the normal installation with: gmake boot gmake all From extern.thomas.pasch@volkswagen.de Mon Apr 9 10:52:47 2001 From: extern.thomas.pasch@volkswagen.de (Pasch, Thomas (ACTGRO)) Date: Mon, 9 Apr 2001 11:52:47 +0200 Subject: How to convert the type signature of a variable to a String? Message-ID: <96C14D00FA99D311A8D60008C791F3640982679C@devwagwodx0009.wob.vw.de> Hello, it is possible to write module Main(main) where import Dynamic main = putStrLn ( show ( typeOf (f (1::Integer)))) f x = x The output is of course Integer But the typeOf will only work for 'concrete' data types. It will not work for functions. So I can't write main = putStrLn ( show ( typeOf (f))) Thus it is possible to write a function that recognize functions, i.e. functionType arg = case arg of (arg:: a->b) -> "function" So the question is: Is is possible to write a function the gives back a String with the signature of the argument of that function? For example: 'function f' gives the String "a->a" Best regards, Thomas From pasch@netzGeneration.com Tue Apr 10 00:55:21 2001 From: pasch@netzGeneration.com (Thomas Pasch) Date: Tue, 10 Apr 2001 01:55:21 +0200 Subject: How to box/unbox values? Message-ID: <3AD24BE9.9F74B867@netzGeneration.com> Hello, is there an easy way to box/unbox Types. I need this for Int's, so is there a function that does: Int# -> Int Int -> Int# Regards, Thomas From uk1o@rz.uni-karlsruhe.de Tue Apr 10 08:53:19 2001 From: uk1o@rz.uni-karlsruhe.de (Hannah Schroeter) Date: Tue, 10 Apr 2001 09:53:19 +0200 Subject: How to box/unbox values? In-Reply-To: <3AD24BE9.9F74B867@netzGeneration.com>; from pasch@netzGeneration.com on Tue, Apr 10, 2001 at 01:55:21AM +0200 References: <3AD24BE9.9F74B867@netzGeneration.com> Message-ID: <20010410095318.C10333@rz.uni-karlsruhe.de> Hello! On Tue, Apr 10, 2001 at 01:55:21AM +0200, Thomas Pasch wrote: > is there an easy way to box/unbox Types. > I need this for Int's, so is there > a function that does: > Int# -> Int > Int -> Int# You must import the appropriate modules, to "see" the type definition for Int (which is data Int = I# Int# in GHC). Then just use plain pattern matching: unboxInt :: Int -> Int# unboxInt (I# i#) = i# boxInt :: Int# -> Int boxInt i# = I# i# Note that there are some restrictions for handling unboxed values, see the documentation. Kind regards, Hannah. From v-julsew@microsoft.com Tue Apr 10 10:52:01 2001 From: v-julsew@microsoft.com (Julian Seward (Intl Vendor)) Date: Tue, 10 Apr 2001 02:52:01 -0700 Subject: How to box/unbox values? Message-ID: <68B95AA1648D1840AB0083CC63E57AD60EFC2E@red-msg-06.redmond.corp.microsoft.com> | -----Original Message----- | From: Thomas Pasch [mailto:pasch@netzGeneration.com] | Sent: Tuesday, April 10, 2001 12:55 AM | To: glasgow-haskell-users@haskell.org | Subject: How to box/unbox values? |=20 |=20 | Hello, |=20 | is there an easy way to box/unbox Types. | I need this for Int's, so is there=20 | a function that does: |=20 | Int# -> Int | Int -> Int# import GlaExts ( Int(..) ) iBox x =3D I# x iUnbox (I# x) =3D x From ger@tzi.de Tue Apr 10 15:30:14 2001 From: ger@tzi.de (George Russell) Date: Tue, 10 Apr 2001 16:30:14 +0200 Subject: ghc5.00 binary on Sparc? Message-ID: <3AD318F6.413988A1@tzi.de> GHC 5.00 looks wonderful. Would it be possible to make a binary distribution available for Sparc? As you may remember, I've had difficulty compiling it myself for Sparc, for some reason I don't know, and even if I find a way of hacking things to compile it, I'd rather users (= students) didn't have to . . . From andrew@intertrader.com Wed Apr 11 09:09:50 2001 From: andrew@intertrader.com (Andrew Cooke) Date: Wed, 11 Apr 2001 09:09:50 +0100 Subject: Stack trace on error (and packages) Message-ID: <3AD4114E.2BB28B01@intertrader.com> Hi, Is it possible to persuade ghc/RTS to provide a stack trace (or something similar) when an error occurs? I have some code that is generating a runtime error (appears to be due to division by almost-zero, provoking very large numbers and then a NaN in a case statement when coerced to Double) in a function that is used throughout my code - it would be a big help to know which function called the function that is generating the error. Also, less importantly, how do I generate packages? I have a bunch of .o files (modules) all compiled using -package-name and -c, but I can't find the correct ghc flag to link them into a library (.a/Linux). Apologies if both/either of these are covered in the docs - I couldn't find a simple way of getting a stack trace and no info on actually linking to create a package (when I try various "obvious" things I get errors indicating a missing main). Thanks, Andrew PS Away from home, so having to use my work address. Please reply to the list (which I can read on the 'net and will subscribe to when I get home) or, if you want to avoid that, andrew@andrewcooke.free-online.co.uk, which I will read this weekend. Work isn't happy about non-work-related emails to this account. Sorry. From Keith.Wansbrough@cl.cam.ac.uk Wed Apr 11 10:00:05 2001 From: Keith.Wansbrough@cl.cam.ac.uk (Keith Wansbrough) Date: Wed, 11 Apr 2001 10:00:05 +0100 Subject: Stack trace on error (and packages) In-Reply-To: Message from Andrew Cooke of "Wed, 11 Apr 2001 09:09:50 BST." <3AD4114E.2BB28B01@intertrader.com> Message-ID: > > Hi, > > Is it possible to persuade ghc/RTS to provide a stack trace (or > something similar) when an error occurs? I have some code that is > generating a runtime error (appears to be due to division by > almost-zero, provoking very large numbers and then a NaN in a case > statement when coerced to Double) in a function that is used throughout > my code - it would be a big help to know which function called the > function that is generating the error. Yes. Compile your program with -prof -auto-all (you need at least -prof on all modules for the link to work, but -auto-all is only necessary on modules containing functions you want to trace). This turns on automatic profiling. Now run your program with the option `+RTS -xc' . This will turn on a cost-centre stack trace, displayed each time your program throws an exception (including runtime errors). This gives not the program stack (which function demanded which value), but the cost-centre stack (which function called which function which failed), which may or may not be more useful. The former is only available under `gdb' at the moment, with a very hairy user interface. You can read about cost centres in chapter 4 of the manual. My apologies for not having put this properly in the manual yet! HTH.. --KW 8-) -- Keith Wansbrough http://www.cl.cam.ac.uk/users/kw217/ Cambridge University Computer Laboratory. From qrczak@knm.org.pl Wed Apr 11 13:19:50 2001 From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) Date: Wed, 11 Apr 2001 14:19:50 +0200 (CEST) Subject: IArray and MArray Message-ID: Is it important to keep the current definition of IArray and MArray classes? I would like to change class operations, without changing the interface, i.e. turn methods into ordinary overloaded functions and have different methods. It would affect users making their own instances of these classes, but not users of these instances. The problem is that translation of the index to an Int is coupled with actual array operations. It's not possible to omit the translation with the range check in an overloaded way; such operations must be coded separately for each element type, which is quite painful. It's not possible to add a method which specifies indexing by Int, because there is no reasonable default definition, except using (!!) on the index range: the class Ix doesn't define translation from Int to indices. Many bulk operations don't need indices but just iterate over the array: elems, listArray, amap, thaw, freeze, (==), compare (actually compare is a more complex issue). The performance is horrible if tight loops do the translation. But if the needed functionality is not in the array, the operation must be coded for each type separately instead of letting the compiler do the specialization, and some of these must be matched with rules. Class operations define too much. Translation of indices to Ints with bounds checking is done in the same way for all arrays. These operations must be polymorphic wrt. index, so they don't have a choice. But they have to hardwire the translation into individual methods. I would let operations in IArray and MArray work on Ints and change current methods to functions overloaded over the array and the index. -- Marcin 'Qrczak' Kowalczyk From v-julsew@microsoft.com Thu Apr 12 13:17:50 2001 From: v-julsew@microsoft.com (Julian Seward (Intl Vendor)) Date: Thu, 12 Apr 2001 05:17:50 -0700 Subject: The (Interactive) Glasgow Haskell Compiler -- version 5.00 Message-ID: <68B95AA1648D1840AB0083CC63E57AD60EFC42@red-msg-06.redmond.corp.microsoft.com> [Binary builds for x86-linux and sparc-solaris are now available. We're still working on the Windows version. -- J] The (Interactive) Glasgow Haskell Compiler -- version 5.00 = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D We are pleased to announce a new major release of the Glasgow Haskell Compiler (GHC), version 5.00. The source distribution is freely available via the World-Wide Web and through anon. FTP, under a BSD-style license. See below for download details. Pre-built packages for Linux, FreeBSD, Solaris and Win32 are also available. 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 5.00 has been majorly revamped since the previous stable version, 4.08.2. This should be a stable release. Major changes since 4.08.2 are: - An interactive system, similar in style to Hugs. You can interactively load and unload modules, run expressions, ask the types of things. Module dependencies are tracked and chased automatically. Combinations of compiled and interpreted modules may be used. All the GHC libraries are available in interactive mode, as are most of the Glasgow extensions to Haskell 98. Compilation in interactive mode (to bytecode) is about three times faster than compiling to object code. - Batch compilation of multiple modules at once, with automatic dependency chasing. For large programs this can halve compilation times, and removes the need for Makefiles. - Enhanced package (library) management system. Packages may be installed and removed from an installation using the ghc-pkg tool. - Initial Unicode support - the Char type is now 31 bits. - Sparc native code generator, giving much faster compilation on sparcs. (Native code generation for x86s has been available for a while). - Improved heap profiling - you can restrict heap profiles by type, closure description, cost centre, and module. - Support for the latest Foreign Function Interface (FFI) proposals. Marcin Kowalczyk's hsc2hs tool is included. - Language extensions: parallel list comprehensions and functional dependencies. - The usual huge collection of bug fixes. Most reported bugs have been fixed. For full details see the release notes: http://www.haskell.org/ghc/docs/5.00/set/release-5-00.html How to get it =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 .rpm/.deb form for all you Linux junkies out there, 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D To compile programs with GHC, you need a machine with 32+MB memory, GNU C and perl. This release is known to work on the following platforms: * i386-unknown-{linux,freebsd,mingw32} * sparc-sun-solaris2 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 * alpha-dec-osf{2,3} * mips-sgi-irix{5,6} * {rs6000,powerpc}-ibm-aix The builder's guide included in distribution gives a complete run-down of what ports work; an on-line version can be found at http://www.haskell.org/ghc/docs/5.00/building/building-guide.html Mailing lists =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 send bug reports about GHC to glasgow-haskell-bugs@haskell.org; GHC users hang out on glasgow-haskell-users@haskell.org. Bleeding edge CVS users party on cvs-ghc@haskell.org. From wbuss@telda.net Thu Apr 12 17:35:23 2001 From: wbuss@telda.net (Wolfhard Buß) Date: Thu, 12 Apr 2001 18:35:23 +0200 (MEST) Subject: Building ghci Message-ID: <20010412163523.F41DE1AB0AE@minka.katzen.ol> Hello, i just built and installed ghc 5.00 from the sources with the help from ghc 4.08.2. ghci responds with 'ghc-5.00: not built for interactive use'. Q: How to build ghc with support for interactive use? Which configure option or makefile target did i miss? Kind regards, Wolfhard. From michael.weber@post.rwth-aachen.de Thu Apr 12 17:45:40 2001 From: michael.weber@post.rwth-aachen.de (Michael Weber) Date: Thu, 12 Apr 2001 18:45:40 +0200 Subject: Building ghci In-Reply-To: =?iso-8859-1?Q?=3C20010412163523=2EF41DE1AB0AE=40minka=2Ekatzen=2Eol=3E?= =?iso-8859-1?Q?=3B_from_Wolfhard_Bu=DF_on_Thu=2C_Apr_12=2C_2001_at_06:35?= =?iso-8859-1?Q?:23PM_+0200?= References: <20010412163523.F41DE1AB0AE@minka.katzen.ol> Message-ID: <20010412184540.B868@jennifer.informatik.rwth-aachen.de> On Thu, Apr 12, 2001 at 18:35:23 +0200, Wolfhard Buß wrote: > Hello, > i just built and installed ghc 5.00 from the sources > with the help from ghc 4.08.2. > ghci responds with 'ghc-5.00: not built for interactive use'. just rebuild ghc-5.00 with itself again. Cheers, M/ -- /~\ ASCII ribbon | "Don't worry about people stealing your ideas. If your \ / campaign | ideas are any good, you'll have to ram them down X against | people's throats." / \ HTML mail | -- Howard Aiken From qrczak@knm.org.pl Sat Apr 14 21:28:16 2001 From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) Date: 14 Apr 2001 20:28:16 GMT Subject: How to convert the type signature of a variable to a String? References: <96C14D00FA99D311A8D60008C791F3640982679C@devwagwodx0009.wob.vw.de> Message-ID: Mon, 9 Apr 2001 11:52:47 +0200, Pasch, Thomas (ACTGRO) pisze: > So the question is: Is is possible to write a function the gives > back a String with the signature of the argument of that function? > > For example: > > 'function f' gives the String "a->a" No. Classes are not powerful enough to "recognize polymorphism". In this form it's not even theoretically consistent: any function can be treated as a function of a more specific type, so the result would be ambiguous (for example f has type Int->Int too, so asking for a type should give "Int->Int" too). The fact that a function can be treated as of more specific types than originally defined is not a problem when the function is used, because interpretations according to possible types agree. But when you want to make a string out of it, they can't agree if they are not trivial: a value can't behave as both strings "a->a" and "Int->Int". In Haskell there are almost no cases where an ambiguity is resolved implicitly, i.e. when one of several correct interpretations is chosen. There are not many ambiguities at all, and they result in compile errors if they arise. -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTĘPCZA QRCZAK From andrew@bromage.org Sun Apr 15 05:20:01 2001 From: andrew@bromage.org (Andrew J Bromage) Date: Sun, 15 Apr 2001 14:20:01 +1000 Subject: How to convert the type signature of a variable to a String? In-Reply-To: ; from qrczak@knm.org.pl on Sat, Apr 14, 2001 at 08:28:16PM +0000 References: <96C14D00FA99D311A8D60008C791F3640982679C@devwagwodx0009.wob.vw.de> Message-ID: <20010415142001.A24425@smtp.alicorna.com> G'day all. Mon, 9 Apr 2001 11:52:47 +0200, Pasch, Thomas (ACTGRO) pisze: > > For example: > > > > 'function f' gives the String "a->a" On Sat, Apr 14, 2001 at 08:28:16PM +0000, Marcin 'Qrczak' Kowalczyk wrote: [...] > In this form it's not even theoretically consistent: any function > can be treated as a function of a more specific type, so the result > would be ambiguous (for example f has type Int->Int too, so asking > for a type should give "Int->Int" too). I think I understand what you're saying, but I'd just like to understand this practically. We know that the most general type of `id' is "a->a". We assume there's a theoretical function: get_the_function_type_of :: a -> String where a can be a function type. Now consider: f :: (String -> String) -> String f g = g (get_the_function_type_of g) The question is: Should `f id' return "a->a" or "String->String"? Cheers, Andrew Bromage From davidbak@cablespeed.com Sun Apr 15 08:47:32 2001 From: davidbak@cablespeed.com (David Bakin) Date: Sun, 15 Apr 2001 00:47:32 -0700 Subject: win32 4.08.2 install question Message-ID: <002501c0c580$547f79a0$5900a8c0@girlsprout> This is a multi-part message in MIME format. ------=_NextPart_000_0022_01C0C545.A784D6D0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable While waiting for 5.00 for win32 I thought I'd get started with 4.08.2 - = downloaded it today and installed it and the latest cygwin as per = instructions. However: When following the "test the fruits of your = labour" I invoke "ghc -o main main.hs" and get back a bash prompt and = that's all. No files created, e.g., no main. Same for "ghc -c = main.hs". Something trivial must be wrong with my setup. I've copied = the ghc/bin/perl to cygwin/bin. No spaces in any directories (ghc is = installed at c:\ghc). My mounted dirs look like this: C:\Cygwin\bin>mount Device Directory Type Flags c:\Cygwin\bin /usr/bin user textmode c:\Cygwin\etc /etc user textmode c:\Cygwin\lib /usr/lib user textmode c: / user textmode Anybody have an idea what's going on? I can't wait to get 5.00 and its = integral driver! -- Dave ------=_NextPart_000_0022_01C0C545.A784D6D0 Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
While waiting for 5.00 for = win32 I thought=20 I'd get started with 4.08.2 - downloaded it today and installed it and = the=20 latest cygwin as per instructions.  However:  When following = the "test=20 the fruits of your labour" I invoke "ghc -o main main.hs" and get back a = bash=20 prompt and that's all.  No files created, e.g., no main.  Same = for=20 "ghc -c main.hs".  Something trivial must be wrong with my = setup. =20 I've copied the ghc/bin/perl to cygwin/bin.  No spaces in any = directories=20 (ghc is installed at c:\ghc). My mounted dirs look like = this:
 
C:\Cygwin\bin>mount
Device     &n= bsp;       =20 Directory          =20 Type        =20 Flags
c:\Cygwin\bin      =20 /usr/bin           = ;=20 user        =20 textmode
c:\Cygwin\etc      =20 /etc           &nb= sp;   =20 user        =20 textmode
c:\Cygwin\lib      =20 /usr/lib           = ;=20 user        =20 textmode
c:          = ;       =20 /            =       =20 user         = textmode
 
Anybody have an idea what's = going on? =20 I can't wait to get 5.00 and its integral driver!
 
-- = Dave
------=_NextPart_000_0022_01C0C545.A784D6D0-- From qrczak@knm.org.pl Sun Apr 15 13:09:29 2001 From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) Date: 15 Apr 2001 12:09:29 GMT Subject: How to convert the type signature of a variable to a String? References: <96C14D00FA99D311A8D60008C791F3640982679C@devwagwodx0009.wob.vw.de> <20010415142001.A24425@smtp.alicorna.com> Message-ID: Sun, 15 Apr 2001 14:20:01 +1000, Andrew J Bromage pisze: > We know that the most general type of `id' is "a->a". > We assume there's a theoretical function: > > get_the_function_type_of :: a -> String > > where a can be a function type. Now consider: > > f :: (String -> String) -> String > f g = g (get_the_function_type_of g) > > The question is: Should `f id' return "a->a" or "String->String"? Inside f the variable g has type String->String. It doesn't matter that the expression used to build this argument could be used on another type too: the level of concreteness of the type is not a part of the object having that type, but a property of the variable through which we access it. It would return "String->String" (assuming that get_the_function_type_of was in some sense possible). Any other overloaded function would be also used as for String->String instead of reporting an ambiguity error, where using it for 'id' directly could report an ambiguity error if the instance is not defined uniformly for all types of function arguments and results but depends on a particular choice of them. In other words all instances of an overloaded function must agree on the level to which they examine the type. If one of them doesn't look at a fragment of the type (e.g. function argument), others can't too; if one of them depends on them, the type must be determined in order to make a usage unambiguous. ghc has -fallow-overlapping-instances which relaxes this requirement. It allows fallbacks: when a type doesn't fit to any instance, try to use a more general one. It still doesn't make calls which don't determine that type unambiguous, and doesn't allow to recognize the fact that a variable is polymorphic. It has some strange properties, e.g. importing a module (which defines some instances) can change a valid program into another valid program with a different meaning. -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTĘPCZA QRCZAK From chak@cse.unsw.edu.au Sun Apr 15 15:15:39 2001 From: chak@cse.unsw.edu.au (Manuel M. T. Chakravarty) Date: Mon, 16 Apr 2001 00:15:39 +1000 Subject: The (Interactive) Glasgow Haskell Compiler -- version 5.00 In-Reply-To: <68B95AA1648D1840AB0083CC63E57AD60EFC42@red-msg-06.redmond.corp.microsoft.com> References: <68B95AA1648D1840AB0083CC63E57AD60EFC42@red-msg-06.redmond.corp.microsoft.com> Message-ID: <20010416001539X.chak@cse.unsw.edu.au> "Julian Seward (Intl Vendor)" wrote, > The (Interactive) Glasgow Haskell Compiler -- version 5.00 > ============================================================ > > We are pleased to announce a new major release of the Glasgow Haskell > Compiler (GHC), version 5.00. The source distribution is freely > available via the World-Wide Web and through anon. FTP, under a > BSD-style license. See below for download details. The source tar ball misses the configure scripts (it has the `configure.in's, but the source tar ball should be autoconf'ed, shouldn't it?) Cheers, Manuel From qrczak@knm.org.pl Sun Apr 15 15:29:59 2001 From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) Date: 15 Apr 2001 14:29:59 GMT Subject: The (Interactive) Glasgow Haskell Compiler -- version 5.00 References: <68B95AA1648D1840AB0083CC63E57AD60EFC42@red-msg-06.redmond.corp.microsoft.com> <20010416001539X.chak@cse.unsw.edu.au> Message-ID: Mon, 16 Apr 2001 00:15:39 +1000, Manuel M. T. Chakravarty pisze: > The source tar ball misses the configure scripts (it has the > `configure.in's, but the source tar ball should be > autoconf'ed, shouldn't it?) BTW, IMHO 'make maintainer-clean' should not delete configure scripts (comments say that it doesn't, but it does). -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTĘPCZA QRCZAK From qrczak@knm.org.pl Sun Apr 15 17:02:12 2001 From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) Date: 15 Apr 2001 16:02:12 GMT Subject: IArray and MArray References: Message-ID: Wed, 11 Apr 2001 14:19:50 +0200 (CEST), Marcin 'Qrczak' Kowalczyk pisze: > Is it important to keep the current definition of IArray and MArray > classes? I would like to change class operations, without changing > the interface, i.e. turn methods into ordinary overloaded functions > and have different methods. It would affect users making their own > instances of these classes, but not users of these instances. Too late to complain :-) I've done this. -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTĘPCZA QRCZAK From davidbak@cablespeed.com Sun Apr 15 18:42:13 2001 From: davidbak@cablespeed.com (David Bakin) Date: Sun, 15 Apr 2001 10:42:13 -0700 Subject: solved! Fw: win32 4.08.2 install question Message-ID: <001001c0c5d3$68217b90$5900a8c0@girlsprout> This is a multi-part message in MIME format. ------=_NextPart_000_000D_01C0C598.BB179680 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Found the problem in Sigbj=F8rn Finne's FAQ at = http://www.dcs.gla.ac.uk/~sof/ghc-win32-faq.html: I had no /bin, only a = /usr/bin. I've gotten hello world to compile so I'm off and running. If = 5.00 wasn't switching to a Haskell driver I'd suggest updating the GHC = installation on windows page with this FAQ. -- Dave $ mount Device Directory Type Flags c:\Cygwin\bin /bin user textmode c:\Cygwin\etc /etc user textmode c:\Cygwin\lib /usr/lib user textmode c: / user textmode ----- Original Message -----=20 From: David Bakin=20 To: glasgow-haskell-users@haskell.org=20 Sent: Sunday, April 15, 2001 12:47 AM Subject: win32 4.08.2 install question While waiting for 5.00 for win32 I thought I'd get started with 4.08.2 - = downloaded it today and installed it and the latest cygwin as per = instructions. However: When following the "test the fruits of your = labour" I invoke "ghc -o main main.hs" and get back a bash prompt and = that's all. No files created, e.g., no main. Same for "ghc -c = main.hs". Something trivial must be wrong with my setup. I've copied = the ghc/bin/perl to cygwin/bin. No spaces in any directories (ghc is = installed at c:\ghc). My mounted dirs look like this: C:\Cygwin\bin>mount Device Directory Type Flags c:\Cygwin\bin /usr/bin user textmode c:\Cygwin\etc /etc user textmode c:\Cygwin\lib /usr/lib user textmode c: / user textmode Anybody have an idea what's going on? I can't wait to get 5.00 and its = integral driver! -- Dave ------=_NextPart_000_000D_01C0C598.BB179680 Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
Found the problem in=20 Sigbj=F8rn Finne's FAQ at http://www.dcs.= gla.ac.uk/~sof/ghc-win32-faq.html: =20 I had no /bin, only a /usr/bin. I've gotten hello world to compile so = I'm off=20 and running.  If 5.00 wasn't switching to a Haskell driver=20 I'd suggest updating the GHC installation on windows page with this = FAQ.  -- Dave
 
$=20 mount
Device         &nbs= p;   =20 Directory          =20 Type        =20 Flags
c:\Cygwin\bin      =20 /bin           &nb= sp;   =20 user        =20 textmode
c:\Cygwin\etc      =20 /etc           &nb= sp;   =20 user        =20 textmode
c:\Cygwin\lib      =20 /usr/lib           = ;=20 user        =20 textmode
c:          = ;       =20 /            =       =20 user         = textmode
 
 
----- Original Message -----=20
From: David=20 Bakin
Sent: Sunday, April 15, 2001 12:47 AM
Subject: win32 4.08.2 install question

While waiting for 5.00 for = win32 I thought=20 I'd get started with 4.08.2 - downloaded it today and installed it and = the=20 latest cygwin as per instructions.  However:  When following = the "test=20 the fruits of your labour" I invoke "ghc -o main main.hs" and get back a = bash=20 prompt and that's all.  No files created, e.g., no main.  Same = for=20 "ghc -c main.hs".  Something trivial must be wrong with my = setup. =20 I've copied the ghc/bin/perl to cygwin/bin.  No spaces in any = directories=20 (ghc is installed at c:\ghc). My mounted dirs look like = this:
 
C:\Cygwin\bin>mount
Device     &n= bsp;       =20 Directory          =20 Type        =20 Flags
c:\Cygwin\bin      =20 /usr/bin           = ;=20 user        =20 textmode
c:\Cygwin\etc      =20 /etc           &nb= sp;   =20 user        =20 textmode
c:\Cygwin\lib      =20 /usr/lib           = ;=20 user        =20 textmode
c:          = ;       =20 /            =       =20 user         = textmode
 
Anybody have an idea what's = going on? =20 I can't wait to get 5.00 and its integral driver!
 
-- = Dave
------=_NextPart_000_000D_01C0C598.BB179680-- From chak@cse.unsw.edu.au Mon Apr 16 04:52:31 2001 From: chak@cse.unsw.edu.au (Manuel M. T. Chakravarty) Date: Mon, 16 Apr 2001 13:52:31 +1000 Subject: The (Interactive) Glasgow Haskell Compiler -- version 5.00 In-Reply-To: References: <68B95AA1648D1840AB0083CC63E57AD60EFC42@red-msg-06.redmond.corp.microsoft.com> <20010416001539X.chak@cse.unsw.edu.au> Message-ID: <20010416135231O.chak@cse.unsw.edu.au> qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) wrote, > Mon, 16 Apr 2001 00:15:39 +1000, Manuel M. T. Chakravarty pisze: > > > The source tar ball misses the configure scripts (it has the > > `configure.in's, but the source tar ball should be > > autoconf'ed, shouldn't it?) > > BTW, IMHO 'make maintainer-clean' should not delete configure scripts > (comments say that it doesn't, but it does). I agree. Manuel From chak@cse.unsw.edu.au Mon Apr 16 13:13:04 2001 From: chak@cse.unsw.edu.au (Manuel M. T. Chakravarty) Date: Mon, 16 Apr 2001 22:13:04 +1000 Subject: The (Interactive) Glasgow Haskell Compiler -- version 5.00 In-Reply-To: <68B95AA1648D1840AB0083CC63E57AD60EFC42@red-msg-06.redmond.corp.microsoft.com> References: <68B95AA1648D1840AB0083CC63E57AD60EFC42@red-msg-06.redmond.corp.microsoft.com> Message-ID: <20010416221304A.chak@cse.unsw.edu.au> "Julian Seward (Intl Vendor)" wrote, > [Binary builds for x86-linux and sparc-solaris are now > available. We're still working on the Windows version. -- J] > > > The (Interactive) Glasgow Haskell Compiler -- version 5.00 > ============================================================ RPM packages for x86 built on RedHat Linux 7.0/glibc 2.2 are now available at ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/i386/ghc-5.00-2.i386.rpm ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/i386/ghc-prof-5.00-2.i386.rpm with the source RPM at ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/src/ghc-5.00-2.src.rpm Manuel From mechvel@math.botik.ru Tue Apr 17 13:08:04 2001 From: mechvel@math.botik.ru (S.D.Mechveliani) Date: Tue, 17 Apr 2001 16:08:04 +0400 Subject: sgml Message-ID: Hello, I want to install GHC-5.00 (from binaries, on Linux). But the installation guide, as most documentation, is in the .sgml format. I can read ASCII, .dvi, .ps, .tex, html texts. But what to do with .sgml, please? ----------------- Serge Mechveliani mechvel@botik.ru From christian.lescher@icn.siemens.de Tue Apr 17 16:12:19 2001 From: christian.lescher@icn.siemens.de (Lescher Christian) Date: Tue, 17 Apr 2001 17:12:19 +0200 Subject: Haskell2Xml - Some questions Message-ID: <353063C297A9D3118F760008C791E26901F8655F@MCHH263E> Hi Malcom, While doing my first steps with Haskell2Xml, some more questions arose: - Is there any support for floating point numbers (e.g. Double)? - Is it possible to read/write XML data directly from/to strings = (instead of using readXml and writeXml)? This is especially interesting = when exposing Haskell functions within a Win DLL (and that's what I = want to do after all). - May I tell Haskell2Xml somehow to leave out the DTD output and write = only the "data contents"? Regards, Christian ----------------------------------------------------------------- Christian Lescher Siemens AG ICN WN CS PL T 1, Mch H/Ko 9, 5741/237 Hofmannstr. 51, 81359 M=FCnchen, Deutschland Tel. +49 (0) 89-722-47737 Fax: +49 (0) 89-722-35320 E-Mail: christian.lescher@icn.siemens.de ----------------------------------------------------------------- In case of tool problems please call our hotline +49 89 722 44444. From John.Velman@HSC.com Tue Apr 17 21:48:54 2001 From: John.Velman@HSC.com (John.Velman@HSC.com) Date: Tue, 17 Apr 2001 13:48:54 -0700 Subject: compiling ghc 5.0 with cygwin Message-ID: I am using Cygwin on an NT4SP5. I have a recent (i.e., up to date) installation of Cygwin (1.1.8-2). I installed ghc 4.08.2, and it seems to work. At least the simple "hello" works, and happy-1.9 seemed to compile and install with no problems. When I tried to compile ghc-5.00, my "make" run ends with the following error ______ ....tail of make output: ------------------------------------------------------------------------ ==fptools== make boot - --unix - --no-print-directory -r; in /home/newarchives/haskell/ghc5/ghc-5.00/ghc/utils/hsc2hs ------------------------------------------------------------------------ Creating Config.hs ... done. make INSTALLING=0 BIN_DIST=0 - --unix - --no-print-directory -r all /usr/local/bin/ghc -package util -O -c Config.hs -o Config.o -osuf o /usr/local/bin/ghc -package util -O -c KludgedSystem.hs -o KludgedSystem.o -o suf o /usr/local/bin/ghc -package util -O -c Main.hs -o Main.o -osuf o /usr/local/bin/ghc -o hsc2hs-bin -package util -O Config.o KludgedSystem.o Main.o V:/usr/local/lib/ghc/ghc-4.08.2/lib/libHSstd.a(Time.o)(.text+0x1c42c):ghc1360.c: undefined reference to `_imp___timezone_dll' collect2: ld returned 1 exit status make[4]: *** [hsc2hs-bin] Error 1 make[3]: *** [all] Error 2 make[2]: *** [boot] Error 1 make[1]: *** [boot] Error 1 make[1]: Leaving directory `/home/newarchives/haskell/ghc5/ghc-5.00/ghc' make: *** [all] Error 1 _______ Has anyone seen this before -- is it a cygwin bug or a ghc bug? Well, you know all the questions. I hope someone knows the answers! John Velman john.velman@hsc.com From chak@cse.unsw.edu.au Wed Apr 18 09:40:56 2001 From: chak@cse.unsw.edu.au (Manuel M. T. Chakravarty) Date: Wed, 18 Apr 2001 18:40:56 +1000 Subject: The (Interactive) Glasgow Haskell Compiler -- version 5.00 In-Reply-To: <20010416221304A.chak@cse.unsw.edu.au> References: <68B95AA1648D1840AB0083CC63E57AD60EFC42@red-msg-06.redmond.corp.microsoft.com> <20010416221304A.chak@cse.unsw.edu.au> Message-ID: <20010418184056T.chak@cse.unsw.edu.au> > > The (Interactive) Glasgow Haskell Compiler -- version 5.00 > > ============================================================ > > RPM packages for x86 built on RedHat Linux 7.0/glibc 2.2 are > now available at > > ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/i386/ghc-5.00-2.i386.rpm > ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/i386/ghc-prof-5.00-2.i386.rpm There are now also x86 RPMS for RedHat Linux 6.2 at ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/i386-rh6.2/ghc-5.00-2.i386.rpm ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/i386-rh6.2/ghc-prof-5.00-2.i386.rpm This build has been kindly contributed by Tom Moertel. Manuel From joe@isun.informatik.uni-leipzig.de Wed Apr 18 13:52:12 2001 From: joe@isun.informatik.uni-leipzig.de (Johannes Waldmann) Date: Wed, 18 Apr 2001 14:52:12 +0200 (MET DST) Subject: how to implement timeouts for IO operations? Message-ID: <200104181252.OAA25758@isun11.informatik.uni-leipzig.de> what is the Right Way to impose a timeout condition on IO actions? the GHC manual says ( http://www.haskell.org/ghc/docs/5.00/set/select.html ) "use threadDelay and asynchronous exceptions". When I do this: timed :: Int -> IO a -> IO a timed d action = do let timer = do threadDelay d throw $ AssertionFailed "timer expired" t <- forkIO timer x <- action killThread t return x it seems to work, but how do I turn off the "Fail: thread killed" messages? -- -- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ -- -- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 -- From christian.lescher@icn.siemens.de Wed Apr 18 17:02:16 2001 From: christian.lescher@icn.siemens.de (Lescher Christian) Date: Wed, 18 Apr 2001 18:02:16 +0200 Subject: AW: Haskell2Xml - Some questions Message-ID: <353063C297A9D3118F760008C791E26901F86563@MCHH263E> > > - Is there any support for floating point numbers (e.g. Double)? > > XML does not (as far as I know) have any built-in concept of floating > point numbers, so neither does HaXml. However, within HaXml you > have the full power of Haskell available to you, so if you wish to > read, write, or process Doubles from/to some string content (or element > attributes), you can probably code it yourself quite easily. > In case of Haskell2Xml, what about a conversion like this: Is this easy to implement? Regards, Christian From qrczak@knm.org.pl Wed Apr 18 18:34:16 2001 From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) Date: 18 Apr 2001 17:34:16 GMT Subject: how to implement timeouts for IO operations? References: <200104181252.OAA25758@isun11.informatik.uni-leipzig.de> Message-ID: Wed, 18 Apr 2001 14:52:12 +0200 (MET DST), Johannes Waldmann pisze: > it seems to work, but how do I turn off the "Fail: thread killed" messages? import Exception t <- block $ forkIO $ catchJust asyncExceptions (unblock timer) (\_ -> return ()) Perhaps the message about killing a thread will not appear in future versions of ghc. A discussion about it on this list stopped six weeks ago. -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTĘPCZA QRCZAK From joe@isun.informatik.uni-leipzig.de Wed Apr 18 20:36:04 2001 From: joe@isun.informatik.uni-leipzig.de (Johannes Waldmann) Date: Wed, 18 Apr 2001 21:36:04 +0200 (MET DST) Subject: how to implement timeouts for IO operations? In-Reply-To: from "Marcin 'Qrczak' Kowalczyk" at "Apr 18, 2001 05:34:16 pm" Message-ID: <200104181936.VAA02417@isun11.informatik.uni-leipzig.de> Thank you, Marcin. Your reply seems to imply that the structure of the program I posted was basically OK? A slightly related point, I was having difficulties with TimeDiff values - I got negative tdPicosecs sometimes, and some functions (show) even dumped core. Are such problems known (I am using a binary ghc-4.08)? For the moment, I switched to Posix.EpochTime. I found TimeDiff and ClockTime quite restrictive: they are not instances of Num, I can't add/subtract/negate TimeDiffs; and I cannot generate a zero ClockTime. (In my application, I need to simulate two clocks, where always one is running, the other one is stopped - as used in tournament Chess.) -- -- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ -- -- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 -- From michael.weber@post.rwth-aachen.de Wed Apr 18 21:08:42 2001 From: michael.weber@post.rwth-aachen.de (Michael Weber) Date: Wed, 18 Apr 2001 22:08:42 +0200 Subject: how to implement timeouts for IO operations? In-Reply-To: <200104181936.VAA02417@isun11.informatik.uni-leipzig.de>; from Johannes Waldmann on Wed, Apr 18, 2001 at 09:36:04PM +0200 References: <200104181936.VAA02417@isun11.informatik.uni-leipzig.de> Message-ID: <20010418220842.A5391@jennifer.informatik.rwth-aachen.de> On Wed, Apr 18, 2001 at 21:36:04 +0200, Johannes Waldmann wrote: > A slightly related point, I was having difficulties with TimeDiff > values - I got negative tdPicosecs sometimes, > and some functions (show) even dumped core. > > Are such problems known (I am using a binary ghc-4.08)? > For the moment, I switched to Posix.EpochTime. > > > I found TimeDiff and ClockTime quite restrictive: > they are not instances of Num, I can't add/subtract/negate TimeDiffs; > and I cannot generate a zero ClockTime. > (In my application, I need to simulate two clocks, > where always one is running, the other one is stopped - > as used in tournament Chess.) Despite my humble try, TimeDiff and ClockTime (Time.lhs) are still b0rked. Use on your own risk (and read the comments at the top). Sorry for that... Cheers, Michael From Tom.Pledger@peace.com Wed Apr 18 22:15:16 2001 From: Tom.Pledger@peace.com (Tom Pledger) Date: Thu, 19 Apr 2001 09:15:16 +1200 Subject: how to implement timeouts for IO operations? In-Reply-To: <200104181936.VAA02417@isun11.informatik.uni-leipzig.de> References: <200104181936.VAA02417@isun11.informatik.uni-leipzig.de> Message-ID: <15070.996.813990.13227@waytogo.peace.co.nz> Johannes Waldmann writes: | Thank you, Marcin. | | Your reply seems to imply that the structure | of the program I posted was basically OK? Another way appears as an example in Tackling The Awkward Squad (in the Using Asynchronous Exceptions section). It's a bit more liberal in its use of threads, doing forkIO twice within parIO, but the overall effect is pretty similar to your function's. timeout :: Int -> IO a -> IO (Maybe a) timeout n a = parIO (do { r <- a; return (Just r) }) (do { threadDelay n; return Nothing }) From andreas.siglreithmayr@sdm-research.de Thu Apr 19 09:20:42 2001 From: andreas.siglreithmayr@sdm-research.de (andreas.siglreithmayr@sdm-research.de) Date: Thu, 19 Apr 2001 10:20:42 +0200 Subject: Where can I get "Main.dll_o" and "PrelMain.dll_o"? Message-ID: I run ghc under cygwin WinNT. If I compile a simple HelloWorld program as described in the instalation descripton, I get the following error: $ ghc -o main main.hs gcc: D:/Unix/ghc/lib/Main.dll_o: No such file or directory gcc: D:/Unix/ghc/lib/PrelMain.dll_o: No such file or directory Do you know whats wrong? Or where can I get the files? -- Andreas Siglreithmayr mailto:Andreas.Siglreithmayr@sdm-research.de sd&m Research GmbH http://www.sdm.de Thomas-Dehler-Str. 18 , D-81737 Muenchen, Germany Tel +49 89 63812-917 Fax -150 From joe@isun.informatik.uni-leipzig.de Thu Apr 19 09:38:20 2001 From: joe@isun.informatik.uni-leipzig.de (Johannes Waldmann) Date: Thu, 19 Apr 2001 10:38:20 +0200 (MET DST) Subject: how to implement timeouts for IO operations? In-Reply-To: <15070.996.813990.13227@waytogo.peace.co.nz> from Tom Pledger at "Apr 19, 2001 09:15:16 am" Message-ID: <200104190838.KAA05321@isun11.informatik.uni-leipzig.de> > timeout n a = parIO (do { r <- a; return (Just r) }) > (do { threadDelay n; return Nothing }) oh, I this looks better (to me) since it doesn't use exceptions! does parIO kill the `other' thread? still I don't find parIO (in ghc-4.08), in what module is it? -- -- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ -- -- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 -- From joe@isun.informatik.uni-leipzig.de Thu Apr 19 10:08:14 2001 From: joe@isun.informatik.uni-leipzig.de (Johannes Waldmann) Date: Thu, 19 Apr 2001 11:08:14 +0200 (MET DST) Subject: how to implement timeouts for IO operations? In-Reply-To: <15070.996.813990.13227@waytogo.peace.co.nz> from Tom Pledger at "Apr 19, 2001 09:15:16 am" Message-ID: <200104190908.LAA05394@isun11.informatik.uni-leipzig.de> OK, I was being a bit stupid this morning. Now I see that `parIO' is not in the ghc libs, but programmed explicitely in the `Tackling the awkward sqaud' paper. http://research.microsoft.com/~simonpj/papers/marktoberdorf.htm -- -- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ -- -- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 -- From v-julsew@microsoft.com Fri Apr 20 10:30:02 2001 From: v-julsew@microsoft.com (Julian Seward (Intl Vendor)) Date: Fri, 20 Apr 2001 02:30:02 -0700 Subject: sgml Message-ID: <68B95AA1648D1840AB0083CC63E57AD60EFC58@red-msg-06.redmond.corp.microsoft.com> The documentation should be supplied in .html and .ps files, at least in the .tar.bz2 binary build I did, and, I presume in the RedHat 6.2/7.0 RPMs. Are you saying this is not the case? J | -----Original Message----- | From: S.D.Mechveliani [mailto:mechvel@math.botik.ru] | Sent: Tuesday, April 17, 2001 1:08 PM | To: glasgow-haskell-users@haskell.org | Subject: sgml |=20 |=20 | Hello, |=20 | I want to install GHC-5.00 (from binaries, on Linux).=20 | But the installation guide, as most documentation, is in the .sgml=20 | format. I can read ASCII, .dvi, .ps, .tex, html texts. | But what to do with .sgml, please? |=20 | ----------------- | Serge Mechveliani | mechvel@botik.ru |=20 | _______________________________________________ | Glasgow-haskell-users mailing list | Glasgow-haskell-users@haskell.org | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users |=20 From mechvel@math.botik.ru Fri Apr 20 12:49:20 2001 From: mechvel@math.botik.ru (S.D.Mechveliani) Date: Fri, 20 Apr 2001 15:49:20 +0400 Subject: no problem with .sgml Message-ID: I wrote recently | I want to install GHC-5.00 (from binaries, on Linux). | But the installation guide, as most documentation, is in the .sgml | format. I can read ASCII, .dvi, .ps, .tex, html texts. | But what to do with .sgml, please? Forget this question, please. Because I un-archivated the binaries and found there the needed docs on ghc in the needed formats. ----------------- Serge Mechveliani mechvel@botik.ru From christian@lescher.de Fri Apr 20 17:05:17 2001 From: christian@lescher.de (Christian Lescher) Date: Fri, 20 Apr 2001 18:05:17 +0200 Subject: GHC 5.0 - InstallShield for Windows? Message-ID: <3AE05E3D.85A9BD9C@lescher.de> When do you expect an InstallShield version of GHC 5.0 for Windows? Christian From rrt@dcs.gla.ac.uk Fri Apr 20 17:23:42 2001 From: rrt@dcs.gla.ac.uk (Reuben Thomas) Date: Fri, 20 Apr 2001 17:23:42 +0100 (BST) Subject: GHC 5.0 - InstallShield for Windows? In-Reply-To: <3AE05E3D.85A9BD9C@lescher.de> Message-ID: > When do you expect an InstallShield version of GHC 5.0 for Windows? We have to get the Windows linker working first. Given the current bugginess of 5.0, the likely answer is "not very soon". -- http://sc3d.org/rrt/ | Caution Children At Play Drive Slowly From matth@mindspring.com Sun Apr 22 14:45:45 2001 From: matth@mindspring.com (Matt Harden) Date: Sun, 22 Apr 2001 08:45:45 -0500 Subject: An attempt at foldr/build fusion for zip Message-ID: <3AE2E089.C82EA25D@mindspring.com> Hi, I think I may have found a way to get zip & friends to fuse with *both* of their input lists. I am not a heavy ghc hacker, though, so I may be missing something important that makes this unworkable. I have no idea what kind of code this would actually end up creating. Anyway, here's my attempt; it ties in with the current foldr2 scheme. I eagerly any await comments or questions, especially from the foldr/build gurus. -- foldr2_both.lhs: Attempting to fuse zip with both input lists. We seem to be forced to use a recursive datatype to accomplish this. We're using newtype, so there should be no overhead from construction/deconstruction of this type, right? \begin{code} newtype BuildZip a b = BZ ((a -> (BuildZip a b) -> b) -> b) bz :: (forall b. (a->b->b)->b->b) -> b -> BuildZip a b bz f n = f (\x xs -> BZ (\c -> c x xs)) (BZ (\_ -> n)) {-# INLINE bz #-} foldr2_both :: (a->b->c->c) -> BuildZip a c -> BuildZip b c -> c foldr2_both k (BZ xs) (BZ ys) = xs (\x xs' -> ys (\y ys' -> k x y (foldr2_both k xs' ys') ) ) {-# RULES "foldr2/both" forall k n (f::forall z.(a->z->z)->z->z) (g::forall z.(b->z->z)->z->z) . foldr2 k n (build f) (build g) = foldr2_both k (bz f n) (bz g n) #-} \end{code} -- END foldr2_both.lhs Best regards, Matt Harden From michaelw@debian.org Sun Apr 22 15:44:54 2001 From: michaelw@debian.org (Michael Weber) Date: Sun, 22 Apr 2001 16:44:54 +0200 Subject: The (Interactive) Glasgow Haskell Compiler -- version 5.00 In-Reply-To: <68B95AA1648D1840AB0083CC63E57AD60EFC42@red-msg-06.redmond.corp.microsoft.com>; from v-julsew@microsoft.com on Thu, Apr 12, 2001 at 05:17:50AM -0700 References: <68B95AA1648D1840AB0083CC63E57AD60EFC42@red-msg-06.redmond.corp.microsoft.com> Message-ID: <20010422164454.A1276@webnet.de> > The (Interactive) Glasgow Haskell Compiler -- version 5.00 > ============================================================ > > We are pleased to announce a new major release of the Glasgow Haskell > Compiler (GHC), version 5.00. The source distribution is freely > available via the World-Wide Web and through anon. FTP, under a > BSD-style license. See below for download details. Pre-built > packages for Linux, FreeBSD, Solaris and Win32 are also available. [...] Debian packages for GHC 5.00 are available for some days now in the 'unstable' distribution. They should have hit the mirrors already, so please choose the nearest one. More info on that below. Important Changes/Notes ======================= * It is possible now to install the new packages of ghc4 and ghc5 simultaneously. The system-wide default (/usr/bin/ghc) can be chosen via the 'alternatives' system. For more info on that, refer to the according docs[1]. * The ghc[45] and related packages are now dependent on libgmp3(-dev) instead of libgmp2(-dev). This is due to some forthcoming changes in Debian and because libgmp2 isn't maintained upstream for some time now. * Also, there are new packages for happy and c2hs available. happy is the latest CVS version, since 1.9 didn't play with ghc5 well. It should work with both ghc4 and ghc5 now. c2hs is compiled for ghc5, so it won't work with ghc4. If you are still dependent on ghc4&c2hs, you may want to recompile it yourself[2] and mark it as 'hold'. * As usual, the packages come with all sorts of documentation. They're viewable via the 'doc-base' infrastructure at http://localhost/doc/HTML/ (provided the 'dhelp' package and the usual WWW tools are installed) Along with other formats like PostScript/DVI, the HTML documentation also is browseable at: /usr/share/doc/ghc*/* [1] man update-alternatives [2] 1) make ghc4 the default compiler 2) install all build dependencies (with apt-get >= 0.5.3, you can achieve this with: ``apt-get build-dep c2hs'') 3) build the source: ``apt-get source --compile c2hs''. That should download the c2hs sources and produce packages suited for use with ghc4. Availability ============ Currently, the latest packages on the Debian servers are for 'unstable' (aka sid). They will hit the 'testing' distribution (aka woody) in about 10 days, provided no critical bugs pop up during that period. As a consequence, GHC is built against the latest libraries in 'unstable', including libc6 (>= 2.2.2-2). I am sorry, but at the moment I cannot make any promises about when packages for 'stable' (aka potato) will be available. However, a complete list of all mirrors is available from: http://www.debian.org/misc/README.mirrors You can use the package `netselect'[3] to determine the fastest of a list of servers. [3] http://packages.debian.org/stable/net/netselect.html APT lines: deb http://ftp.debian.org/debian/ unstable main contrib deb-src http://ftp.debian.org/debian/ unstable main contrib WWW: http://packages.debian.org/unstable/devel/ghc4.html http://packages.debian.org/unstable/devel/ghc5.html http://packages.debian.org/unstable/devel/happy.html http://packages.debian.org/unstable/devel/c2hs.html Name Version Description ============-====================-==================================================================================== ghc4 4.08.1-5 GHC - the Glasgow Haskell Compilation system ghc4-doc 4.08.1-5 Documentation for GHC - the Glasgow Haskell Compilation system ghc4-libsrc 4.08.1-5 Library Sources of GHC - the Glasgow Haskell Compilation system ghc4-prof 4.08.1-5 Profiling Libs for GHC - the Glasgow Haskell Compilation system ghc5 5.00-1 GHC - the Glasgow Haskell Compilation system ghc5-doc 5.00-1 Documentation for GHC - the Glasgow Haskell Compilation system ghc5-libsrc 5.00-1 Library Sources of GHC - the Glasgow Haskell Compilation system ghc5-prof 5.00-1 Profiling Libs for GHC - the Glasgow Haskell Compilation system c2hs 0.8.2-2 C->Haskell Interface Generator happy 1.9+1.10.20010417-1 The Parser generator for Haskell Cheers, Michael From rrt@dcs.gla.ac.uk Mon Apr 23 11:41:12 2001 From: rrt@dcs.gla.ac.uk (Reuben Thomas) Date: Mon, 23 Apr 2001 11:41:12 +0100 (BST) Subject: New InstallShield: Free At Last Message-ID: I've uploaded a new InstallShield for GHC 4.08.2 for Windows which includes *all* the programs required to use and even rebuild GHC from source [GHC developers should note that it doesn't include everything needed to build from CVS; see the most recent 5.00 docs in CVS for details]. This means that there's no longer any need to install Cygwin. Since GHC needs bash to work, and building it requires mv, rm and cp, plus many other basic utilities, you get a reasonably nice minimal command-line environment anyway; I've added ls to the mix for extra comfort. Although the InstallShield is now 20M, overall there's far less to download, and now GHC should break far less often. Another implication of this development is that the Windows version of 5.00 should now happen sooner rather than later. One caveat: the installation instructions on haskell.org are now somewhat out of date. I'll try to correct that soonish. -- http://sc3d.org/rrt/ | Si hoc legere scis nimium eruditionis habes. From simonmar@microsoft.com Mon Apr 23 14:56:02 2001 From: simonmar@microsoft.com (Simon Marlow) Date: Mon, 23 Apr 2001 14:56:02 +0100 Subject: Stack trace on error (and packages) Message-ID: <9584A4A864BD8548932F2F88EB30D1C60171F5DA@TVP-MSG-01.europe.corp.microsoft.com> > Also, less importantly, how do I generate packages? I have a bunch of > .o files (modules) all compiled using -package-name and -c,=20 > but I can't > find the correct ghc flag to link them into a library (.a/Linux). You use the usual 'ar' tool for making a .a library, something like: $ ar cru libfoo.a a.o b.o c.o To make this into a package, see the section on packages in the user's guide: http://www.haskell.org/ghc/docs/5.00/set/packages.html Cheers, Simon From simonmar@microsoft.com Mon Apr 23 15:00:08 2001 From: simonmar@microsoft.com (Simon Marlow) Date: Mon, 23 Apr 2001 15:00:08 +0100 Subject: The (Interactive) Glasgow Haskell Compiler -- version 5.00 Message-ID: <9584A4A864BD8548932F2F88EB30D1C60171F5DB@TVP-MSG-01.europe.corp.microsoft.com> > Mon, 16 Apr 2001 00:15:39 +1000, Manuel M. T. Chakravarty=20 > pisze: >=20 > > The source tar ball misses the configure scripts (it has the > > `configure.in's, but the source tar ball should be > > autoconf'ed, shouldn't it?) >=20 > BTW, IMHO 'make maintainer-clean' should not delete configure scripts > (comments say that it doesn't, but it does). I dunno. 'make distclean' leaves the configure scripts in place, 'make maintainer-clean' is supposed to get you back to a pristine tree as it would be if it were just checked out from CVS. Cheers, Simon From olaf@cs.york.ac.uk Mon Apr 23 14:57:50 2001 From: olaf@cs.york.ac.uk (Olaf Chitil) Date: Mon, 23 Apr 2001 14:57:50 +0100 Subject: An attempt at foldr/build fusion for zip References: <3AE2E089.C82EA25D@mindspring.com> Message-ID: <3AE434DE.82BB773B@cs.york.ac.uk> Hi Matt, > I think I may have found a way to get zip & friends to fuse with *both* > of their input lists. > ... > I have no idea > what kind of code this would actually end up creating. However, that is the important point. The goal of deforestation/fusion is to optimise a program. Removing data structures is not the final goal. In principal you can replace all algebraic data types by higher order functions (at least with the second order types that ghc allows). You just don't gain anything by doing it. I'm sorry that I don't have the time to look into your definition in detail. But basically you replace the intermediate list by higher order functions. Your foldr2_both does about the same amount of work as foldr2. Fusion of foldr2 with both arguments should give an expression without any recursively defined function (i.e. any foldr variant). Btw: The real benefit of deforestation does not come from saving the time for constructing and destructing the intermediate list. The real benefit comes from moving the code for the construction of an element next to the code for destructing the element which usally enables many further optimisations. A solution to the zip fusion problem is presented by John Launchbury, Sava Krstic, and Tim Sauerwein in: http://www.cse.ogi.edu/PacSoft/publications/phaseiiiq13papers/zipfusion.pdf I haven't yet looked into it in detail. Some problems with this approach are mentioned in the paper and I suppose they are the reason why the approach is not used in ghc. > \begin{code} > newtype BuildZip a b = BZ ((a -> (BuildZip a b) -> b) -> b) > > bz :: (forall b. (a->b->b)->b->b) -> b -> BuildZip a b > bz f n = f (\x xs -> BZ (\c -> c x xs)) (BZ (\_ -> n)) > {-# INLINE bz #-} > > foldr2_both :: (a->b->c->c) -> BuildZip a c -> BuildZip b c -> c > foldr2_both k (BZ xs) (BZ ys) = > xs (\x xs' -> > ys (\y ys' -> > k x y (foldr2_both k xs' ys') > ) ) > > {-# RULES > "foldr2/both" forall k n (f::forall z.(a->z->z)->z->z) > (g::forall z.(b->z->z)->z->z) . > foldr2 k n (build f) (build g) = > foldr2_both k (bz f n) (bz g n) > #-} > \end{code} Olaf -- OLAF CHITIL, Dept. of Computer Science, University of York, York YO10 5DD, UK. URL: http://www.cs.york.ac.uk/~olaf/ Tel: +44 1904 434756; Fax: +44 1904 432767 From simonmar@microsoft.com Mon Apr 23 15:36:09 2001 From: simonmar@microsoft.com (Simon Marlow) Date: Mon, 23 Apr 2001 15:36:09 +0100 Subject: how to implement timeouts for IO operations? Message-ID: <9584A4A864BD8548932F2F88EB30D1C6115849@TVP-MSG-01.europe.corp.microsoft.com> The correct way to implement timeout in GHC 5.00 is below. This should really be in a library somewhere. This implementation works for GHC's current "blocking" semantics for throwTo, but if we change the semantics of throwTo to match the asynchronous exceptions paper (http://www.haskell.org/~simonmar/papers/async.ps.gz) then a different implementation of timeout will be needed. Cheers, Simon ------------------------------------------------------------------------ ----- import Dynamic import Unique import Exception import Concurrent data TimeOut =3D TimeOut Unique timeOutTc =3D mkTyCon "TimeOut"; instance Typeable TimeOut where { typeOf _ =3D mkAppTy timeOutTc [] } timeout secs on_timeout action =3D do { parent <- myThreadId; i <- newUnique; block (do timeout <- forkIO (timeout_thread secs parent i); Exception.catchDyn ( unblock ( do { result <- action; killThread timeout; return result; } ) ) ( \exception ->=20 case exception of TimeOut u | u =3D=3D i -> unblock on_timeout other -> do {=20 killThread timeout; throwDyn exception=20 } ) ) } timeout_thread secs parent i =3D do {=20 threadDelay (secs * 1000000); throwTo parent (DynException (toDyn (TimeOut i))) } From qrczak@knm.org.pl Mon Apr 23 16:30:05 2001 From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) Date: 23 Apr 2001 15:30:05 GMT Subject: An attempt at foldr/build fusion for zip References: <3AE2E089.C82EA25D@mindspring.com> Message-ID: Sun, 22 Apr 2001 08:45:45 -0500, Matt Harden pisze: > I think I may have found a way to get zip & friends to fuse with *both* > of their input lists. I tried to put in PrelList, changed foldr2_both to use a local recursive function which doesn't pass k around which allows to inline k, and a test shows that it's unfortunately slightly slower than the original. -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTĘPCZA QRCZAK From qrczak@knm.org.pl Mon Apr 23 16:42:36 2001 From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) Date: 23 Apr 2001 15:42:36 GMT Subject: how to implement timeouts for IO operations? References: <9584A4A864BD8548932F2F88EB30D1C6115849@TVP-MSG-01.europe.corp.microsoft.com> Message-ID: Mon, 23 Apr 2001 15:36:09 +0100, Simon Marlow pisze: > The correct way to implement timeout in GHC 5.00 is below. This should > really be in a library somewhere. IMHO "unique exceptions" should be factored out and available in a standalone way. -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTĘPCZA QRCZAK From John.Velman@HSC.com Mon Apr 23 17:00:54 2001 From: John.Velman@HSC.com (John.Velman@HSC.com) Date: Mon, 23 Apr 2001 09:00:54 -0700 Subject: New InstallShield: Free At Last Message-ID: This sounds good. One question: Can this live gracefully with an already complete Cygwin installation? I.e., will I automatically end up with two versions of bash, mv, cp, and so on, and can they live together? Thanks, John Velman Reuben Thomas @haskell.org on 04/23/2001 03:41:12 AM Sent by: glasgow-haskell-users-admin@haskell.org To: GHC users mailing list cc: Subject: New InstallShield: Free At Last I've uploaded a new InstallShield for GHC 4.08.2 for Windows which includes *all* the programs required to use and even rebuild GHC from source [GHC developers should note that it doesn't include everything needed to build from CVS; see the most recent 5.00 docs in CVS for details]. This means that there's no longer any need to install Cygwin. Since GHC needs bash to work, and building it requires mv, rm and cp, plus many other basic utilities, you get a reasonably nice minimal command-line environment anyway; I've added ls to the mix for extra comfort. Although the InstallShield is now 20M, overall there's far less to download, and now GHC should break far less often. Another implication of this development is that the Windows version of 5.00 should now happen sooner rather than later. One caveat: the installation instructions on haskell.org are now somewhat out of date. I'll try to correct that soonish. -- http://sc3d.org/rrt/ | Si hoc legere scis nimium eruditionis habes. _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users From michael.weber@post.rwth-aachen.de Mon Apr 23 17:31:44 2001 From: michael.weber@post.rwth-aachen.de (Michael Weber) Date: Mon, 23 Apr 2001 18:31:44 +0200 Subject: make maintainer-clean (was: Re: The (Interactive) Glasgow Haskell Compiler -- version 5.00) Message-ID: <20010423183144.G25738@jennifer.informatik.rwth-aachen.de> On Mon, Apr 23, 2001 at 15:00:08 +0100, Simon Marlow wrote: > > Mon, 16 Apr 2001 00:15:39 +1000, Manuel M. T. Chakravarty > > pisze: > > > > > The source tar ball misses the configure scripts (it has the > > > `configure.in's, but the source tar ball should be > > > autoconf'ed, shouldn't it?) > > > > BTW, IMHO 'make maintainer-clean' should not delete configure scripts > > (comments say that it doesn't, but it does). > > I dunno. 'make distclean' leaves the configure scripts in place, 'make > maintainer-clean' is supposed to get you back to a pristine tree as it > would be if it were just checked out from CVS. erm, not that I say, sticking to the standards is mandatory, but... ;) $ info standards 'Managing Releases' 'Makefile Conventions' 'Standard Targets' [...] The reason we say "almost everything" is that running the command `make maintainer-clean' should not delete `configure' even if `configure' can be remade using a rule in the Makefile. More generally, `make maintainer-clean' should not delete anything that needs to exist in order to run `configure' and then begin to build the program. This is the only exception; `maintainer-clean' should delete everything else that can be rebuilt. [...] There should be an additional target, e.g. "make cvs-clean", or similar. Cheers, Michael -- /~\ ASCII ribbon | "I would rather spend 10 hours reading someone else's \ / campaign | source code than 10 minutes listening to Musak waiting X against | for technical support which isn't." / \ HTML mail | -- Dr. Greg Wettstein, Roger Maris Cancer Center From v-julsew@microsoft.com Fri Apr 20 10:27:26 2001 From: v-julsew@microsoft.com (Julian Seward (Intl Vendor)) Date: Fri, 20 Apr 2001 02:27:26 -0700 Subject: The (Interactive) Glasgow Haskell Compiler -- version 5.00 Message-ID: <68B95AA1648D1840AB0083CC63E57AD60EFC57@red-msg-06.redmond.corp.microsoft.com> Thanks, Tom & Manuel. I've put them on the web page. | There are now also x86 RPMS for RedHat Linux 6.2 at |=20 | =20 | ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/i386-rh6.2/ | ghc-5.00-2.i386.rpm | =20 | ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/i386-rh6.2/ | ghc-prof-5.00-2.i386.rpm |=20 | This build has been kindly contributed by Tom Moertel. |=20 | Manuel |=20 From mechvel@math.botik.ru Tue Apr 24 09:13:22 2001 From: mechvel@math.botik.ru (S.D.Mechveliani) Date: Tue, 24 Apr 2001 12:13:22 +0400 Subject: -optCrts-M28m Message-ID: Could ghc-5.00 explain, please, some changes in the compiler and RTS options? 1. -hi-diffs worked in ghc-4.08 and now does not. 2. I applied -optCrts-G3 -optCrts-F1.5 -optCrts-M28m to compile certain large module on 32Mb RAM machine. Now, what to apply for this with ghc-5.00 ? Thank you in advance for the help. ----------------- Serge Mechveliani mechvel@botik.ru From ger@tzi.de Tue Apr 24 10:57:07 2001 From: ger@tzi.de (George Russell) Date: Tue, 24 Apr 2001 11:57:07 +0200 Subject: Why does --make only allow one module? Message-ID: <3AE54DF3.4882B033@tzi.de> ghc --make would be wonderful for UniForM, which at the moment consists of a large selection of libraries, were it not for the restriction that ghc --make insists on only having one module as an argument. Er why? At this rate I shall be driven to writing an otherwise useless module which imports all the modules in each directory, since ghc --make does indeed look a lot faster than compiling each module individually. (In particular, we win big here, I think because the NFS system is very inefficient and makes reading all the .hi files very expensive.) Actually I'd like to just give ghc --make a list of ALL the source files and let it figure out the dependencies. This could also include object files (compiled from C) which were to be linked in, for example. From stolz@I2.Informatik.RWTH-Aachen.DE Tue Apr 24 15:19:21 2001 From: stolz@I2.Informatik.RWTH-Aachen.DE (Volker Stolz) Date: Tue, 24 Apr 2001 16:19:21 +0200 Subject: [ghci] Comparison with Hugs Message-ID: <20010424161921.O18793@i2.informatik.rwth-aachen.de> In Hugs I can throw some definitions into a file and load it on the shell command line or using ":l" in Hugs. ghci however will complain that "main" is missing and even won't keep the defined functions in scope. Is there anything I can do about that? It even doesn't invoke main if it's present. I could hack ghci do add "main = print 1" in case main is undefined, but that's not really something I'd like to admit afterwards... -- Abstrakte Syntaxträume. Volker Stolz * stolz@i2.informatik.rwth-aachen.de * PGP + S/MIME From qrczak@knm.org.pl Tue Apr 24 16:07:50 2001 From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) Date: 24 Apr 2001 15:07:50 GMT Subject: [ghci] Comparison with Hugs References: <20010424161921.O18793@i2.informatik.rwth-aachen.de> Message-ID: Tue, 24 Apr 2001 16:19:21 +0200, Volker Stolz pisze: > ghci however will complain that "main" is missing and even won't keep > the defined functions in scope. Is there anything I can do about that? Add 'module Foo where' at the top of the file (preferably with the module name matching the filename). -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTĘPCZA QRCZAK From v-julsew@microsoft.com Tue Apr 24 11:24:06 2001 From: v-julsew@microsoft.com (Julian Seward (Intl Vendor)) Date: Tue, 24 Apr 2001 03:24:06 -0700 Subject: -optCrts-M28m Message-ID: <68B95AA1648D1840AB0083CC63E57AD60EFC71@red-msg-06.redmond.corp.microsoft.com> | 2. I applied -optCrts-G3 -optCrts-F1.5 -optCrts-M28m |=20 | to compile certain large module on 32Mb RAM machine. | Now, what to apply for this with ghc-5.00 ? +RTS -G3 -F1.5 -M28m -RTS J From vkoch@nvsmedia.com Tue Apr 24 22:18:00 2001 From: vkoch@nvsmedia.com (vince koch) Date: Tue, 24 Apr 2001 17:18:00 -0400 Subject: HINSTANCE from main() Message-ID: <3AE5ED88.4F3639D5@nvsmedia.com> Axel - While browising FAQs and message boards I found a question you had posted a few months ago. I decided to write you in case you had not learned the answer yet. (I remember this answer was pretty tough to find when I needed it!) =========================================================================== Hi all, I tried to write a Win32 program in with GHC 4.05 but I am stumbeling over the definition type WNDCLASS = (ClassStyle, -- style HINSTANCE, -- hInstance MbHICON, -- hIcon MbHCURSOR, -- hCursor MbHBRUSH, -- hbrBackground MbLPCSTR, -- lpszMenuName ClassName) -- lpszClassName which looks fine if I'd knew where to get hInstance. main doesn't give it to me. Can specify something like winMain hInstance ... = as my main program entry? Or a more sensible question: Is there any userguide on how to use the Win32 library? Cheers, Axel. =========================================================================== You can get a handle to the current instance of your app in one of 2 ways that I am aware of... 1) You can replace your main() with WinMain (defined below) in which case windows will pass you the instance, and you can either pass it into other functions or use it directly int WINAPI WinMain( HINSTANCE hInstance, // handle to current instance HINSTANCE hPrevInstance, // handle to previous instance LPSTR lpCmdLine, // pointer to command line int nCmdShow // show state of window ); OR 2) you can call GetModuleHandle (defined below) and pass in NULL for the lpModuleName and cast the resulting HMODULE into a HINSTANCE as shown below HMODULE GetModuleHandle( LPCTSTR lpModuleName // address of module name to return handle for ); To Use: HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(NULL); Good luck! Vince From mechvel@math.botik.ru Wed Apr 25 06:10:14 2001 From: mechvel@math.botik.ru (S.D.Mechveliani) Date: Wed, 25 Apr 2001 09:10:14 +0400 Subject: -make Message-ID: Hello, I have two questions on ghc-5.00 -make. The User's Guide says in Section 4.5 that it is simpler to use -make than the Makefile technique. 1. I try ghc -make Main.hs with Main.hs containing main = putStr "hello\n" (in ghc-5.00, binary, i386-unknown, Linux), and it reports ghc-5.00: unrecognised flag: -make - ? 2. How to simplify (eliminate?) Makefile. ----------------------------------------- My project has many .hs files in the directories ./source/ ./source/auxil/ ./source/pol/factor/ ... `make ...' compiles them putting .hi, .o files into ./export/, then, applies `ar' to make .a library. To do all this, Makefile includes the rules like .hs.o: $(HC) -c $< $(HCFlags) and applies the compiler $(HC) with the flags ... -syslib data -recomp ... -i$(E) -odir $(E) -ohi $(E)/$(notdir $*).hi $($*_flags) ... Now, this Makefile does not work under ghc-5.00, because second compilation cannot find .hi file of the first compilation: ..ghc -c source/auxil/Prelude_.hs -fglasgow-exts ... -recomp -iexport -odir export -ohi export/Prelude_.hi +RTS -G3 -F1.5 -M29m -RTS -Onot ... ..ghc -c source/parse/Iparse_.hs -fglasgow-exts ... -recomp -iexport -odir export -ohi export/Iparse_.hi +RTS -G3 -F1.5 -M29m -RTS -Onot source/parse/Iparse_.hs:20: failed to load interface for `Prelude_': Bad interface file: export/Iparse_.hi does not exist Also what -make can do to replace some large part of Makefile. For (a) Makefile has rather odd language, it is not good to force the functional programmer to look into it, (b) one has to think of Makefile versions for different operation systems. Thank you in advance for the help. ----------------- Serge Mechveliani mechvel@botik.ru From simonmar@microsoft.com Wed Apr 25 11:04:06 2001 From: simonmar@microsoft.com (Simon Marlow) Date: Wed, 25 Apr 2001 11:04:06 +0100 Subject: make maintainer-clean (was: Re: The (Interactive) Glasgow Haskell Compiler -- version 5.00) Message-ID: <9584A4A864BD8548932F2F88EB30D1C60171F605@TVP-MSG-01.europe.corp.microsoft.com> > erm, not that I say, sticking to the standards is mandatory, but... ;) >=20 > $ info standards 'Managing Releases' 'Makefile Conventions'=20 > 'Standard Targets' > [...] > The reason we say "almost everything" is that running the command > `make maintainer-clean' should not delete `configure' even if > `configure' can be remade using a rule in the Makefile. More > generally, `make maintainer-clean' should not delete=20 > anything that > needs to exist in order to run `configure' and then=20 > begin to build > the program. This is the only exception;=20 > `maintainer-clean' should > delete everything else that can be rebuilt. > [...] >=20 >=20 > There should be an additional target, e.g. "make cvs-clean", or > similar. Oh blimey. Ok, I'll make it not delete configure. Cheers, Simon From simonmar@microsoft.com Wed Apr 25 11:09:00 2001 From: simonmar@microsoft.com (Simon Marlow) Date: Wed, 25 Apr 2001 11:09:00 +0100 Subject: Why does --make only allow one module? Message-ID: <9584A4A864BD8548932F2F88EB30D1C60171F607@TVP-MSG-01.europe.corp.microsoft.com> > ghc --make would be wonderful for UniForM, which at the=20 > moment consists of > a large selection of libraries, were it not for the restriction that > ghc --make insists on only having one module as an argument. Er why? > At this rate I shall be driven to writing an otherwise useless module > which imports all the modules in each directory, since ghc --make does > indeed look a lot faster than compiling each module individually. > (In particular, we win big here, I think because the NFS system is > very inefficient and makes reading all the .hi files very expensive.) >=20 > Actually I'd like to just give ghc --make a list of ALL the=20 > source files > and let it figure out the dependencies. This could also include > object files (compiled from C) which were to be linked in,=20 > for example. It's something we'd like to do, but haven't got around to yet. Perhaps for 5.01. Cheers, Simon From simonmar@microsoft.com Wed Apr 25 11:28:17 2001 From: simonmar@microsoft.com (Simon Marlow) Date: Wed, 25 Apr 2001 11:28:17 +0100 Subject: -make Message-ID: <9584A4A864BD8548932F2F88EB30D1C6115852@TVP-MSG-01.europe.corp.microsoft.com> > I have two questions on ghc-5.00 -make. >=20 > The User's Guide says in Section 4.5 that it is simpler to use=20 > -make than the Makefile technique.=20 >=20 > 1. I try ghc -make Main.hs > =20 > with Main.hs containing main =3D putStr "hello\n" >=20 > (in ghc-5.00, binary, i386-unknown, Linux), =20 > and it reports > ghc-5.00: unrecognised flag: -make > - ? =20 The flag is actually '--make' (note the double dash). Apparently the documentation system has some problems rendering the double dash in printed mode. > 2. How to simplify (eliminate?) Makefile. > ----------------------------------------- >=20 > My project has many .hs files in the directories =20 > ./source/ > ./source/auxil/ > ./source/pol/factor/ > ... > `make ...' compiles them putting .hi, .o files into ./export/, > then, applies `ar' to make .a library. > To do all this, Makefile includes the rules like=20 >=20 > .hs.o: > $(HC) -c $< $(HCFlags) > =20 > and applies the compiler $(HC) with the flags >=20 > ... -syslib data -recomp ... > -i$(E) -odir $(E) -ohi $(E)/$(notdir $*).hi $($*_flags) > ... > Now, this Makefile does not work under ghc-5.00, because second > compilation cannot find .hi file of the first compilation: >=20 > ..ghc -c source/auxil/Prelude_.hs -fglasgow-exts ... > -recomp -iexport -odir export -ohi export/Prelude_.hi =20 > +RTS -G3 -F1.5 -M29m -RTS -Onot > ... > ..ghc -c source/parse/Iparse_.hs -fglasgow-exts ... > -recomp -iexport -odir export -ohi export/Iparse_.hi=20 > +RTS -G3 -F1.5 -M29m -RTS -Onot >=20 > source/parse/Iparse_.hs:20: > failed to load interface for `Prelude_': > Bad interface file: export/Iparse_.hi > does not exist This is indeed a bug: -ohi doesn't work properly in 5.00. I'm fixing it right now. > Also what -make can do to replace some large part of Makefile. > For=20 > (a) Makefile has rather odd language, it is not good to force the > functional programmer to look into it, > (b) one has to think of Makefile versions for different operation=20 > systems. The simplest way to work is to put the objects and .hi files in the same directory as the source. Then you can use --make like this: $ ghc --make -i::... Main to put the objects in a single directory, you can use -odir . Unfortunately the .hi files can't be saved elsewhere when using --make. Cheers, Simon From simonmar@microsoft.com Wed Apr 25 11:07:56 2001 From: simonmar@microsoft.com (Simon Marlow) Date: Wed, 25 Apr 2001 11:07:56 +0100 Subject: -optCrts-M28m Message-ID: <9584A4A864BD8548932F2F88EB30D1C60171F606@TVP-MSG-01.europe.corp.microsoft.com> > Could ghc-5.00 explain, please, some changes in the compiler and > RTS options? >=20 > 1. -hi-diffs worked in ghc-4.08 and now does not. It's now called -ddump-hi-diffs. Cheers, Simon From khchoi@ruby.kaist.ac.kr Wed Apr 25 14:13:25 2001 From: khchoi@ruby.kaist.ac.kr (Kwanghoon Choi) Date: Wed, 25 Apr 2001 22:13:25 +0900 (KST) Subject: haskell.runtime.* ?? Message-ID: Hello, I managed to restore an option for GHC 5.00 to produce java output but I realized that I also need some runtime system to run the java program produced by GHC. I examined the GHC source tree and the GHC website but in vain. Where do I get the runtime system? Thanks in advance. Kwanghoon From mechvel@math.botik.ru Thu Apr 26 05:42:00 2001 From: mechvel@math.botik.ru (S.D.Mechveliani) Date: Thu, 26 Apr 2001 08:42:00 +0400 Subject: memory in --make Message-ID: Hello, It occurs that ghc-5.00 --make spends the memory in a particular way. Making my project via Makefile (envoking ghc driver many times) succeeds within -M29m. While ghc --make ... -Mxxx Mk.hs needs more than 50Mb, probably, because it keeps much intermediate information between compiling the modules. Still I managed to `make' it with -M29m by issueing the latter command two times more, after the insufficient-heap break. ghc --make still looks faster and better to arrange. Each time it compiles only remainging modules. Maybe, something can be done to avoid these heap-exhausted breaks? For, seeing that some modules remain to compile and heap is exhausted, ghc can save the intermediate information to disk giving the room for the next module compilation. Also it can restart the driver itself - with appropriate message - ? ----------------- Serge Mechveliani mechvel@botik.ru From mechvel@math.botik.ru Thu Apr 26 06:42:52 2001 From: mechvel@math.botik.ru (S.D.Mechveliani) Date: Thu, 26 Apr 2001 09:42:52 +0400 Subject: :! ghc -c vs :c Message-ID: The ghc interactive ghci compiles the module by the command :! ghc -c Has it sense to provide a command :compile (:c), having a meaningful name and a format similar to other commands, like say :load ? ----------------- Serge Mechveliani mechvel@botik.ru From mechvel@math.botik.ru Thu Apr 26 08:58:45 2001 From: mechvel@math.botik.ru (S.D.Mechveliani) Date: Thu, 26 Apr 2001 11:58:45 +0400 Subject: :l XX libFoo.a Message-ID: The :load command of the ghc-5.00 interpreter first searches the needed compiled modules (*.o) and loads them when finds. But how to make it to search them in the object code library xxx/libFoo.a ? For it is better to keep the fixed *.o files in a library. And `:load' works in the above situation similarly as ghc -o XX.o ... I tried :l XX libFoo.a, but it does not work. ----------------- Serge Mechveliani mechvel@botik.ru From wbuss@telda.net Thu Apr 26 09:21:29 2001 From: wbuss@telda.net (Wolfhard =?iso-8859-1?q?Bu=DF?=) Date: 26 Apr 2001 10:21:29 +0200 Subject: Building nhc98-1.02 with ghc-5.00 Message-ID: Hello, the building of nhc98-1.02 with ghc-5.00 aborts with the message: Main.hs:8: Failed to find interface decl for `PrelGHC.(#,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,#)' from module `PrelGHC' Any hints for interpretation? Kind regards, Wolfhard. From simonmar@microsoft.com Thu Apr 26 09:49:00 2001 From: simonmar@microsoft.com (Simon Marlow) Date: Thu, 26 Apr 2001 09:49:00 +0100 Subject: :! ghc -c vs :c Message-ID: <9584A4A864BD8548932F2F88EB30D1C60171F612@TVP-MSG-01.europe.corp.microsoft.com> > The ghc interactive ghci compiles the module by the command > =20 > :! ghc -c=20 >=20 > Has it sense to provide a command :compile (:c), >=20 > having a meaningful name and a format similar to other commands, > like say :load > ? Yes, this is another thing we'd like to do, but haven't got around to yet. (you can always define your own :compile command using :def of course, but the benefit of a built-in one would be that it could take advantage of the in-memroy interfaces rather than reading them from the disk). Cheers, Simon From simonmar@microsoft.com Thu Apr 26 09:55:42 2001 From: simonmar@microsoft.com (Simon Marlow) Date: Thu, 26 Apr 2001 09:55:42 +0100 Subject: :l XX libFoo.a Message-ID: <9584A4A864BD8548932F2F88EB30D1C6115856@TVP-MSG-01.europe.corp.microsoft.com> > The :load command of the ghc-5.00 interpreter=20 > first searches the needed compiled modules (*.o) and loads them > when finds. > But how to make it to search them in the object code library =20 > xxx/libFoo.a ? =20 > For it is better to keep the fixed *.o files in a library. > And `:load' works in the above situation similarly as =20 > ghc -o XX.o ... > I tried :l XX libFoo.a, > but it does not work. GHCi can't load ordinary .a libraries, only .o/.so objects. However, you can make a .o from a .a using something like $ ld --whole-archive -o Foo.o -lFoo Perhaps we'll have a way to make this slightly less painful in the future. Cheers, Simon From qrczak@knm.org.pl Thu Apr 26 11:44:53 2001 From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) Date: Thu, 26 Apr 2001 12:44:53 +0200 (CEST) Subject: :! ghc -c vs :c In-Reply-To: <9584A4A864BD8548932F2F88EB30D1C60171F612@TVP-MSG-01.europe.corp.microsoft.com> Message-ID: On Thu, 26 Apr 2001, Simon Marlow wrote: > Yes, this is another thing we'd like to do, but haven't got around to > yet. (you can always define your own :compile command using :def of > course, but the benefit of a built-in one would be that it could take > advantage of the in-memroy interfaces rather than reading them from the > disk). IMHO to make compilation in ghci convenient the set of visible names from compiled modules should not differ that much from names visible from interpreted modules. It's not nice that even Prelude names are not in scope when the main module is compiled. Especially if :c without parameters compiled the main module by default. I understand that there are technical difficulties of inavailability of the source context inside compiled modules. One can emulate a better behavior by writing a module consisting of appropriate imports, so why ghci can't do that for me? Let's try to see how it could look like. Unqualified names in scope are drawn from three sources: 1. Names exported by a set of modules chosen by the user. Modules can be individually added to and removed from this set. Probably the full power of imports should be supported: :import Module :import Module (foo, bar) :import Module hiding (bar, baz) :import Module as M -- Perhaps not needed because qualified names -- are managed in a different way. Mentioning the same module twice combines the two effects, as for imports in the source. Prelude is implicitly in this set except if it is included explicitly, as for imports in the source. There is also :unimport Module and a way to display the active imports. 2. All top level definitions and things imported by a chosen source module (i.e. names available inside it), if one is chosen; it must be possible to forget it. When the user chooses a module for which both the source and *.o is available, the module is interpreted. It's impossible to choose a module without the source. Although it would make sense to allow more than one module available this way, it should probably be simplified to be at most one, i.e. choosing some forgets the previous one. Using unqualified ambiguous names coming from combined 1. and 2. is an error. Note that the module in 2. needs not to be present in the set of 1. Particularly when the chosen module reexports some variables qualified and doesn't have them available unqualified, they are not available. 3. Variables bound interactively. I'm not sure when they should be forgotten. If choosing another module in 2. must forget them due to some technical reasons, then ok, but I would prefer to forget them explicitly (not necessarily individually). These definitions cover other things with the same names, as if we were inside a 'do' block. -- Marcin 'Qrczak' Kowalczyk From olaf@cs.york.ac.uk Thu Apr 26 16:07:14 2001 From: olaf@cs.york.ac.uk (Olaf Chitil) Date: Thu, 26 Apr 2001 16:07:14 +0100 Subject: Building nhc98-1.02 with ghc-5.00 References: Message-ID: <3AE839A2.5B1BE6B0@cs.york.ac.uk> > the building of nhc98-1.02 with ghc-5.00 aborts > with the message: > > Main.hs:8: > Failed to find interface decl for `PrelGHC.(#,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,#)' > from module `PrelGHC' > > Any hints for interpretation? I suspect that is because nhc98 defines a data type with a single constructor that has about 75 arguments. (It is to hold all compiler flags and it is actually a record.) It seems that the new ghc-5.00 tries to implement that data type internally in terms of an unboxed tuple. However, ghc-5.00 doesn't implement unboxed tuples of that size. So, ghc guys, does that mean that ghc-5.00 cannot handle any data constructors with many arguments? ghc-4.08 and all other Haskell systems certainly can handle such data constructors ;-) Cherio, Olaf -- OLAF CHITIL, Dept. of Computer Science, University of York, York YO10 5DD, UK. URL: http://www.cs.york.ac.uk/~olaf/ Tel: +44 1904 434756; Fax: +44 1904 432767 From mechvel@math.botik.ru Fri Apr 27 10:09:09 2001 From: mechvel@math.botik.ru (S.D.Mechveliani) Date: Fri, 27 Apr 2001 13:09:09 +0400 Subject: memory map in ghci Message-ID: Dear GHC-5.00, I cannot find where it is explained the memory distribution used by ghci. For example, after ghci +RTS -M16m -RTS ... Prelude> :l XX ... (YY.o loaded ...) ... (XX interpreted ...) do YY.o, XX take any of these 16Mb ? Are there any commands in ghci to get the memory map? It is something like space taken by loaded compiled programs, interpreted programs, by data, free space for program, free space for data, space for stack. Is the interpreted program treated as data? ----------------- Serge Mechveliani mechvel@botik.ru From simonmar@microsoft.com Fri Apr 27 10:19:03 2001 From: simonmar@microsoft.com (Simon Marlow) Date: Fri, 27 Apr 2001 10:19:03 +0100 Subject: Building nhc98-1.02 with ghc-5.00 Message-ID: <9584A4A864BD8548932F2F88EB30D1C60171F61B@TVP-MSG-01.europe.corp.microsoft.com> > the building of nhc98-1.02 with ghc-5.00 aborts > with the message: >=20 > Main.hs:8: > Failed to find interface decl for=20 > `PrelGHC.(#,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, > ,,,,,,,,,,,,,,,,,,,,,,,#)' > from module `PrelGHC' >=20 > Any hints for interpretation? Workaround: compile this particular module without -O, or with -fno-cpr. Cheers, Simon From mechvel@math.botik.ru Fri Apr 27 11:26:17 2001 From: mechvel@math.botik.ru (S.D.Mechveliani) Date: Fri, 27 Apr 2001 14:26:17 +0400 Subject: heap and code in ghci Message-ID: To my request >> I cannot find where it is explained the memory distribution used by >> ghci. >> [..] Simon Marlow writes > Interpreted code lives in the heap, and is garbage collected as normal. > Object code is loaded outside the heap. It takes up real memory > in the process, because the data has to be relocated when it is > loaded. > [..] Let, for example, all the .o modules were prepared, and we command ghci ... +RTS -Mxxm -RTS ... Loading package std ... linking ... done. Prelude> :l BPrelude ... and then try to find sum [1..n]. In my experiment xx = 7 does not allow to load the program, 8, sum [1..66000] yields "Heap exhausted", 10, sum [1..77000] yields 2964538500. Probably, this xx Mb is for binary program + heap. ghci loads .o modules, they take some part of xx, and all the rest is for the heap. Right? Thank you in advance for the explanation. ----------------- Serge Mechveliani mechvel@botik.ru From simonmar@microsoft.com Fri Apr 27 10:17:05 2001 From: simonmar@microsoft.com (Simon Marlow) Date: Fri, 27 Apr 2001 10:17:05 +0100 Subject: memory map in ghci Message-ID: <9584A4A864BD8548932F2F88EB30D1C60171F61A@TVP-MSG-01.europe.corp.microsoft.com> > I cannot find where it is explained the memory distribution used by > ghci. > For example, after ghci +RTS -M16m -RTS > ... > Prelude> :l XX > ... (YY.o loaded ...) > ... (XX interpreted ...) >=20 > do YY.o, XX take any of these 16Mb ? >=20 > Are there any commands in ghci to get the memory map? > It is something like > space taken by loaded compiled programs, > interpreted programs, > by data, > free space for program, > free space for data, > space for stack. >=20 > Is the interpreted program treated as data?=20 Object code is loaded outside the heap. It takes up real memory in the process, because the data has to be relocated when it is loaded. Object code is never released or unloaded: if you load a newly compiled version of the same module, GHCi just allocates more memory for it. The reason is that objects in the heap may still have references to the old code, and trying to detect/prevent this is hard. Interpreted code lives in the heap, and is garbage collected as normal. Cheers, Simon From mechvel@math.botik.ru Fri Apr 27 12:28:19 2001 From: mechvel@math.botik.ru (S.D.Mechveliani) Date: Fri, 27 Apr 2001 15:28:19 +0400 Subject: memory distribution in ghci Message-ID: It looks, there remains a questions on memory distribution in ghc-5.00 -interpreted : can ghci provide a command measuring the part of heap taken by interpreted programs, by interfaces? (or, at least, their sum) For, with -O and much in-lining, the interfaces may be very large. Also compare it to the _batch_ mode: commanding ghc -o run Foo.o ./run +RTS -MXXm -RTS the user is sure that XX Mb is only for the `real' computation data. ----------------- Serge Mechveliani mechvel@botik.ru From simonmar@microsoft.com Fri Apr 27 11:57:29 2001 From: simonmar@microsoft.com (Simon Marlow) Date: Fri, 27 Apr 2001 11:57:29 +0100 Subject: ANNOUNCE: Happy 1.10 released Message-ID: <9584A4A864BD8548932F2F88EB30D1C60171F61F@TVP-MSG-01.europe.corp.microsoft.com> ANNOUNCING Happy 1.10 - The LALR(1) Parser Generator for Haskell ----------------------------------------------------------------- I'm pleased to announce version 1.10 of Happy, the parser generator system for Haskell. Changes in this version, relative to version 1.10 (the previous full release): * bugfixes, and minor performance improvements, * most of the examples work again. Happy is available in source form, which can be compiled with GHC version 4.xx (4.08 or 5.00 recommended), and we also provide binaries for some architectures. The Happy homepage with links to the various distributions lives at: http://www.haskell.org/happy/ Please send any bug reports and comments to simonmar@microsoft.com. From simonmar@microsoft.com Fri Apr 27 11:32:40 2001 From: simonmar@microsoft.com (Simon Marlow) Date: Fri, 27 Apr 2001 11:32:40 +0100 Subject: heap and code in ghci Message-ID: <9584A4A864BD8548932F2F88EB30D1C60171F61E@TVP-MSG-01.europe.corp.microsoft.com> > Let, for example, all the .o modules were prepared, and we=20 > command > ghci ... +RTS -Mxxm -RTS > ... > Loading package std ... linking ... done. > Prelude> :l BPrelude > ... >=20 > and then try to find sum [1..n]. > In my experiment > xx =3D 7 does not allow to load the program, > 8, sum [1..66000] yields "Heap exhausted", > 10, sum [1..77000] yields 2964538500.=20 >=20 > Probably, this xx Mb is for binary program + heap. > ghci loads .o modules, they take some part of xx, > and all the rest is for the heap. > Right? Nope. The -M flag affects the size of the heap only; object files are loaded outside the heap. If you're running out of heap with a maximum size of 8M, it's probably because the heap is full of interfaces (i.e. the in-memory copy of the .hi file). Cheers, Simon From simonmar@microsoft.com Fri Apr 27 14:00:16 2001 From: simonmar@microsoft.com (Simon Marlow) Date: Fri, 27 Apr 2001 14:00:16 +0100 Subject: memory distribution in ghci Message-ID: <9584A4A864BD8548932F2F88EB30D1C60171F624@TVP-MSG-01.europe.corp.microsoft.com> > It looks, there remains a questions on memory distribution in=20 > ghc-5.00 -interpreted : >=20 > can ghci provide a command measuring the part of heap taken > by interpreted programs,=20 > by interfaces? > (or, at least, their sum) Ah, I see now. You'd like to know how much memory your program is using, compared to GHCi itself? Hmm. Unfortunately I can't see a good way to do this I'm afraid. However, you can always compile the program and use profiling... > For, with -O and much in-lining, the interfaces may be very large.=20 You really don't want to use -O with GHCi (in fact, at the moment you can't).=20 Cheers, Simon From info@businessesforsale.com" Search over 12,000 businesses for sale at: http://www.BusinessesForSale.com The leading global website for businesses for sale - everything from bars and hotels to pet shops and newsagents. Regards The BusinessesForSale.com team. -------------------------------------------------------------------------- To be removed from this mailing list please reply with the word remove in the email and ensure it contains the original text. glasgow-haskell-users@dcs.gla.ac.uk Ref: Biz-Opp-A2-20010427 From michaelw@debian.org Fri Apr 27 17:44:19 2001 From: michaelw@debian.org (Michael Weber) Date: Fri, 27 Apr 2001 18:44:19 +0200 Subject: The (Interactive) Glasgow Haskell Compiler -- version 5.00 In-Reply-To: <20010422164454.A1276@webnet.de>; from Michael Weber on Sun, Apr 22, 2001 at 04:44:54PM +0200 References: <68B95AA1648D1840AB0083CC63E57AD60EFC42@red-msg-06.redmond.corp.microsoft.com> <20010422164454.A1276@webnet.de> Message-ID: <20010427184419.C29193@bond.informatik.rwth-aachen.de> On Sun, Apr 22, 2001 at 16:44:54 +0200, Michael Weber wrote: > > The (Interactive) Glasgow Haskell Compiler -- version 5.00 > > ============================================================ > > > > We are pleased to announce a new major release of the Glasgow Haskell > > Compiler (GHC), version 5.00. The source distribution is freely > > available via the World-Wide Web and through anon. FTP, under a > > BSD-style license. See below for download details. Pre-built > > packages for Linux, FreeBSD, Solaris and Win32 are also available. > [...] > Debian packages for GHC 5.00 are available for some days now in the > 'unstable' distribution. They should have hit the mirrors already, so > please choose the nearest one. More info on that below. [...] > Availability > ============ [...] > As a consequence, GHC is built against the latest libraries in > 'unstable', including libc6 (>= 2.2.2-2). I am sorry, but at the > moment I cannot make any promises about when packages for 'stable' > (aka potato) will be available. Ok, big thanks to Kevin Glynn, who provided me with a Debian potato machine and allowed me to burn quite some CPU cycles [Hi Kevin! =)]. There are now updated packages for ghc4, ghc5 and happy for POTATO available (libc6 >= 2.1.2). So, basically, potato (aka current 'stable') users need not upgrade to 'testing' or 'unstable' to get a running GHC 5.00 (or GHCi). The packages are available at my APT store (see below), but NOT from Debian directly. IMPORTANT NOTE: =============== These packages depend on libgmp3, just like the packages in 'unstable', so you need the libgmp3(-dev) packages. Since they are not available for potato, I recompiled them and made them available, too. To make things even more complicated, libgmp3 does not play well with the libgmp2 provided by potato, so I rebuild new libgmp2 packages, too. I did my best to nevertheless provide a smooth upgrade path to the woody or sid distributions, so this should not lead to any problems at all. If there is something, that does not work, please let me know ASAP. However, for APT users this should be quite unimportant, since APT should pull in the necessary stuff on it's own. If not, again please let me know. You can also try to upgrade libgmp2 first, then install libgmp3(-dev), and then the GHC suite. In any case, please let me know about any trouble you experienced. APT lines: deb http://www-i2.informatik.rwth-aachen.de/Software/Haskell/debian potato/ deb-src http://www-i2.informatik.rwth-aachen.de/Software/Haskell/debian potato/ Cheers, Michael -- () ASCII ribbon campaign | Chair for Computer Science II | GPG: F65C68CD /\ against HTML mail | RWTH Aachen, Germany | PGP: 1D0DD0B9 From pasch@netzGeneration.com Fri Apr 27 23:13:48 2001 From: pasch@netzGeneration.com (Thomas Pasch) Date: Sat, 28 Apr 2001 00:13:48 +0200 Subject: GHC and the Lazy Functional State Threads Paper Message-ID: <3AE9EF1C.DC524134@netzGeneration.com> Hello, to get a better understanding I tried to get the code from 'Lazy Functional State Thread' to work. But I encounter some error messages that I don't fully understand. > module Lfs where > > import PrelGHC > import GlaExts > import ST > import qualified MArray > import qualified Array > > newArr = newSTArray > readArr = readSTArray > writeArr = writeSTArray > -- Error: Ambiguous type variable(s) `ix' in the constraint `Ix ix' > freezeArr = freezeSTArray > > thenST_ a b = a `thenST` \_ -> b > > accumArray bnds f z ivs > = runST > (newArr bnds z `thenST` \a -> > fill a f ivs `thenST_` > freezeArr a) > > fill a f [] = returnST () > fill a f ((i,v):ivs) > = readArr a i `thenST` \x -> > writeArr a i (f x v) `thenST_` > fill a f ivs > > -- in GlaExts: seqST = (>>) > seqST2 = foldr thenST_ (returnST ()) > > accumArray2 bnds f z ivs > = runST > (newArr bnds z `thenST` \a -> > seqST2 (map (update a f) ivs) `thenST_` > freezeArr a) > > update a f (i,v) > = readArr a i `thenST` \x -> > writeArr a i (f x v) > > putString [] = returnST () > -- Error: Couldn't match `ST s a' against `IO ()' > putString (c:cs) = putChar c `thenST_` > putString cs > > -- Error: Couldn't match `ST s a' against `[b]' > putString2 cs = seqST (map putChar cs) > > main = putStrLn "Hello, world" > How to change the code to get it to work? Why is there a different definition of seqST in GlaExts? Best regards, Thomas PS: When I change the definition of the mutable Array to > newArr = MArray.newArray > readArr = MArray.readArray > writeArr = MArray.writeArray > freezeArr = MArray.freeze I get Error in accumArray and accumArray2. I guess this is because of the fact that a STArray is only one possible MArray and there are other possiblities, right? From pasch@netzGeneration.com Fri Apr 27 23:14:40 2001 From: pasch@netzGeneration.com (Thomas Pasch) Date: Sat, 28 Apr 2001 00:14:40 +0200 Subject: Shared Libraries Message-ID: <3AE9EF50.E7183330@netzGeneration.com> Hello, In the windows version of ghc, there seems to be the possiblity to compile the libraries as shared 'dll's. Is the same possible for the unix version? The question is because I think the ghc executables are really blown up. A simple 'Hello, world' has 358 KBytes and the hello example of the GTK+ bindings is as big as 2.2 MBytes, although it is link dynamically against: > ldd hello libgthread-1.2.so.0 => /usr/lib/libgthread-1.2.so.0 (0x40025000) libgtk-1.2.so.0 => /usr/lib/libgtk-1.2.so.0 (0x40028000) libgdk-1.2.so.0 => /usr/lib/libgdk-1.2.so.0 (0x40155000) libgmodule-1.2.so.0 => /usr/lib/libgmodule-1.2.so.0 (0x4018a000) libglib-1.2.so.0 => /usr/lib/libglib-1.2.so.0 (0x4018d000) libdl.so.2 => /lib/libdl.so.2 (0x401b1000) libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x401b4000) libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x401bc000) libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x401cb000) libm.so.6 => /lib/libm.so.6 (0x402ae000) libgmp.so.3 => /usr/lib/libgmp.so.3 (0x402cc000) libc.so.6 => /lib/libc.so.6 (0x402ed000) libpthread.so.0 => /lib/libpthread.so.0 (0x40400000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) Best regards, Thomas From qrczak@knm.org.pl Fri Apr 27 22:57:19 2001 From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) Date: 27 Apr 2001 21:57:19 GMT Subject: GHC and the Lazy Functional State Threads Paper References: <3AE9EF1C.DC524134@netzGeneration.com> Message-ID: Sat, 28 Apr 2001 00:13:48 +0200, Thomas Pasch pisze: > > newArr = newSTArray > > readArr = readSTArray > > writeArr = writeSTArray > > -- Error: Ambiguous type variable(s) `ix' in the constraint `Ix ix' > > freezeArr = freezeSTArray Monomorphism restriction strikes again. Constrained type variables of variable bindings without type signatures get a single type. Solution: add explicit type signatures: newArr:: Ix i => (i,i) -> e -> ST s (STArray s i e) newArr = newSTArray readArr:: Ix i => STArray s i e -> i -> ST s e readArr = readSTArray writeArr:: Ix i => STArray s i e -> i -> e -> ST s () writeArr = writeSTArray freezeArr:: Ix i => STArray s i e -> ST s (Array i e) freezeArr = freezeSTArray or (with ghc >= 5.00) compile with -fno-monomorphism-restriction. Welcome to the club of people who think that the monomorphism restriction should be removed. > > putString [] = returnST () > > -- Error: Couldn't match `ST s a' against `IO ()' > > putString (c:cs) = putChar c `thenST_` > > putString cs The 'Lazy Functional State Threads' paper was written a long time ago, where monads were not a standard part of Haskell. I think that its IO was a special case of ST, which is not true anymore. There are stToIO and unsafeIOToST functions in module ST, but you should not really perform IO from the ST monad. > > -- Error: Couldn't match `ST s a' against `[b]' > > putString2 cs = seqST (map putChar cs) Use seqST2, which is now available under the name sequence_ (works for arbitrary monad; at the time where the paper was written it was not even possible to define the Monad class, because it has a higher order kind). > Why is there a different definition of seqST in GlaExts? Because it's newer than the paper - actually this module is already obsolete:-) For the ST monad you can use standard overloaded monadic functions and operators: >>=, >>, return, sequence, sequence_, mapM, mapM_ etc. > When I change the definition of the mutable Array to > > > newArr = MArray.newArray > > readArr = MArray.readArray > > writeArr = MArray.writeArray > > freezeArr = MArray.freeze > > I get Error in accumArray and accumArray2. I guess this is because > of the fact that a STArray is only one possible MArray and there > are other possiblities, right? Right: nothing determines which mutable array type to use, and its type doesn't appear in the result, so it's ambiguous. But it's not the whole story. This is a really weird case. The MArray class is defined over the array type, the monad, and the element type. The element type is there because some arrays (namely STUArray and IOUArray among these privided by ghc) are not fully polymorphic wrt. the element type, but have different implementations for different element types (and store element values unboxed instead of under generic object pointers). The ST and STArray types are parametrized by a dummy type variable, and the runST function has a special type with forall in the argument. This ensures that the result of a computation run by runST doesn't depend on values which are mutable in this computation, i.e. that mutable values don't escape their state thread, so separate state threads are truly independent. The result of accumArray is an immutable array. So it should be legal to return it from a computation run by runST... Unfortunately it does depend on the dummy type variable! It's because it requires that the mutable array used to build the result accepts the given element type. The MArray constraint applies to the element type and to the monad. The monad type contains the dummy type variable. So although in practice all MArray instances with ST s as the monad work for all choices of s, the type of a general MArray constraint looks as if it could place constraints on s, and such type is rejected by runST. Fortunately you must resolve the mutable array type anyway. You can choose STArray, which is fully polymorphic wrt. the element type This causes the resulting type not depend on the dummy type variable: an unusual case where the type inferred as the most general type is not really most general! So you can fix it for example by using a specialized version of freezeArr inside accumArray, of type (Ix i, IArray a e) => STArray s i e -> ST s (a i e) This will give quite general type of accumArray: arbitrary immutable array from the IArray class. If the immutable array type used was particularly UArray, it would be more efficient to use the corresponding STUArray instead of STArray, so freezing could just copy a memory block (there are magic specializations in ghc's libraries for such case). But if the element type was to remain generic, the type would have to be constrained over STUArray: the compiler doesn't know that UArray and STUArray are in practice defined for the same element types. The STUArray type includes the dummy type variable, so it doesn't work in runST, as explained above. Sorry. -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTĘPCZA QRCZAK From mechvel@math.botik.ru Sat Apr 28 08:04:18 2001 From: mechvel@math.botik.ru (S.D.Mechveliani) Date: Sat, 28 Apr 2001 11:04:18 +0400 Subject: memory distribution in ghci Message-ID: To my request > [..] > can ghci provide a command measuring the part of heap taken > by interpreted programs, > by interfaces? > (or, at least, their sum) Simon Marlow writes > Ah, I see now. You'd like to know how much memory your program is > using, compared to GHCi itself? Hmm. Unfortunately I can't see a good > way to do this I'm afraid. In ghci ... +RTS -Mxxxm -RTS xxx sets the volum bound for (1) `real' data + (2) interpreted program + (3) interfaces of pre-compiled loaded .o modules. Please, confirm, whether I understand correct? And many users would like to measure (1) within the ghci loop. The statistic like Prelude> List.sort [1..10] [1,2,3,4,5,6,7,8,9,10] (0.53 secs, 7109100 bytes) includes the number of allocations, which cannot help to detect (1) (can it?) This is a user's wish for the future ghci version. I do not know, whether it is hard to develop. If it is hard, personally, I would not suffer much. Because, getting "heap exhausted", one can run ghci once more, with larger xxx, and performing the same computation to detect approximately which part of xxx is taken by the `real' data. But this looks awkward. Another wish: to document the ghci memory management ------------- which we are discussing now. Because GHC could simply give a reference to the manual section. > However, you can always compile the program > and use profiling... Suppose User demonstrates an Haskell application A to the Listener. Naturally, most of A constitutes its `library' L, and L was compiled to .o files (desirably, gathered in the libL.a archive). ghci invokes, loads the _interpreted_ demonstration code D, much smaller than L, but importing items from L. Naturally, Listener asks something like "and how much memory needs to compute this matrix?". In many other system, the interactive command, say, `:size' gives immediately some interpreter memory map and the sizes taken by `code' and `data'. And you suggest to wait 2 hours to re-compile _everything_ with profiling. The Listener would not wait. >> For, with -O and much in-lining, the interfaces may be very large. > You really don't want to use -O with GHCi (in fact, at the moment you > can't). This may be serious. For example, putStr $ show (sum1 [1..n]) will need a constant memory or O(n) memory depending on the -O possibility. The docs on ghc-5.00 say that it joins "the best of the two worlds" - interpreted code calling for the fast code compiled earlier. Generally, I like only scientifically designed `interpreters' and always advised not to spend efforts to .o compilation. But as nobody agrees with me, as the o-compilation fiesta continues, then, why to spend effort in vain? ----------------- Serge Mechveliani mechvel@botik.ru From mechvel@math.botik.ru Sat Apr 28 08:33:11 2001 From: mechvel@math.botik.ru (S.D.Mechveliani) Date: Sat, 28 Apr 2001 11:33:11 +0400 Subject: memory destribution Message-ID: Here is another expression of what I wrote recently on the memory destribution. Probbaly, it suffices to have the garbage collection command. For example, Hugs can do Prelude> :gc Garbage collection recovered 240372 cells ... It is clear then, how much the user has for further computation. ----------------- Serge Mechveliani mechvel@botik.ru From simonpj@microsoft.com Sun Apr 29 20:16:24 2001 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Sun, 29 Apr 2001 12:16:24 -0700 Subject: haskell.runtime.* ?? Message-ID: <37DA476A2BC9F64C95379BF66BA2690201055877@red-msg-09.redmond.corp.microsoft.com> I'm afraid that no one ever completed the GHC Haskell->Java story. The idea is that the JVM is the runtime, but of course you need to implement the standard libraries somehow,=20 and all the primitive operations GHC uses. Not a trivial task, but one we are undertaking for .NET. Bottom line: the reason you can't find a runtime is because you are supposed to compile the Java with a Java compiler and run that. But you'll need to do more than that to actually run programs Simon | -----Original Message----- | From: Kwanghoon Choi [mailto:khchoi@ruby.kaist.ac.kr] | Sent: 25 April 2001 14:13 | To: glasgow-haskell-users@haskell.org | Subject: haskell.runtime.* ?? |=20 |=20 |=20 | Hello, |=20 | I managed to restore an option for GHC 5.00 to produce=20 | java output but I realized that I also need some runtime=20 | system to run the java program produced by GHC. I=20 | examined the GHC source tree and the GHC website but in=20 | vain. Where do I get the runtime system? |=20 | Thanks in advance. |=20 | Kwanghoon |=20 |=20 |=20 |=20 | _______________________________________________ | Glasgow-haskell-users mailing list | Glasgow-haskell-users@haskell.org | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users |=20 From simonmar@microsoft.com Mon Apr 30 11:28:51 2001 From: simonmar@microsoft.com (Simon Marlow) Date: Mon, 30 Apr 2001 11:28:51 +0100 Subject: Shared Libraries Message-ID: <9584A4A864BD8548932F2F88EB30D1C6115859@TVP-MSG-01.europe.corp.microsoft.com> > In the windows version of ghc,=20 > there seems to be the possiblity to compile > the libraries as shared 'dll's. Is the=20 > same possible for the unix version? >=20 > The question is because I think the ghc=20 > executables are really blown up. A simple > 'Hello, world' has 358 KBytes and the hello > example of the GTK+ bindings is as big as > 2.2 MBytes, although it is link dynamically > against: 358K looks a bit large: is that stripped? I normally see a 150K-ish minimum. Most of that is the runtime system and garbage collector. To answer your question: we don't currently have a way to make shared libraries for Haskell code on Unix boxes. I've made various attempts at this in the past and didn't have much success - take a look back through the glasgow-haskell-{users,bugs} archives for some more info on the topic. BTW, shared libraries aren't that big a deal. You won't see any memory savings unless you've got several Haskell programs running, and there would certainly be a performance hit. Also, there wouldn't be any of the other "hot-swappable" advantages you normally get with shared libraries, because GHC-compiled Haskell libraries tend to have a much more intimate relationship with each other than C libraries. Cheers, Simon From simonmar@microsoft.com Mon Apr 30 11:46:30 2001 From: simonmar@microsoft.com (Simon Marlow) Date: Mon, 30 Apr 2001 11:46:30 +0100 Subject: memory distribution in ghci Message-ID: <9584A4A864BD8548932F2F88EB30D1C611585A@TVP-MSG-01.europe.corp.microsoft.com> > > Ah, I see now. You'd like to know how much memory your program is > > using, compared to GHCi itself? Hmm. Unfortunately I=20 > can't see a good > > way to do this I'm afraid. =20 >=20 > In ghci ... +RTS -Mxxxm -RTS > xxx sets the volum bound for =20 > (1) `real' data + =20 > (2) interpreted program +=20 > (3) interfaces of pre-compiled loaded .o modules. >=20 > Please, confirm, whether I understand correct? Yes, that's right. > And many users would like to measure (1) within the ghci loop. >=20 > The statistic like Prelude> List.sort [1..10] > [1,2,3,4,5,6,7,8,9,10] > (0.53 secs, 7109100 bytes) >=20 > includes the number of allocations, which cannot help to detect (1) > (can it?) No, it can't. > This is a user's wish for the future ghci version. >=20 > I do not know, whether it is hard to develop. > If it is hard, personally, I would not suffer much. It's hard, because the three kinds of data you mention above can't easily be separated. It's entirely possible, due to the fact that GHCi is sharing the heap with the running interpreted program, that the data in use by the program could end up pointing to compiler data structures (perhaps because parts of the code are lazilly compiled). Furthermore, having an indication of the memory residency of the interpreted program isn't much of an indication of the residency of a compiled program, which is after all what really matters. If you want speed or memory efficiency, just compile the program. > Another wish: to document the ghci memory management > ------------- > which we are discussing now. > Because GHC could simply give a reference to the manual section. I'll elaborate in the GHCi documentation. > > However, you can always compile the program > > and use profiling... >=20 > Suppose User demonstrates an Haskell application A to the Listener.=20 > Naturally, most of A constitutes its `library' L, and L was=20 > compiled to .o files > (desirably, gathered in the libL.a archive). >=20 > ghci invokes, loads the _interpreted_ demonstration code D, > much smaller than L, but importing items from L. > Naturally, Listener asks something like=20 > "and how much memory needs to compute this matrix?". >=20 > In many other system, the interactive command, say, `:size' > gives immediately some interpreter memory map and the sizes taken > by `code' and `data'. > And you suggest to wait 2 hours to re-compile _everything_ with=20 > profiling. The Listener would not wait. >=20 > >> For, with -O and much in-lining, the interfaces may be very large. >=20 > > You really don't want to use -O with GHCi (in fact, at the=20 > moment you > > can't). >=20 > This may be serious. For example, putStr $ show (sum1 [1..n]) >=20 > will need a constant memory or O(n) memory depending on the -O > possibility. True. But compiling with optimsation takes 2-3 times longer than interpreting - if you're prepared to wait that long, you might as well compile instead. Compiling will give more of a performance boost in general (about 10x) than turning on -O (perhaps 2x). Cheers, Simon From rrt@dcs.gla.ac.uk Mon Apr 30 16:14:25 2001 From: rrt@dcs.gla.ac.uk (Reuben Thomas) Date: Mon, 30 Apr 2001 16:14:25 +0100 (BST) Subject: Happy 1.10 Windows InstallShield available Message-ID: An InstallShield distribution of Happy 1.10 for Windows is now available from the Happy page (www.haskell.org/happy/). From emeijer@microsoft.com Mon Apr 30 23:51:56 2001 From: emeijer@microsoft.com (Erik Meijer) Date: Tue, 1 May 2001 00:51:56 +0200 Subject: : RE: haskell.runtime.* ?? Message-ID: There is a working GHC-to-.Net runtime available at www.mondrian-script.org ; reving the Jva a backend should not be too much of a problem. Erik =20 =20 Message: 1 Subject: RE: haskell.runtime.* ?? Date: Sun, 29 Apr 2001 12:16:24 -0700 From: "Simon Peyton-Jones" < simonpj@microsoft.com > To: "Kwanghoon Choi" < khchoi@ruby.kaist.ac.kr >, < glasgow-haskell-users@haskell.org > I'm afraid that no one ever completed the GHC Haskell->Java story. The idea is that the JVM is the runtime, but of course you need to implement the standard libraries somehow,=3D20 and all the primitive operations GHC uses. Not a trivial task, but one we are undertaking for .NET. Bottom line: the reason you can't find a runtime is because you are supposed to compile the Java with a Java compiler and run that. But you'll need to do more than that to actually run programs Simon