[Haskell-cafe] POSIX AIO (asych I/O) ...

2008-07-01 Thread Galchin, Vasili
Hello, I am also testing my aio support. The aio_write binding seems to work ok .. as well as aio_error, Aio_return is a problem child. I think I wrote a really simple binding. I always receive nbytes as 0. I have been staring at the code hoping to catch a stupid mistake. I put putStrLn's

Re: [Haskell-cafe] POSIX AIO (asych I/O) ...

2008-07-01 Thread Bulat Ziganshin
Hello Vasili, Tuesday, July 1, 2008, 11:42:26 AM, you wrote: looks ok, show us your peek/poke code Hello,    I am also testing my aio support. The aio_write binding seems to work ok .. as well as aio_error, Aio_return is a problem child. I think I wrote a really simple binding. I

Re: [Haskell-cafe] The ping method in HDBC

2008-07-01 Thread Agent Zhang
On Mon, Jun 30, 2008 at 9:31 PM, John Goerzen [EMAIL PROTECTED] wrote: run dbh SELECT 1 [] I note from the Perl DBI documentation that it is not guaranteed that its ping function actually does anything. Okay, thanks :) I am pondering connection pools in HDBC for the future, if I have the

Re: [Haskell-cafe] A Monad for on-demand file generation?

2008-07-01 Thread Joachim Breitner
Hi, thanks for your comments. Am Montag, den 30.06.2008, 16:54 -0700 schrieb Ryan Ingram: 1) unsafeInterleaveIO seems like a big hammer to use for this problem, and there are a lot of gotchas involved that you may not have fully thought out. But you do meet the main criteria (file being read

Re: [Haskell-cafe] POSIX AIO (asych I/O) ...

2008-07-01 Thread Galchin, Vasili
instance Storable AIOCB where sizeOf _ = (#const sizeof (struct aiocb)) alignment _ = 1 poke p_AIOCB (AIOCB aioFd aioLioOpcode aioReqPrio aioOffset aioBuf aioBytes aioSigevent) = do (#poke struct aiocb, aio_fildes) p_AIOCB aioFd (#poke struct aiocb, aio_lio_opcode)

Re: [Haskell-cafe] A Monad for on-demand file generation?

2008-07-01 Thread Ketil Malde
Joachim Breitner [EMAIL PROTECTED] writes: 1) unsafeInterleaveIO seems like a big hammer to use for this problem, and there are a lot of gotchas involved that you may not have fully thought out. But you do meet the main criteria (file being read is assumed to be constant for a single run of

Re: [Haskell-cafe] A Monad for on-demand file generation?

2008-07-01 Thread Joachim Breitner
Hi, Am Dienstag, den 01.07.2008, 11:53 +0200 schrieb Ketil Malde: Joachim Breitner [EMAIL PROTECTED] writes: 1) unsafeInterleaveIO seems like a big hammer to use for this problem, and there are a lot of gotchas involved that you may not have fully thought out. But you do meet the main

[Haskell-cafe] Anglo Haskell 2008

2008-07-01 Thread Matthew Sackman
Anglo Haskell is a gathering of all people Haskell-related from beginners, to seasoned hackers to academic giants. All and more are welcomed by large fuzzy green lambdas. Anglo Haskell has happened for the last two years and we see no reason why it should not happen again this year. For the last

Re: [Haskell-cafe] lhs syntax highlighting in vim

2008-07-01 Thread Arthur van Leeuwen
On 11 jun 2008, at 12:29, Ian Lynagh wrote: On Wed, Jun 11, 2008 at 01:23:58AM +0100, Eric Stansifer wrote: The syntax highlighting file for literate haskell in vim says that its maintainer is haskell-cafe@haskell.org, so hopefully one of you will find this relevant. In literate haskell

Re: [Haskell-cafe] A Monad for on-demand file generation?

2008-07-01 Thread David Roundy
On Tue, Jul 01, 2008 at 10:22:35AM +, Joachim Breitner wrote: Hi, Am Dienstag, den 01.07.2008, 11:53 +0200 schrieb Ketil Malde: Joachim Breitner [EMAIL PROTECTED] writes: 1) unsafeInterleaveIO seems like a big hammer to use for this problem, and there are a lot of gotchas

Re: [Haskell-cafe] A Monad for on-demand file generation?

2008-07-01 Thread Henning Thielemann
On Tue, 1 Jul 2008, David Roundy wrote: Indeed, the best option (in my opinion) would be unsafeInterleaveIO readFileStrict How about ByteString.readFile ? This is strict and efficient. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] gcc as a portable assembler: tail calls vs trampoline

2008-07-01 Thread Loup Vaillant
Hello, everyone, I'm not sure this is the good list for this posting: I plan to write yet another lazy graph reduction machine, using gcc, mainly for fun. My concern right now is about one particular aspect of gcc: the tail calls vs trampoline deathmatch. First some clarifications: - By tail

Re: [Haskell-cafe] gcc as a portable assembler: tail calls vs trampoline

2008-07-01 Thread Loup Vaillant
2008/7/1 Robin Green [EMAIL PROTECTED]: I think you should use the -march flag to gcc. Otherwise you are tying the compiler to an ancient version of the x86 instruction set (386). OK, let's try... Done. I used -march=nocona. I couldn't do core2 (not available on my gcc 4.1.2 yet). Did not

Re: [Haskell-cafe] gcc as a portable assembler: tail calls vs trampoline

2008-07-01 Thread Peter Verswyvelen
Did you look at the generated assembly code? Although I don't know anything about GCC, I believe it's easy to let it generate an assembly listing file. Loup Vaillant wrote: 2008/7/1 Robin Green [EMAIL PROTECTED]: I think you should use the -march flag to gcc. Otherwise you are tying the

Re: [Haskell-cafe] A Monad for on-demand file generation?

2008-07-01 Thread Ryan Ingram
On 7/1/08, Joachim Breitner [EMAIL PROTECTED] wrote: Hi, thanks for your comments. Am Montag, den 30.06.2008, 16:54 -0700 schrieb Ryan Ingram: 1) unsafeInterleaveIO seems like a big hammer to use for this problem, and there are a lot of gotchas involved that you may not have fully

Re: [Haskell-cafe] A Monad for on-demand file generation?

2008-07-01 Thread Joachim Breitner
Hi, thanks again for you input. Just one small remark: Am Dienstag, den 01.07.2008, 14:52 -0700 schrieb Ryan Ingram: On 7/1/08, Joachim Breitner [EMAIL PROTECTED] wrote: Am Montag, den 30.06.2008, 16:54 -0700 schrieb Ryan Ingram: 1) unsafeInterleaveIO seems like a big hammer to use for

Re: [Haskell-cafe] A Monad for on-demand file generation?

2008-07-01 Thread Brandon S. Allbery KF8NH
On 2008 Jul 1, at 17:52, Ryan Ingram wrote: Well, you're also (from your description) probably writing some tracking information to an IORef of some sort. That can happen in the middle of an otherwise pure computation, and it's difficult to know exactly when it'll get triggered, due to

[Haskell-cafe] Re: POSIX AIO (asych I/O) ...

2008-07-01 Thread Galchin, Vasili
Hello, Haskell 101 question! I discovered that aio_error returns errno rather -1. Of course, my aio_error binding is called before my aio_return binding (aio calling sequence protocol). I have worked on Posix OS's for quite a while but am unhappy with non-consistent errno handling ;^(. In