[Haskell-cafe] Re: Creating static libraries using GHC

2006-01-18 Thread Simon Marlow
Tom Hawkins wrote: I have a chunk of Haskell code I would like wrap up and distribute as a library. Is there a way to build a static library (*.a) that includes my code plus the Haskell runtime, which C programs can easily link against? Here is what I have tried so far... ghc --make -fffi

Re: [Haskell-cafe] Re: [Haskell] Simple IO Regions

2006-01-18 Thread Keean Schupke
Taral wrote: On 1/17/06, Keean Schupke [EMAIL PROTECTED] wrote: Just made a few modifications and thought it might be useful to people. I have rewritten the functions as liftR and bracketR over a MonadIO monad interface (allowing monad-transformers to be used). I'm sorry, but what

Re: [Haskell-cafe] Re: [Haskell] Simple IO Regions

2006-01-18 Thread Taral
On 1/18/06, Keean Schupke [EMAIL PROTECTED] wrote: It didnt when I wrote the MonadIO stuff that I use! Here is the missing file ... I tried to put it all in one, but missed the use of up3. (see attached) All I see is up3 = undefined... somehow I don't think that will work. As far as I know,

Re: [Haskell-cafe] Re: [Haskell] Simple IO Regions

2006-01-18 Thread Keean Schupke
up3 is quite easy to define, but it is specific to the monad-transformer you are lifting through... see attached for definition for the state-monad-transformer. Keean. Taral wrote: On 1/18/06, Keean Schupke [EMAIL PROTECTED] wrote: It didnt when I wrote the MonadIO stuff that I use!

Re: [Haskell-cafe] Re: [Haskell] Simple IO Regions

2006-01-18 Thread Taral
On 1/18/06, Keean Schupke [EMAIL PROTECTED] wrote: up3 is quite easy to define, but it is specific to the monad-transformer you are lifting through... see attached for definition for the state-monad-transformer. Ah, you're using undefined for the state. If you're going to do that, though, why

[Haskell-cafe] compiling lazy functional languages

2006-01-18 Thread Sam Goldman
Sorry if this is too off-topic for this list. I'm a hobbyist programmer and I've recently become interested in lazy functional languages, particularly the optimization strategies available to them during compilation. I've been playing around with Haskell for about a year and it has been an

Re: [Haskell-cafe] compiling lazy functional languages

2006-01-18 Thread Sebastian Sylvan
On 1/18/06, Sam Goldman [EMAIL PROTECTED] wrote: Sorry if this is too off-topic for this list. I'm a hobbyist programmer and I've recently become interested in lazy functional languages, particularly the optimization strategies available to them during compilation. I've been playing around

Re: [Haskell-cafe] How to redirect a handle within a thread (GHC 6.4.1 runtime)?

2006-01-18 Thread Donn Cave
On Wed, 18 Jan 2006, Dimitry Golubovsky wrote: Is it possible to redirect a Handle (say stdout) somewhere only within a running thread (started with forkIO) not touching the same handle for the main and other threads? I think it's fairly simple, if I have understood your requirement. I assume

Re: [Haskell-cafe] How to redirect a handle within a thread (GHC 6.4.1 runtime)?

2006-01-18 Thread Benjamin Franksen
On Wednesday 18 January 2006 19:01, Dimitry Golubovsky wrote: Is it possible to redirect a Handle (say stdout) somewhere only within a running thread (started with forkIO) not touching the same handle for the main and other threads? I have a lot of code written with putStr(Ln) which was used

Re: [Haskell-cafe] How to redirect a handle within a thread (GHC 6.4.1 runtime)?

2006-01-18 Thread Robert Dockins
On Jan 18, 2006, at 2:59 PM, Benjamin Franksen wrote: On Wednesday 18 January 2006 19:01, Dimitry Golubovsky wrote: Is it possible to redirect a Handle (say stdout) somewhere only within a running thread (started with forkIO) not touching the same handle for the main and other threads? I

[Haskell-cafe] Packed String parameters

2006-01-18 Thread Scherrer, Chad
To read a file using a packed string, I need to use this function, right? hGetPS :: Handle - Int - IO PackedString What's the Int? Do you have to specify the length in advance? I don't know how packed strings are implemented, and I'm having trouble finding much documentation. I'm trying to

Re: [Haskell-cafe] How to redirect a handle within a thread (GHC 6.4.1 runtime)?

2006-01-18 Thread Bulat Ziganshin
Hello Dimitry, Wednesday, January 18, 2006, 9:01:28 PM, you wrote: DG new Handle. Rewriting the code is not a convenient way (but will be DG done if nothing else helps) because then I will need to pass that DG handle around. implicit parameter or global IORef may save father of russian

Re: [Haskell-cafe] compiling lazy functional languages

2006-01-18 Thread Bernard Pope
On Wed, 2006-01-18 at 13:38 -0500, Sam Goldman wrote: Sorry if this is too off-topic for this list. I'm a hobbyist programmer and I've recently become interested in lazy functional languages, particularly the optimization strategies available to them during compilation. I've been playing

[Haskell-cafe] How to redirect a handle...

2006-01-18 Thread Dimitry Golubovsky
Thanks everybody who answered. Indeed, forkProcess is something I completely overlooked... -- Dimitry Golubovsky Anywhere on the Web ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: [Haskell] Simple IO Regions

2006-01-18 Thread Andrew Pimlott
On Tue, Jan 17, 2006 at 06:13:14PM +, Keean Schupke wrote: Just made a few modifications and thought it might be useful to people. I have rewritten the functions as liftR and bracketR over a MonadIO monad interface (allowing monad-transformers to be used). This is now usable as