CVS Repository

2005-09-14 Thread Peter Simons
Hi, I understand the GHC CVS repository has moved recently? It appears that the document http://www.haskell.org/ghc/docs/latest/html/building/sec-cvs.html hasn't been updated accordingly; could someone with CVS commit access please fix that? Thanks, Peter

Re: error in your article? about meaning of safe/unsafe in foreign import

2005-05-20 Thread Peter Simons
Bulat, just for the record, it's not my article. Although I have the privilege of sharing a somewhat similar name with the geniuses around here, I didn't have any part in that text. ;-) You were wondering about this declaration: foreign import ccall unsafe sin :: Float - Float I guess you

Re: error in your article? about meaning of safe/unsafe in foreign import

2005-05-20 Thread Peter Simons
Duncan Coutts writes: So to sumarise the pairings: * you _must_ make a safe call to an unsafe foreign function * you _may_ make an unsafe call to a safe foreign function It's a contravariance :-) I'd use a slightly different term. Declaring a function that needs special

Re: Re[2]: error in your article? about meaning of safe/unsafe in foreign import

2005-05-20 Thread Peter Simons
Bulat Ziganshin writes: PS Since pure FFI calls don't have any side-effects, they are PS always safe to be called unsafely. sorry, but even pure C function can call back to Haskell world and lead to GC. Um, right. I said I didn't understand these things completely either. Guess I was

Re: not.hDuplicate

2005-05-15 Thread Peter Simons
Bulat Ziganshin writes: one thread gives to another handle of open file. i need to read some data from this file. how can i accomplish this? Keep the Handle in an MVar at all times, then access to it will be synchronized between threads:

Re: Haddock chokes on '#'

2005-02-14 Thread Peter Simons
Simon Marlow writes: (#):: a - (a - b) - b a # f = f a Haddock parses GHC extensions by default, so its syntax corresponds to GHC with -fglasgow-exts. I see. Thanks for the clarification. Fortunately, writing ( # ) instead solves the problem. ;-) Peter

Haddock chokes on '#'

2005-02-11 Thread Peter Simons
Processing the file module Test where -- |Haddock chokes on this. (#):: a - (a - b) - b a # f = f a with Haddock 0.6 gives an error: | haddock test.hs | test.hs:5:3: Parse error Since GHC deals with this code just fine, I suppose this is a bug. Peter

Re: Unregistering a package

2005-02-10 Thread Peter Simons
Simon Marlow writes: The general syntax of package ids is: pkgid ::= pkg ('-' version)? pkg ::= (alphanum|'-')+ version ::= (digit+) ('.' digit+)* ('-' alphanum+)* Thanks. I gave my package the version hsdns-0.0-2005-02-10 and that fixed the problem. Perhaps we should

Unregistering a package

2005-02-09 Thread Peter Simons
I have an interesting problem. There are two versions of the HsDNS package installed right now: $ ghc-pkg list | /usr/local/ghc-current/lib/ghc-6.5/package.conf: | rts-1.0, [...] (hsdns-2005-02-04), | hsdns-2005-02-08 Now how can I unregister them? I have tried everything I could

Re: Waiting on Sockets or File Descriptors

2005-02-02 Thread Peter Simons
Wolfgang Thaller writes: a) poll() is not supported on Mac OS X and (at least some popular versions of) BSD. Are you certain? Just tried man poll on one of the MacOS X machines the SourceForge compile farm offers, and that one had it: Darwin ppc-osx1 5.5 Darwin Kernel Version 5.5. b)

ghc HEAD 'make html' problems

2005-02-01 Thread Peter Simons
I can't build the library's Haddock documentation anymore: the process fails claiming that Control/Arrow-raw.hs would be missing. I've had this problem for a while now. Does anybody else see this? Peter ___ Glasgow-haskell-users mailing list

Waiting on Sockets or File Descriptors

2005-02-01 Thread Peter Simons
Hi, I have the following problem: I use an external library through the foreign function interface which gives me _several_ sockets and expects me to call it again when any of those sockets becomes readable or writable. Since I know that the Haskell run-time system has all the required

More HaXml trouble

