Re: Hugs with C preprocessor

2004-01-08 Thread Wolfgang Jeltsch
Am Mittwoch, 7. Januar 2004 20:37 schrieb Alastair Reid: I want to use Haskell files with #ifdef, #else and #endif preprocessor directives. I tried hugs -F cpp -P source_file_name but cpp complains about unterminated character constants. What is wrong? ANSI C preprocessors tend to get

Re: Combining distinct-thread state monads?

2004-01-08 Thread Dr Mark H Phillips
Hi Wolfgang, Thanks for your informative reply. At first I didn't understand it, but a search on StateT lead me to the paper Monad Transformers and Modular Interpreters by Liang, Hudak and Jones, which clarified some of the ideas for me. The state transformer approach seems to have advantageous

RE: class ??? with Haddock

2004-01-08 Thread Simon Marlow
How do I instruct Haddock to preprocess the Haskell files. From your mail I thought that Haddock would do so by default but it complains at the first #ifdef it sees. Unfortunately, I didn't find any Haddock option similar to Hugs' -F. I should really put this in the manual, since

Re: Combining distinct-thread state monads?

2004-01-08 Thread Wolfgang Jeltsch
Am Donnerstag, 8. Januar 2004 03:20 schrieben Sie: [...] Thanks for your informative reply. You're welcome. [...] One disadvantage is that it lacks symmetry in that one monad is arbitrarily chosen to sit inside the other. Yes, I see this as a disadvantage, too. I found another approach

Re: class ??? with Haddock

2004-01-08 Thread Wolfgang Jeltsch
Am Donnerstag, 8. Januar 2004 11:02 schrieb Simon Marlow: How do I instruct Haddock to preprocess the Haskell files. From your mail I thought that Haddock would do so by default but it complains at the first #ifdef it sees. Unfortunately, I didn't find any Haddock option similar to Hugs'

Re: Combining distinct-thread state monads?

2004-01-08 Thread Daan Leijen
Hi Mark, The state transformer approach seems to have advantageous in that it provides a framework for building new monads from old, and accessing the components. One disadvantage is that it lacks symmetry in that one monad is arbitrarily chosen to sit inside the other. You may want to read

Second Call for Papers : ESSLLI'04 Student Session

2004-01-08 Thread Paul Egré
!! We apologize for multiple copies of this message !! SECOND CALL FOR PAPERS ESSLLI-2004 STUDENT SESSION 9-20 August, 2004 in Nancy, France Deadline: February 22, 2004

Re: Hugs with C preprocessor

2004-01-08 Thread Wolfgang Jeltsch
Am Mittwoch, 7. Januar 2004 21:46 schrieb Wolfgang Jeltsch: [...] I tried hugs -F cpp -P -traditional but got the same error message as without -traditional. This message is, suprisingly, sh: line 1: /usr/lib/hugs/libraries/Hugs/Prelude.hs: Permission denied ERROR

Re: class ??? with Haddock

2004-01-08 Thread Wolfgang Jeltsch
Am Donnerstag, 8. Januar 2004 11:02 schrieben Sie: [...] Anyway, you can use GHC to preprocess your source files before feeding them to Haddock: $ ghc -E -cpp -D__HADDOCK__ Foo.hs -o Foo.raw-hs This only replaces all __HADDOCK__ occurences with 1 but doesn't process #ifdefs. [...]

RE: class ??? with Haddock

2004-01-08 Thread Simon Marlow
Am Donnerstag, 8. Januar 2004 11:02 schrieben Sie: [...] Anyway, you can use GHC to preprocess your source files before feeding them to Haddock: $ ghc -E -cpp -D__HADDOCK__ Foo.hs -o Foo.raw-hs This only replaces all __HADDOCK__ occurences with 1 but doesn't process

RE: class ??? with Haddock

2004-01-08 Thread Simon Marlow
Am Donnerstag, 8. Januar 2004 11:02 schrieben Sie: [...] Anyway, you can use GHC to preprocess your source files before feeding them to Haddock: $ ghc -E -cpp -D__HADDOCK__ Foo.hs -o Foo.raw-hs This only replaces all __HADDOCK__ occurences with 1 but doesn't

