Re: H98 Text IO

2008-02-26 Thread John Vogel
Why not leave the defaults as they ARE OR USE utf-8 and give the programmer the capability to specify what encoding they want when they want to use a different one? John ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org

Re: Some problems writing a threaded program

2008-02-11 Thread John Vogel
Thankyou both Don Stewart and Simon Marlow for your responses. By adding yield and threadDelay in certain spots I have at least prevented some of the threads from being starved of CPU time. The only issue now is that terminateProcess doesn't always terminate netstat.exe in the cmd.exe so I

Some problems writing a threaded program

2008-02-10 Thread John Vogel
I am running my program in WinXP with ghc 2.6.8 If you install netstat and change the parameters it should still work in linux. Why does thread # 3 dominate over the over threads int the output? Why does thread # 4 never seem to run? I can't use the sleep function in System.Process.Win32 since

Re: [Haskell] Simulating client server communication with recursive monads

2008-01-14 Thread John Vogel
If you redefine as follows: server :: [Integer] - Writer [String] [Integer] server [] = return [] server (a:as) = do tell [Server ++ show a] rs - server as return (a:rs) You get this for the output: [Server 0,Server 1,Server 2,Server 3,Server 4,Server 5,Server 6,Server 7,Server 8,Server

How do you get the process id out of the ProcessHandle in Win XP?

2007-12-19 Thread John Vogel
Here is what I have tried: module Main where import System.Process -- using runInteractiveProcess import System.Posix.Types import System.Process.Internals import Control.Concurrent.MVar main = do (input,output,err,ph) - runInteractiveProcess calc.exe ([]) Nothing Nothing p - Main.getPID

Re: Foreign C with pointers

2007-12-18 Thread John Vogel
You do realize that the example you gave is just as general as all the tutorials. Here is an example I was working, but it gives a *segmentation fault* for some reason: example.h typedef struct { unsigned char a; unsigned char b; unsigned char c; unsigned char d; } IP; IP* shiftIP(IP* addr);

Re: Can't seem to figure how to compile

2007-10-23 Thread John Vogel
Yup, that fixed the problem. Thanks for your help. :) On 10/22/07, Simon Marlow [EMAIL PROTECTED] wrote: John Vogel wrote: Running ghc 6.6.1 On Windows Vista I get this error when I run: ghc Main.hs gcc: installation problem, cannot exec `as': No such file or directory

Can't seem to figure how to compile

2007-10-21 Thread John Vogel
Running ghc 6.6.1 On Windows Vista I get this error when I run: ghc Main.hs gcc: installation problem, cannot exec `as': No such file or directory On this code: module Main where main = do putStrLn Please enter your name: name - getLine putStrLn (Hello, ++ name ++ , how are you?)

Re: Can't seem to figure how to compile

2007-10-21 Thread John Vogel
It is the default gcc with ghc. ghci works just fine which invokes ghc --interactive. But this command does work: ghc -e Main.main Main.hs But there is no executable. On 10/21/07, Matthew Danish [EMAIL PROTECTED] wrote: On Sun, Oct 21, 2007 at 01:46:16PM -0500, John Vogel wrote: gcc