2005-01-14 Thread Peter Simons
Hi, after rebuilding ghc-current, I got an intact Cabal version and managed to install HaXml successfully. However, when I try to link a program that actually uses the package, the linker stage fails with these errors:

Re: More HaXml trouble

2005-01-14 Thread Peter Simons
Simon Marlow writes: Looks like the HaXml package spec is missing a dependency on haskell98. You're right. That was it. Thanks! Peter ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org

Re: HaXml and ghc-current

2005-01-12 Thread Peter Simons
Ross Paterson writes: CVS Cabal had the bug you describe Alright, that was it. Thanks a lot for the pointer. Peter ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org

Re: HaXml and ghc-current

2005-01-11 Thread Peter Simons
Lemmih writes: You should probably talk to Malcolm Wallace about it. Curiously enough, he sent me here. ;-) Oh well, looks like I have to use my own brain. Anyway, thanks a lot for trying to help, Lemmih. It is very much appreciated. Peter ___

HaXml and ghc-current

2005-01-10 Thread Peter Simons
Hi, I've just tried to install HaXml with the latest GHC from CVS, and the package compiles fine but the installation procedure aborts with: ghc-pkg: cannot find package HaXml `cat ghcpkgcmd` --add-package pkg.conf Reading package info from stdin... ghc-pkg: Line 1: Invalid syntax (no

Re: HaXml and ghc-current

2005-01-10 Thread Peter Simons
Lemmih writes: But no worries; HaXml is cabalized and should be available in your CVS source tree. I see, thanks for the info! Any advice on how to build/install it with Cabal? I've tried it, but when Cabal tries to create the library, it appears to get the file suffixes wrong: $ runghc

Re: internal error: weird activation record found on stack: 9

2005-01-04 Thread Peter Simons
Simon Marlow writes: add GhcRtsWays += thr_debug to mk/build.mk in a GHC tree, and build as normal. Great, that's gonna be no problem. Concerning your original instructions: | Please compile the program with -debug, then open it with | gdb. Set a breakpoint on barf() and run the program:

Re: internal error: weird activation record found on stack: 9

2005-01-03 Thread Peter Simons
I wrote: Simon Marlow writes: Please compile the program with -debug, then open it with gdb. Unfortunately, -debug seems to conflict with -threaded: ghc --make -threaded -debug -O -Wall [...] -o postmaster tutorial.lhs [...] Chasing modules from: tutorial.lhs [...]

OpenAL builds despite --disable-openal (was: Error building GHC: can't locate import `Package')