Re: class ??? with Haddock

2004-01-08 Thread Wolfgang Jeltsch
Am Donnerstag, 8. Januar 2004 17:39 schrieb Simon Marlow: [...] $ ghc -E -cpp -D__HADDOCK__ Foo.hs -o Foo.raw-hs This only replaces all __HADDOCK__ occurences with 1 but doesn't process #ifdefs. Are you sure? It works for me, and it's what we use in GHC's libraries. I found the

Re: class ??? with Haddock

2004-01-08 Thread Wolfgang Jeltsch
Am Donnerstag, 8. Januar 2004 17:44 schrieb Simon Marlow: [...] One thing I forgot to mention is that you also need to remove the pesky lines beginning with '#' that the C preprocessor leaves behind. Here's what we do in GHC: $ ghc -D__HADDOCK__ -E -cpp Foo.hs -o Foo.tmp $ sed

getting the path to the executing program

2004-01-08 Thread Hal Daume III
is there a function, related to getProgName, which returns the (absolute) path to the current program? basically, i want to be able to read a file which i know will be in the same directory as the current program, but not necessarily in the same directory that we're running it from. -- Hal

Re: getting the path to the executing program

2004-01-08 Thread Hal Daume III
Sadly, this doesn't seem to work: 9:26am albini:SVMseq/ cat Foo.hs module Main where import System.Environment main = getEnv _ = putStrLn 9:27am albini:SVMseq/ ghc Foo.hs -o foo 9:27am albini:SVMseq/ ./foo Fail: does not exist Action: getEnv Reason: no environment variable File: _ On Thu, 8

Re: getting the path to the executing program

2004-01-08 Thread Tomasz Zielonka
On Thu, Jan 08, 2004 at 09:06:44AM -0800, Hal Daume III wrote: is there a function, related to getProgName, which returns the (absolute) path to the current program? A non-portable Linux solution: System.Posix.readSymbolicLink /proc/self/exe Best regards, Tom -- .signature: Too many

Re: getting the path to the executing program

2004-01-08 Thread Per Larsson
On Thursday 08 January 2004 18.06, Hal Daume III wrote: is there a function, related to getProgName, which returns the (absolute) path to the current program? basically, i want to be able to read a file which i know will be in the same directory as the current program, but not necessarily in

Re: getting the path to the executing program

2004-01-08 Thread Tomasz Zielonka
On Thu, Jan 08, 2004 at 07:02:04PM +0100, Tomasz Zielonka wrote: On Thu, Jan 08, 2004 at 09:06:44AM -0800, Hal Daume III wrote: is there a function, related to getProgName, which returns the (absolute) path to the current program? A non-portable Linux solution:

Re: getting the path to the executing program

2004-01-08 Thread Lennart Augustsson
Hal Daume III wrote: is there a function, related to getProgName, which returns the (absolute) path to the current program? Well, the absolute path name is not necessarily unique, nor is it guaranteed to exist. :) -- Lennart ___ Haskell mailing list

Re: getting the path to the executing program

2004-01-08 Thread Hal Daume III
True. Replace the with a and ? with , if it exists?. On Thu, 8 Jan 2004, Lennart Augustsson wrote: Hal Daume III wrote: is there a function, related to getProgName, which returns the (absolute) path to the current program? Well, the absolute path name is not necessarily unique, nor is it

Re: getting the path to the executing program

2004-01-08 Thread Ferenc Wagner
Hal Daume III [EMAIL PROTECTED] writes: True. Replace the with a and ? with , if it exists?. On Thu, 8 Jan 2004, Lennart Augustsson wrote: Hal Daume III wrote: is there a function, related to getProgName, which returns the (absolute) path to the current program? Well, the absolute path

RE: Having difficulty with GHC 6.2 -main-is flag on Windows

