George Russell | 4 Dec 17:09 2000
Picon
Picon

The Set type

A minor quibble I know, but every time I use sets I want to add/subtract single elements
to/from them.  There is no function provided for doing this, so instead you have to do
union/delete with a singleton set constructed from the element.  I appreciate the zeal
of the designer of this module to construct the smallest possible interface (I wish the
same person had designed the standard Prelude) but I think this zeal is overdone.
You do often need to operate with single elements.  After all, if you wanted real 
hair-shirt minimalism you should get rid of "elementOf" (replace it by 
\el set -> isEmptySet (intersect set (singletonSet el)), but no-one would seriously
suggest that - I hope.

George Russell | 4 Dec 17:17 2000
Picon
Picon

Or-patterns

Why not steal a good idea from Standard ML/New Jersey now and again?  This has
"Or-patterns" which allow you to match against a disjunction of patterns,
EG

fun sleepIn (Date.Sat | Date.Sun) = true
|   sleepIn _ = false

Where you have variables in the patterns, you bind only the variables which appear 
in all the patterns, and you unify the types accordingly.

Of course you can do without this feature, but I feel it shouldn't be too hard
to implement and for me at least it would be occasionally useful.

Simon Peyton-Jones | 6 Dec 16:15 2000
Picon

RE: Or-patterns

Sensible suggestion

No technical problem, just one more thing to do.
If anyone feels inclined to implement it I'll gladly incorporate 
the fruits of their labours in the GHC code base.

Simon

| -----Original Message-----
| From: George Russell [mailto:ger <at> Informatik.Uni-Bremen.DE]
| Sent: 04 December 2000 16:18
| To: glasgow-haskell-users <at> haskell.org
| Subject: Or-patterns
| 
| 
| Why not steal a good idea from Standard ML/New Jersey now and 
| again?  This has
| "Or-patterns" which allow you to match against a disjunction 
| of patterns,
| EG
| 
| fun sleepIn (Date.Sat | Date.Sun) = true
| |   sleepIn _ = false
| 
| Where you have variables in the patterns, you bind only the 
| variables which appear 
| in all the patterns, and you unify the types accordingly.
| 
| Of course you can do without this feature, but I feel it 
| shouldn't be too hard
(Continue reading)

Marcin 'Qrczak' Kowalczyk | 6 Dec 22:08 2000
Picon

Re: Or-patterns

Mon, 04 Dec 2000 17:17:42 +0100, George Russell <ger <at> Informatik.Uni-Bremen.DE> pisze:

> Where you have variables in the patterns, you bind only the
> variables which appear in all the patterns, and you unify the
> types accordingly.

Or bind them all (otherwise there would be _ written) and get bottom
in case the matching subpattern did not bind the given variable.

--

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

Christian Lescher | 7 Dec 08:35 2000
Picon

Re: New InstallShield: no more DLLs

Hi Reuben,

> Besides, I've got some (not so fortunate) news: even after updating binutils and the
> whole cygwin to the latest version, the problem with *statically* linked and
> afterwards stripped DLLs build with GHC remains - the unstripped version works well,
> but the stripped one crashes in some constellations. I will try to make this error
> reproducable and let you know about it. Something is still wrong here - probably with
> cygwin. Maybe this has also got something to do with the dyn. linking problem?

There are some strange things happening that I'm still astonished about. I decided just
to write them down again - perhaps it may help to discover the error of the linking
problem.

As you know, I made some trials with a statically linked DLL build with GHC4.08.1 and the
latest cygwin.
a) When leaving debug information as it is, everything works fine - in all environments I
tested it on (WinNT, Win95; VBA, Delphi, VB - I had no possibility to test it on Win2K
yet).
b) When STRIP-ping away the debug information, the DLL on all PCs I tried it on works
fine with VB and Delphi - but when using it in VBA, it on some PCs crashes when the DLL
is loaded (the loading happens automatically when calling a Haskell function for the
first time) - this also looks like a problem during DLL initialization, it seems as if
DllMain is not even entered.

Did you already try out a statically linked, stripped DLL on Win2K? Do you get the same
error? (If the origin of the error is the same DLL initialization problem as in the
linking problem with EXEs, it may be easier to handle in a hell of a single DLL ...)

Some more strange things occured with the small program we had with catchAllIO / the "hi"
output:
(Continue reading)

Volker Stolz | 7 Dec 11:56 2000
Picon
Picon

Anyone using SocketPrim.getSocketName?

Is anyone using SocketPrimt.getSocketName?
I try to get the IP of a listening socket (on my side), but
I always get 0. It could be either my fault, SocketPrims fault
(the source is prefilling the buffer with 0!), or the
conversion-functions fault:

>   sAddr <- SocketPrim.getSocketName (s#socket)
>   local <- case sAddr of
>     (SocketPrim.SockAddrInet port host) -> do
>	  return (show (wordToWord32 host))
>     _ -> net#getHostName -- XXX output a warning 
>   print local

"host" is of type Word, so I need a way of getting it into a string.
host should be 4x8 bit and thus Word32 is the right thing to use?
--

-- 
\usepackage[latin1]{inputenc}!
Volker Stolz * stolz <at> i2.informatik.rwth-aachen.de * PGP + S/MIME

Volker Stolz | 7 Dec 13:19 2000
Picon
Picon

Re: Anyone using SocketPrim.getSocketName?

Am 07. Dec 2000 um 11:56 MET schrieb Volker Stolz:
> Is anyone using SocketPrimt.getSocketName?
> I try to get the IP of a listening socket (on my side), but
> I always get 0. It could be either my fault, SocketPrims fault
> (the source is prefilling the buffer with 0!), or the
> conversion-functions fault:

Okay, I can construct cases where I get what I want. It seems to
depend on the OS; the SocketPrim implementation works.
--

-- 
\usepackage[latin1]{inputenc}!
Volker Stolz * stolz <at> i2.informatik.rwth-aachen.de * PGP + S/MIME

Simon Peyton-Jones | 7 Dec 18:17 2000
Picon

RE: Fun with GHC's optimiser

Manuel

OK, I've improved the eta expander so it does a better
job of the code you found.

Try now.  On the HEAD.  Which should compile OK now, incidentally.

How's your parallel Haskell stuff coming?

Simon

| -----Original Message-----
| From: Manuel M. T. Chakravarty [mailto:chak <at> cse.unsw.edu.au]
| Sent: 02 November 2000 13:54
| To: Simon Peyton-Jones
| Cc: glasgow-haskell-users <at> haskell.org
| Subject: RE: Fun with GHC's optimiser
| 
| 
| Simon Peyton-Jones <simonpj <at> microsoft.com> wrote,
| 
| > I can never resist messages like these, even when I'm meant
| > to be doing other things.  
| 
| That's good to know ;-)
| 
| > It's very helpful when people offer
| > fairly precise performance-bug reports.  Thanks!
| 
| Thanks for the prompt reply!  To SimonM, too.
(Continue reading)

Dirk Evers | 7 Dec 19:39 2000
Picon
Picon

Beginners profiling question


So I have tried profiling the first time...

  using ghc-4.08.1 with options -prof -auto-all
  runtime option -px
  ghcprof and daVinci work like a charm

what I see is

  main uses 99.90 % time and space
  sat for practical purposes is the only function called from main and
  uses ca. 12 % time and space

what am I doing wrong...
Prelude not compiled for profiling?

Thanks in advance
Dirk
---
+---------------------------------------------------------------------+
| Dirk Evers                                           Office: M3-120 |
| Technische Fakultaet / AG PI                  Tel: +49 521 106-2905 |
| Universitaet Bielefeld                        FAX: +49 521 106-6411 |
| D-33594 Bielefeld             e-mail: dirk <at> TechFak.Uni-Bielefeld.DE |
| Germany             URL: http://www.TechFak.Uni-Bielefeld.DE/~dirk/ |
|---------------------------------------------------------------------|
| Die Succulenten   / a cappella singing /  http://www.succulenten.de |
+---------------------------------------------------------------------+
Attachment (satdanglefold.prof): application/octet-stream, 14 KiB
(Continue reading)

Marcin 'Qrczak' Kowalczyk | 7 Dec 20:31 2000
Picon

Re: Fun with GHC's optimiser

Thu, 7 Dec 2000 09:17:44 -0800, Simon Peyton-Jones <simonpj <at> microsoft.com> pisze:

> Try now.  On the HEAD.  Which should compile OK now, incidentally.

But does not work...
../../ghc/compiler/ghc-inplace -recomp -cpp -fglasgow-exts -fvia-C  -icheck -O  -package lang 
-package concurrent  -package posix -package-name util  -I../lang/cbits  -I../concurrent/cbits 
-I../posix/cbits -split-objs    -c Unique.lhs -o Unique.o -osuf o

panic! (the `impossible' happened):
        mkWWcpr: not a product PrelNum.Integer{-311-}

And also:
ghc-inplace --interactive
[...]
Loading package std ... resolving ... ghc: fatal error: ocResolve_ELF:
/home/users/qrczak/cvs/fptools/ghc/driver/../lib/std/HSstd.o: unknown symbol `PrelNum_showSignedInteger_closure'

--

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


Gmane