2004-12-20 Thread Peter Simons
I wrote: I deleted it and said make again, and now it seems to work (it's still building). As it turned out, the build does not succeed. It fails while trying to build OpenAL: | Sound/OpenAL/AL/BasicTypes.hs:63:15: | Not in scope: type constructor or class `HTYPE_ALFLOAT' | |

Error building GHC: can't locate import `Package'

2004-12-18 Thread Peter Simons
When building the current CVS HEAD with ghc-6.2.2 on Linux/x86, I get this error: [...] ==fptools== make boot - --no-print-directory -r; in /usr/local/src/ghc-current/ghc/utils/ghc-pkg Creating Version.hs ...

Re: Error building GHC: can't locate import `Package'

2004-12-18 Thread Peter Simons
Sven Panne writes: Hmmm, there is no ParsePkgConfLite.hs in the HEAD anymore. Perhaps you have some old cruft lying around in your build directory? I deleted it and said make again, and now it seems to work (it's still building). Thank you. It might be good to remove the file in the clean

Re: internal error: weird activation record found on stack: 9

2004-12-18 Thread Peter Simons
Simon Marlow writes: Please compile the program with -debug, then open it with gdb. Unfortunately, -debug seems to conflict with -threaded: ghc --make -threaded -debug -O -Wall [...] -o postmaster tutorial.lhs [...] Chasing modules from: tutorial.lhs [...] Compiling Main

internal error: weird activation record found on stack: 9

2004-12-16 Thread Peter Simons
Hi, I'm getting this error in my software every now and then: postmaster: internal error: scavenge_stack: weird activation record found on stack: 9 Please report this as a bug to [EMAIL PROTECTED], or http://www.sourceforge.net/projects/ghc/ The process runs just fine for several

Re: Bug in touchForeignPtr?

2004-11-24 Thread Peter Simons
Duncan Coutts writes: you cannot solve the finalisers problem just by running the finaliser thread to completion (or it'd be done that way already!) I guess, I was approaching the problem from the wrong side. What I am really interested in are the implications of this fact for the

Re: Bug in touchForeignPtr?

2004-11-23 Thread Peter Simons
Simon Marlow writes: Note that the GC only starts the finaliser thread. The program can still terminate before this thread has run to completion [...] If you want anything else, you can implement it. How do I implement that particular feature? I don't see how I could write a 'main'

Re: Marshall Multidimensional list, multidimensional array

2004-11-10 Thread Peter Simons
David Lo writes: [[Int]] to int[][] Pardon me if I'm telling you something you already know, but I wanted to make sure you are aware of it. int[][] is a very different type than [[Int]] is. An int[][] is a pointer to an array of pointers to integers: int[][] == int*[] == int** Now

Re: Marshall Multidimensional list, multidimensional array

2004-11-10 Thread Peter Simons
[EMAIL PROTECTED] writes: To marshall a [[Int]] ... withArray2D xs f = withArray (concat xs) f withArray2D xs f = withArray xs' f where xs' = concat $ map (take dim) xs dim = minimum $ map length xs Um, I really wouldn't use the term

Re: Export through FFI Haskell List to C array (by MarshalAlloc)

2004-11-09 Thread Peter Simons
David Lo writes: Anyone has ever tried exporting Haskell list to C array? Check out the module Foreign.Marshal.Array, specifically the functions: withArray:: Storable a = [a] - (Ptr a - IO b) - IO b withArrayLen :: Storable a = [a] - (Int - Ptr a - IO b) - IO b These will marshal a

Re: getUserEntryForName weirdness

2004-11-06 Thread Peter Simons
Volker Stolz writes: Fixed in CVS I've tried it moments ago: Works correctly here, too, now. Thank you. Peter ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

CVS build failure (was: Building the add-ons in libraries/...)

2004-11-05 Thread Peter Simons
Sven Panne writes: /html/chunk.xsl happy.xml warning: failed to load external entity /html/chunk.xsl It looks like configure hasn't found a DocBook XSL directory on your machine. Could you provide us with a little bit more information, please (log of the configure run, config.log,

Re: CVS build failure (was: Building the add-ons in libraries/...)

2004-11-05 Thread Peter Simons
And some more information on the issue. When I run the configure script, I see this error message on the screen (which probably won't make it into the config.log output): | checking for xmllint... /usr/bin/xmllint | checking for DocBook DTD... ok | checking for xsltproc... /usr/bin/xsltproc |

Building the add-ons in libraries/...

2004-11-02 Thread Peter Simons
The CVS version of the libraries tree comes with all kinds of neat and dangerously unstable code I'd like to use, particularly the arrows subdirectory. Now I wonder: Is there some build.mk magic I could perform to tell GHC to build these libraries as part of my normal build? So that I get them

Syntax error in happy/doc/happy.xml

2004-10-30 Thread Peter Simons
Index: happy/doc/happy.xml === RCS file: /cvs/fptools/happy/doc/happy.xml,v retrieving revision 1.7 diff -b -u -r1.7 happy.xml --- happy/doc/happy.xml 29 Oct 2004 08:26:53 - 1.7 +++ happy/doc/happy.xml 30 Oct 2004 12:18:32

Re: runInteractiveProcess is broken

2004-10-30 Thread Peter Simons
Simon Marlow writes: test1 :: IO () test1 = do (_,_,_, pid) - runInteractiveProcess /usr/bin/sleep [3] Nothing Nothing sleep 1 rc - waitForProcess pid print rc I can't repeat this, it works here: *Main test1 ExitSuccess *Main test2 Just ExitSuccess

Re: Is it safe to call getProcessExitCode more than once?

2004-10-30 Thread Peter Simons
Glynn Clements writes: Although, depending upon the OS, setting SIGCHLD to SIG_IGN may cause processes to be reaped automatically (i.e. not become zombies), so that's a possible alternative. I think I've got it under control now. I'm using this wrapper to make sure there are no

Re: getUserEntryForName weirdness

2004-10-30 Thread Peter Simons
Peter Simons writes: getUserEntryForName [] = print . userName wasabi I've updated the latest CVS HEAD (you never know) and tried it again. Some problem. In case it helps: http://peti.cryp.to/strace-getuserentry (8kb) Peter ___ Glasgow

getUserEntryForName weirdness

2004-10-29 Thread Peter Simons
Is anyone else seeing this on his system? getUserEntryForName [] = print . userName wasabi wasabi happens to be the last entry in the /etc/passwd file, and that is what I get every time I query for an user that doesn't exist. The source code promises an exception, but I don't get one.

Re: Is it safe to call getProcessExitCode more than once?

2004-10-26 Thread Peter Simons
John Goerzen writes: Assuming it is based on wait() or one of its derivatives, and I suspect it is, you cannot call it more than once for a single process. That's what I _assume_, too, but a definite answer would be nice. In the meanwhile, I have found out that it might not be safe to

runInteractiveProcess is broken

2004-10-26 Thread Peter Simons
Neither of these functions returns the return code of the external process as promised: import System.IO hiding ( catch, try ) import System.Process import Control.Concurrent sleep :: Int - IO () sleep n = threadDelay (abs(n) * 100) test1 :: IO () test1 = do (_,_,_, pid) -

Re: runInteractiveProcess is broken

2004-10-26 Thread Peter Simons
I managed to get runInteractiveProcess to work after all. Here is the code: import System.Posix.Signals import System.IO hiding ( catch, try ) import System.Exit ( ExitCode(..) ) import System.Process import Control.Concurrent import Child -- http://cryp.to/child/Child.hs test :: IO ()

Re: Are handles closed automatically when they fall out of scope?

2004-10-25 Thread Peter Simons
Simon Marlow writes: BTW, I assume you have a good reason for wanting to call terminateProcess Yes, I have to abort the process in case of an exception in my code. Just giving it EOF is not enough, unfortunately. Thanks a lot for taking the time to answer, Simon. I really appreciate it.

Re: Are handles closed automatically when they fall out of scope?

2004-10-25 Thread Peter Simons
John Goerzen writes: Now, if [I read with hGetContents h], then the first read I try to make using it works, but subsequent ones don't, since the first one made it half-closed already. Maybe I misunderstood something ... but why do you need to read from the stream multiple times after

Is it safe to call getProcessExitCode more than once?

2004-10-25 Thread Peter Simons
What will happen if I call getProcessExitCode for the same process twice? Will that block? Cause an error? Or return the same child's exit code again? I assume the function is (under Unix) based on wait(2), right? In that case, how does the following warning from the manual page translate to

Are handles closed automatically when they fall out of scope?

2004-10-22 Thread Peter Simons
I know it's a rather mundane question, but I couldn't find an answer to it! So what does happen when I forget to hClose a Handle? Will the garbage collector do that for me? Or not? And more specifically, what about the handles runInteractiveProcess returns? Do I have to close the stdin Handle?

Re: CVS HEAD ghc fails with Panic!

2004-10-21 Thread Peter Simons
Simon, I had answered to your e-mail almost two days ago, then I resent my reply today, but apparently my e-mail doesn't reach you! I see that it was delivered correctly here on my machine: Oct 21 18:56:51 peti sm-mta[11337]: i9LGunqM011335: to=[EMAIL PROTECTED],[EMAIL PROTECTED],

CVS HEAD ghc fails with Panic!

2004-10-20 Thread Peter Simons
Hi, the GHC version from the current CVS HEAD aborts with an internal error when doing this: $ darcs get http://cryp.to/hsemail $ cd hsemail $ ghc -O2 --make -o message-test message-test.hs | Chasing modules from: message-test.hs | Compiling Rfc2234 ( ./Rfc2234.hs, ./Rfc2234.o ) |

Re: ghc from CVS HEAD doesn't work with -O -threaded

2004-10-20 Thread Peter Simons
Simon Marlow writes: $ ghc -threaded -Wall -O --make test.hs -o test -ladns Should be fixed now. Just updated to the new version and tried it: The error is gone. Thank you very much. Peter ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED]

ghc from CVS HEAD doesn't work with -O -threaded

2004-10-19 Thread Peter Simons
The following reproducibly fails: $ darcs get http://cryp.to/hsdns [*] $ cd hsdns/ $ hsc2hs ADNS.hsc $ ghc -threaded -Wall -O --make test.hs -o test -ladns | Chasing modules from: test.hs | Compiling ADNS ( ./ADNS.hs, ./ADNS.o ) | /tmp/ghc2613.hc:9:23: ADNS_stub.h:

Re: Performance-loss of accessing data through class?

2004-10-14 Thread Peter Simons
Simon Marlow writes: class KnowsMyStuff a where foo :: a - Int bar :: a - Float etc :: a - [String] If I did that, how much performance would I lose? If your code is using a method from a known instance of a class, and the method has a small enough definition, then chances are

Re: -ddump-minimal-imports and -hidir / -odir

2004-10-14 Thread Peter Simons
Simon Marlow writes: A quick test doesn't show up anything obviously wrong. Can you give more details? It turned out the cause of the problem was a bug in my Makefile, not in GHC. I am sorry about that, I should have tested more before posting anything. I apologize. Peter

-ddump-minimal-imports and -hidir / -odir

2004-10-12 Thread Peter Simons
Hi, is it possible that GHC doesn't process the -hidir and -odir command-line options correctly when -ddump-minimal-imports is given as well? I have had this problem right now and removing the -(hi|o)dir flags fixed it, so I figured I'd better say something. ;-) Peter

Re: HEAD version hsc2hs malfunction

2004-10-11 Thread Peter Simons
I cvs-updated my copy moments ago, but I still get this error when compiling my ADNS.hsc bindings with the new version: /tmp/ghc12865.hc: In function `s8Ej_ret': /tmp/ghc12865.hc:6355: error: `ADNS_d7gS' undeclared (first use in this function) /tmp/ghc12865.hc:6355: error: (Each undeclared

Performance-loss of accessing data through class?

2004-10-09 Thread Peter Simons
Hi, in a module I am writing, I am using a 'StateT st IO' monad with a state like this: data MyState st = ST !Int !st My own monad is yet-another wrapper for ... another state monad. And that's getting inconvenient. So I wondered whether it would be good to define a class that unified all

HEAD version hsc2hs malfunction

2004-10-08 Thread Peter Simons
I have problems with the current HEAD version when compiling my ADNS bindings http://cryp.to/hsdns/ADNS.hsc. It appears that ghc has stopped passing the correct search path automatically, because with the new version I had to add an explicit -I/home/simons/projects/foo when compiling, or it

Re: threadsafe needed

2004-10-05 Thread Peter Simons
John Meacham writes: in particular system, rawSystem, and DNS lookups are important to be able to do concurrently. For DNS, there is a solution available here: http://cryp.to/hsdns/ Peter ___ Glasgow-haskell-users mailing list [EMAIL

Re: reading text files

2004-10-04 Thread Peter Simons
Carsten Schultz writes: I want to read a text file from a socket and process it as a String (using Parsec). Is hGetContent ok, or are there mor efficient alternatives available, even if I want a String anyway? hGetContents is fine, although you have to be aware that the function does not

Re: Is there a non-blocking version of hGetArray?

2004-10-03 Thread Peter Simons
Simon Marlow writes: I'm surprised if pointer access to memory is slower than unsafeRead. You were right. Now that I have made some tests, the problem turned out to be elsewhere. Pointer access is not to blame. ;-) Peter ___ Glasgow-haskell-users

hWaitForInput and timeouts

2004-10-03 Thread Peter Simons
Hi, I have another I/O problem. I need to time out when a Handle blocks forever. I am using hWaitForInput anyway, so that shouldn't be a problem, but the documentation says that using this feature will block all IO threads? Is it much work to fix this? I _could_ forkIO a racer thread myself, of

Re: Is there a non-blocking version of hGetArray?

2004-10-01 Thread Peter Simons
Simon Marlow writes: Not currently, but I could probably implement the equivalent (hGetArrayNonBlocking). If that were possible, I'd greatly appreciate it. I'm surprised if pointer access to memory is slower than unsafeRead. Could you post some code that we can peer at? Not right now,

Is there a non-blocking version of hGetArray?

2004-10-01 Thread Peter Simons
Hi, I am a happy user of hGetBufNonBlocking, but I have come to realize that mutable arrays are nicer to work with than pointers, so I have considered using hGetArray instead. I do, however, depend on the fact that the function returns as soon as it has read data -- even if less than requested

Re: Haddock: how to disable the JavaScript menus?

2004-09-28 Thread Peter Simons
While I am at it: There is another (rather simple) feature I'd like to see in Haddock. I often link to Haddock-generated documentation on my web pages, but there is no way for me to link _back_ from the Haddock output. Would it be possible to add command line switch to specify an up link and the

Re: Haddock: how to disable the JavaScript menus?

2004-09-28 Thread Peter Simons
Simon Marlow writes: The tree is expanded by default now (Sven Panne made the change a few days ago). I have rebuilt everything from CVS HEAD moments ago and the generated reference documentation still comes with the menus collapsed. Am I doing something wrong? Peter

Re: Haddock: how to disable the JavaScript menus?

2004-09-27 Thread Peter Simons
Simon Marlow writes: This change has now been made. Uh ... any hints what has changed? A new command line flag? we need a way to retain the collapsed/expanded state between page transitions (JavaScript hackers apply here!). I am not certain whether these collapsed menus are a good

newCString -- to 'free' or not?

2004-09-25 Thread Peter Simons
When I create a CString with Foreign.C.String.newCString, do I have to 'free' it after I don't need it anymore? Or is there some RTS magic taking place? How about Foreign.Marshal.Utils.new and all those other newXYZ functions? Peter ___

Re: Release candidate for 6.2.2 availabe

2004-09-23 Thread Peter Simons
Sven Panne writes: 1) The build fails: My fault, already fixed. Great. Just built the compiler from the scratch; works nicely now. 2) make distclean fails: I'll have a look into it. Also works correctly now. make XMLDocWays=html ps install-docs OK. :-) I changed