2004-01-08 Thread Simon Marlow
Hi, I'm trying to use the new GHC -main-is flag to compile programs from files with module names other than Main, but it doesn't seem to be working. I've tried this under Windows 2000 and Windows XP. Here's my test program: [[ -- HelloWorld.hs -- module HelloWorld where module

RE: impossible in ghc 6.2

2004-01-08 Thread Simon Peyton-Jones
Aha. Got it. Consider case f x of (# a,b #) - if a0 then f x -- CSE opportunity else (# b,a #) GHC 6.2's CSE pass wrongly optimised this to: case f x of t (# a,b #) - if a0 then t

Announce: GHC 6.2 for Mac OS X Jaguar and Panther

2004-01-08 Thread Gregory Wright
Hello, A port of ghc-6.2 for Mac OS X (both Jaguar and Panther) is available from the darwinports system. Information on obtaining darwinports is available from http://darwinports.opendarwin.org. Once darwinports is installed, building ghc is done by changing to the lang/ghc directory and

RE: .hi-boot abuse

2004-01-08 Thread Simon Marlow
I have a question which came up as a result of some attempts to enforce seperate compilation. Suppose we have two modules as follows: -- A.hs module A (AbstractType) where data AbstractType = it's hidden implementation f :: AbstractType - String f _ = foo g ::

GHC 6.2, -main-is option under Windows, not working?

2004-01-08 Thread Graham Klyne
I'm trying to use the new GHC -main-is flag to compile programs under Windows from source files with module names other than Main, but it doesn't seem to be working. Details of my problem are at: http://haskell.org/pipermail/haskell/2004-January/013332.html Is it a bug, or something I'm

POpen, opening lots of processes

2004-01-08 Thread Hal Daume III
Hi, I'm using POpen to shell out to a command several hundreds or thousands of times per call (none of them simultaneous, though, this is completely serial). After running my program for a while, I get: Fail: resource exhausted Action: forkProcess Reason: Resource temporarily unavailable

Re: POpen, opening lots of processes

2004-01-08 Thread Glynn Clements
Hal Daume III wrote: I'm using POpen to shell out to a command several hundreds or thousands of times per call (none of them simultaneous, though, this is completely serial). After running my program for a while, I get: Fail: resource exhausted Action: forkProcess Reason: Resource

Re: POpen, opening lots of processes

2004-01-08 Thread Ferenc Wagner
Hal Daume III [EMAIL PROTECTED] writes: On Thu, 8 Jan 2004, Glynn Clements wrote: What does the output from ps indicate? It lists all the processes as defunct: 19981 pts/5Z 0:00 [suffixtree defunct] 19982 pts/5Z 0:00 [suffixtree defunct] 19983 pts/5Z 0:00

Re: POpen, opening lots of processes

2004-01-08 Thread Glynn Clements
Hal Daume III wrote: What does the output from ps indicate? It lists all the processes as defunct: 19981 pts/5Z 0:00 [suffixtree defunct] 19982 pts/5Z 0:00 [suffixtree defunct] 19983 pts/5Z 0:00 [suffixtree defunct] 19984 pts/5Z 0:00 [suffixtree

Re: Combining distinct-thread state monads?

2004-01-08 Thread Dr Mark H Phillips
On Tue, 2004-01-06 at 22:58, Graham Klyne wrote: I'm not an expert in this, but I think what you are proposing is possible, to a point, possibly assuming that your monads have associated functions to combine and separate the monadic parts. Thanks for the below illustration of how this

Help!!!!

2004-01-08 Thread Bhrein Brannick
Hi Guys, I’m a fourth year computer science in Ireland and I’m doing my final year project on Haskell programming. What I’m doing is writing a program in Haskell for the maths department for my college. What it involves is this: There is a class of 50 students and there are about 25 staff members.

Re: Help!!!!

2004-01-08 Thread Thomas Davie
htmldiv style='background-color:'PHi Guys,/P PI’m a fourth year computer science in Ireland and I’m doing my final year project on Haskell programming. What I’m doing is writing a program in Haskell for the maths department for my college. What it involves is this: There is a class of 50

Re: Help!!!!

2004-01-08 Thread Graham Klyne
I have two thoughts: It sounds as if you are using an algorithm that is inherently inefficient. It may be that you need to re-think the algorithm used to optimize assignment of projects for students based on their ranking. If the aggregate ranking is based on a linear combination of