Re: Release candidate for 6.2.2 availabe

2004-09-20 Thread Peter Simons
I have some trouble building ghc from CVS HEAD. I'm not sure whether this applies to the release candidate version, too, but I figured I'd better report it anyway, just in case. 1) The build fails: | ../../ghc/compiler/ghc-inplace -M -optdep-f -optdep.depend | -optdep-s -optdepp -osuf o

Re: GHC CVS build...

2004-08-13 Thread Peter Simons
K P SCHUPKE writes: fptools/mk/config.h.in seems to be missing and nothing can be built. Run autoreconf -i in the checked-out copy of the repository to generate the dependent files. Peter ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED]

Stricts _

2004-07-13 Thread Peter Simons
ghci-6.3 (from CVS) shows me strictness information when I request :info for a data type, like: [...] Send Mailbox Stricts: _ [...] I have no idea how to read that output, and it doesn't seem to be documented in the manual either. Does the underscore signify that (in the example above)

Re: Socket Options

2004-06-28 Thread Peter Simons
Simon Marlow writes: I'm tempted to replace the current setSocketOption with this version. Would anyone object? On the contrary. IMHO, the SockOption type should be extended to contain the required parameter, for example: data SocketOption = Debug Bool | ReuseAddr Bool |

Re: Socket Options

2004-06-28 Thread Peter Simons
Glynn Clements writes: Am I even supposed to set them, or is there a better way to specify general I/O timeouts than on the socket level? Non-blocking I/O and select/poll; although I don't know how well that is supported. Can anyone tell me how well supported it is? What would happen if

Re: Socket Options

2004-06-28 Thread Peter Simons
Martin Sjögren writes: Wouldn't that make getSocketOption :: Socket - SocketOption - IO Int a bit strange? How would you propose to change it? Right, that is a problem. My first idea how to fix this would be getSocketOption :: Socket - SocketOption - IO SocketOption as in: Debug v

Re: Socket Options

2004-06-28 Thread Peter Simons
Simon Marlow writes: It doesn't say what happens to select() on a socket that times out, so I'm not sure what will happen if you try this in GHC. Okay, thanks for the information! Looks like a racer thread per timeout is the better approach after all. Peter

Re: Socket Options

2004-06-28 Thread Peter Simons
Simon Marlow writes: The runtime uses non-blocking I/O and select() internally in order to support multi-threaded I/O. We don't have any direct support for timeouts [...] Thanks for the clarification. I understand that. But what would happen if I _do_ set a timeout on the socket level

Re: Socket Options

2004-06-28 Thread Peter Simons
K P SCHUPKE writes: I believe a (unix) socket level problem (including remote server closing the connection unexpectedly) results in a Posix SigPIPE. No, it's an ordinary failure in the read()/write() operation. Quoting from socket(7): | SO_RCVTIMEO and SO_SNDTIMEO |Specify the

Socket Options

2004-06-25 Thread Peter Simons
Hi, the Network module provides the data type SocketOption. I am particularly interested in setting the RecvTimeOut and SendTimeOut values, but I wonder how to set them. The function setSocketOption :: Socket - SocketOption - Int - IO () allows me only 'Int' parameters, but the kernel expects

Re: optimization question

2004-02-23 Thread Peter Simons
Max Kirillov writes: [...] I will generate large case statements like the first form and want to know if I should bother pre-optimizing it to the second. I suppose such things should be made by flex-style generators. If you don't mind using FFI, the tool of choice would probably be

Non-exhaustive patterns in basicTypes/Var.lhs

2004-01-18 Thread Peter Simons
QuickCheck's 'generate' function works fine in GHCi, but only for the _first_ time I call it. After that, I get an error: | Ok, modules loaded: Main. | *Main generate 3 (mkStdGen 28) (return 'x') | Loading package QuickCheck ... linking ... done. | 'x' | | *Main generate 3 (mkStdGen 28)

Re: Transmitting Haskell values

2003-10-28 Thread Peter Simons
Joachim Durchholz writes: What sent me first into deep confusion is that I found all of {Text,GHC}.{Read,Show} first, and the Read classes marked as nonportable GHC extensions. Then you will surely love the Foreign.* hierarchy, most notably Foreign.Storable. If you want to do binary I/O

File permissions of /tmp files

2003-10-28 Thread Peter Simons
Hi, it appears that ghc (and ghci) create temporary files in /tmp during the un-lit phase, at least. It would be nice, if ghc would ... - create those files with read/write permission for the owner only, 0600. - set-up some atexit(3) job, or whatever, to make sure those files _are_

GHC and gcc 3.3.1

2003-10-20 Thread Peter Simons
Just curious: Has anyone successfully compiled GHC with gcc 3.3.1 on Linux/x86? I'm having trouble here with both GHC 6.0 and GHC-current. Is that just me? Peter ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED]

Re: Haddock interface file for standard libraries

2003-09-23 Thread Peter Simons
Simon Marlow writes: /usr/share/ghc-6.0.1/html/*/*.haddock. Hmm, why is it that every question I asks resolves in a way that makes me look blind or dumb? :-) Thanks for the quick help! Peter ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED]

Re: Installing _all_ documentation?

2003-09-22 Thread Peter Simons
Simon Marlow writes: The same technique works for Happy, Haddock Alex, except that some of these (I forget which) didn't have the doc directory included in the standard build, so you had to go into eg. happy/doc and say 'make install-docs' explicitly. Adding SGMLDocWays := html to each

Re: Installing _all_ documentation?

2003-09-18 Thread Peter Simons
Ian Lynagh writes: echo SGMLDocWays := html dvi ps mk/build.mk This works great! Is there any chance I can extend this technique so that it will include the documentation of, say happy, haddock, and alex as well? Peter P. S.: I'm sorry ... I guess I should really read the documentation

Installing _all_ documentation?

2003-09-17 Thread Peter Simons
Pardon me if this is a dumb question, but is there a make target, which I can use to install all documentation that comes with the build? I am aware of make install-docs, but this doesn't build nor install, say, the user's guide. Nor does it install documentation for Alex or Happy, even though I'm

GHC build fails without alex

2003-09-08 Thread Peter Simons
When building the current version of GHC from CVS without having alex installed, the build tries to use alex-inplace instead, but apparently the dependency that tells make(1) to build that executable before using it is missing. I had to execute make ProjectsThatExist=alex in the top level

Re: @-bindings broken in 6.0?

2003-06-24 Thread Peter Simons
Simon Peyton-Jones writes: -farrows Is this switch documented somewhere? I looked through the docs in the latest CVS version of GHC and couldn't find anything about it ... Peter ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED]

current CVS version doesn't compile

2003-06-18 Thread Peter Simons
I'm trying to compile the latest version of GHC from CVS on Linux, but the build reproducibly fails at this point: main/SysTools.lhs:703: Couldn't match `IO ExitCode' against `t - t1' Expected type: IO ExitCode Inferred type: t - t1 Probable cause:

Re: current CVS version doesn't compile

2003-06-18 Thread Peter Simons
Simon Marlow writes: What version of GHC are you compiling with? The Glorious Glasgow Haskell Compilation System, version 6.1 I built this version from CVS as well, maybe two or three days before the 6.0 version was released. Peter ___

Re: Dynamic Compilation

2003-06-11 Thread Peter Simons
Carsten Schultz writes: a web server written in Erlang that can compile [...] code embedded in HTML files to produce dynamic pages IMHO it should be possible to add a mod_runhugs module to Apache, which implements exactly that except that it doesn't require any compilation of code at all. As

Re: Dynamic Compilation

2003-06-11 Thread Peter Simons
Keean writes: http://losser.st-lab.cs.uu.nl/mod_haskell/ Interesting! But, think of the advantages of a type-safe web-server, utilising GHC's light weight threads... Well, yes, but the problem is that web server today must provide tons of things to be suitable for production use.

Problems building ghc-current

2003-05-28 Thread Peter Simons
Hi, I'm trying to compile the latest version of GHC from CVS. I followed the instructions on GHC's web page and everything worked just fine. But when I updated the sources with cvs update -dP as instructed, CVS checked-out pretty much everything the CVS repository carries. (Is that supposed to

Re: Problems building ghc-current

2003-05-28 Thread Peter Simons
Volker Stolz writes: Where did you find those instructions? At http://haskell.cs.yale.edu/ghc/docs/latest/html/building/sec-cvs.html: | 2.4. Updating Your Source Tree | | It can be tempting to cvs update just part of a source tree to bring in | some changes that someone else has made, or

Re: Problems building ghc-current

2003-05-28 Thread Peter Simons
Alastair Reid writes: The attached diff (about to be committed) seems to fix the problem. It does indeed -- thank you very much for your help! One problem remains, though: When I build GHC from the top-level directory, the build process does get the order right. It tries to build

Re: Problems building ghc-current

2003-05-28 Thread Peter Simons
Simon Marlow writes: CVS doesn't really support the structure of our source tree very well. Actually, it does. ;-) The problem is that »ghc«, »green-card«, »hood« et al. are subdirectories of »fptools«, that's why »cvs update -d« retrieves them automatically. I guess a more appropriate

Re: Problems building ghc-current

2003-05-28 Thread Peter Simons
Volker Stolz writes: [STABLE branch] Does the »STABLE« branch contain the meta-haskell extensions already? Because this was the reason I wanted to run the CVS version in the first place. :-) Oh, and I have news: The build does not work yet, unfortunately. It fails here: |

Re: Problems building ghc-current

2003-05-28 Thread Peter Simons
Simon Marlow writes: We could just rearrange the repository in place, and everything would still work, right? It's not quite that easy, unfortunately. If you want to retain the files's version history (and I guess you would), then you have to move the directories around in the CVS

Re: Two Questions: 'memory consumption' and '-pgmL'

2003-01-09 Thread Peter Simons
Simon Marlow writes: I would try -c first (turn on the compacting collector). Adding more generations (eg. -G3) might help, and setting a maximum heap size (eg. -M512m) will cause GHC to try to trim down its memory use when it gets close to this boundary. Unfortunately neither of that

Two Questions: 'memory consumption' and '-pgmL'

2003-01-08 Thread Peter Simons
Hi everybody, first of all, let me thank you for writing and maintaining this excellent compiler! I am using it a lot recently and I couldn't be more happy with it. Thanks! :-) I wouldn't be posting here, though, if hadn't had a questions ... So here I go: (1) Using the DtdToHaskell tool, I

  1   2   >