[Haskell-cafe] Haskell DB bindings

2006-01-10 Thread oleg
[moved from the main Haskell-list: I'm afraid the HDB discussion on the Haskell mailing list had already been long] Tim Docker wrote on the Haskell mailing list The differences between HDBC and HSQL have been recently discussed. Where does Takusen fit into this picture? From the above, it

[Haskell-cafe] Re: hPutStrLn and hFlush

2006-01-10 Thread Simon Marlow
John Meacham wrote: Yeah. this is a major bug in ghc IMHO. I believe it has been fixed, but am unsure. It hasn't been fixed, this is the current behaviour and it's likely to stay that way, I'm afraid. We used to run finalizers on exit, but we stopped doing that for various reasons. Even

Re[2]: [Haskell-cafe] I/O and utf8

2006-01-10 Thread Bulat Ziganshin
Hello John, Tuesday, January 10, 2006, 2:08:44 AM, you wrote: i want to read a file encoded in utf8 and at a later time output portions of it on the console. Is there an easy way to do this in haskell? using the standard i/o functions i can read the file but the output gives me \1071 ...

Re: [Haskell-cafe] hPutStrLn and hFlush

2006-01-10 Thread Sebastian Sylvan
On 1/9/06, Gracjan Polak [EMAIL PROTECTED] wrote: Hi all, A bit strange behaviour with hPutStrLn. Consider following program: main = do handle - openFile output.txt WriteMode hPutStrLn handle (unlines contLines2) -- hFlush houtput where contLines2 = flip map

RE: Re[2]: [Haskell-cafe] I/O and utf8

2006-01-10 Thread Bayley, Alistair
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bulat Ziganshin i have the question about this issue - i also want to provide autodetection mechanism, which relies on first bytes of text files to set proper encoding. what is the standard rules to encode utf8/utf16 encoding

[Haskell-cafe] Fannkuch timings

2006-01-10 Thread Daniel Fischer
On my 1.2 GHz Duron (SuSE linux), I get significantly different timings than those on the wiki. Sebastian Sylvan's, Kimberley Burchett's and Bertram Felgenhauer's all take roughly thrice as long as posted (that's rather consistent, but the factor is surprisingly large). Cale Gibbard's takes

Re: [Haskell-cafe] Avoiding name collisions by using value spacesinstead of modules

2006-01-10 Thread Brian Hulley
Brian Hulley wrote: Cale Gibbard wrote: Unifying these two under a single operation is certainly trickier, and it's a little more questionable that it should be done at all, given that their types are so different -- below is the closest I could come to it off-hand. snip Thanks! I'm

[Haskell-cafe] RE: [Haskell] Haskell DB bindings (was Re: ANN: HDBC (HaskellDatabase Connectivity)

2006-01-10 Thread Bayley, Alistair
[Moving to café, too] There are three active database libraries: HDBC, HSQL and Takusen. It is quite disappointing from my point of view. Recently there was the same situation with the GUI libraires. The Haskell Community is quite small to waste efforts, developing different libraries for

Re: [Haskell-cafe] Fannkuch timings

2006-01-10 Thread Cale Gibbard
On 10/01/06, Daniel Fischer [EMAIL PROTECTED] wrote: On my 1.2 GHz Duron (SuSE linux), I get significantly different timings than those on the wiki. Sebastian Sylvan's, Kimberley Burchett's and Bertram Felgenhauer's all take roughly thrice as long as posted (that's rather consistent, but the

Re: [Haskell-cafe] RE: [Haskell] Haskell DB bindings (was Re: ANN: HDBC (HaskellDatabase Connectivity)

2006-01-10 Thread Björn Bringert
Bayley, Alistair wrote: [Moving to café, too] There are three active database libraries: HDBC, HSQL and Takusen. It is quite disappointing from my point of view. Recently there was the same situation with the GUI libraires. The Haskell Community is quite small to waste efforts, developing

Re: [Haskell-cafe] Fannkuch timings

2006-01-10 Thread Daniel Fischer
Am Dienstag, 10. Januar 2006 16:10 schrieben Sie: On 10/01/06, Daniel Fischer [EMAIL PROTECTED] wrote: On my 1.2 GHz Duron (SuSE linux), I get significantly different timings than those on the wiki. Sebastian Sylvan's, Kimberley Burchett's and Bertram Felgenhauer's all take roughly thrice

[Haskell-cafe] Space usage problems

2006-01-10 Thread Ian Lynagh
Hi all, I am having space issues with some decompression code; I've attached a much simplified version as Test1.hs. At the bottom (foo/bar) is the equivalent of deflate. This should be a standalone module which doesn't know about the rest. In the middle (readChunks) is the equivalent of

Re: [Haskell-cafe] Space usage problems

2006-01-10 Thread Chris Kuklewicz
I'll make a guess... Ian Lynagh wrote: Hi all, In the middle (readChunks) is the equivalent of gunzip. It repeatedly calls foo until there is no more input left. At the top is a simple main function that calls them. If I do dd if=/dev/zero of=data bs=1000 count=3000 # making

Re: [Haskell-cafe] Space usage problems

2006-01-10 Thread Ian Lynagh
On Tue, Jan 10, 2006 at 05:28:03PM +, Chris Kuklewicz wrote: I'll make a guess... Ian Lynagh wrote: Hi all, foo :: String - (String, String) foo = runState bar bar :: SecondMonad String bar = do inp - get case inp of [] - return []

[Haskell-cafe] rank-2 :(

2006-01-10 Thread Bulat Ziganshin
Hello , those rank-2 types wil make me mad :) encodeHelper :: (MRef m r, Binary m a, BitStream m (StringBuffer m r)) = a - m String encodeHelper x = do h - newStringBuffer stringBufferDefaultCloseFunc put_ h x getStringBuffer h encode x =

Re: [Haskell-cafe] Space usage problems

2006-01-10 Thread Chris Kuklewicz
I will continue to guess... Ian Lynagh wrote: On Tue, Jan 10, 2006 at 05:28:03PM +, Chris Kuklewicz wrote: I'll make a guess... Ian Lynagh wrote: Hi all, foo :: String - (String, String) foo = runState bar bar :: SecondMonad String bar = do inp - get case inp of

[Haskell-cafe] Intersection types for Haskell?

2006-01-10 Thread Brian Hulley
Hi - I'm wondering if there is any possiblility of getting intersection types into Haskell. For example, at the moment there is no (proper) typing for: f g x y = (g x, g y) Ideally, I'd like to be able to write: f:: (a - b c - d) - a - c - (b,d) or f :: (a - b a) - c - d - (b c,

RE: [Haskell-cafe] Intersection types for Haskell?

2006-01-10 Thread José Miguel Vilaça
Hi If I understand your problem than the following is a solution: -- {-# OPTIONS -fglasgow-exts #-} class Foo a b where g :: a - b type A = {- change the following -} Int type B = {- change the following -} Char instance Foo A B where

Re: [Haskell-cafe] Intersection types for Haskell?

2006-01-10 Thread Brian Hulley
José Miguel Vilaça wrote: Hi If I understand your problem than the following is a solution: -- {-# OPTIONS -fglasgow-exts #-} class Foo a b where g :: a - b type A = {- change the following -} Int type B = {- change the following -} Char

Re: [Haskell-cafe] In for a penny, in for a pound.

2006-01-10 Thread Isaac Gouy
--- Chris Kuklewicz [EMAIL PROTECTED] wrote: I have two strong suggestions: * whoever does submit them should diff the output with a previously accepted version. -snip- Simply diff program output with the example output file (there's now an output file link in each problem description). Of

Re: [Haskell-cafe] Intersection types for Haskell?

2006-01-10 Thread Taral
On 1/10/06, Brian Hulley [EMAIL PROTECTED] wrote: Hi - I'm wondering if there is any possiblility of getting intersection types into Haskell. For example, at the moment there is no (proper) typing for: f g x y = (g x, g y) Ideally, I'd like to be able to write: f:: (a - b c - d)

Re: [Haskell-cafe] Intersection types for Haskell?

2006-01-10 Thread Brian Hulley
Taral wrote: On 1/10/06, Brian Hulley [EMAIL PROTECTED] wrote: Hi - I'm wondering if there is any possiblility of getting intersection types into Haskell. For example, at the moment there is no (proper) typing for: f g x y = (g x, g y) Ideally, I'd like to be able to write: f:: (a -

Re: [Haskell-cafe] Intersection types for Haskell?

2006-01-10 Thread Brian Hulley
Brian Hulley wrote: Taral wrote: I have no idea what kind of function would have type (a - b c - d). Can you give an example? g x = x because g 3 = 3 so g has type Int - Int but also g 'a' = 'a' so g has type Char - Char hence g has type Int - Int Char - Char Actually I should have said

Re: [Haskell-cafe] Re: hPutStrLn and hFlush

2006-01-10 Thread John Meacham
On Tue, Jan 10, 2006 at 09:40:41AM +, Simon Marlow wrote: John Meacham wrote: Yeah. this is a major bug in ghc IMHO. I believe it has been fixed, but am unsure. It hasn't been fixed, this is the current behaviour and it's likely to stay that way, I'm afraid. We used to run

Re[2]: [Haskell-cafe] Fannkuch timings

2006-01-10 Thread Bulat Ziganshin
Hello Daniel, Tuesday, January 10, 2006, 7:40:24 PM, you wrote: DF These are user/MUT times, at the moment, my machine is busy, so that elapsed DF time is about double that, otherwise these times are rather consistently DF reproduced (between 8.4 and 8.9 for pure, 1.7 and 1.9 for impure, clean

Re: [Haskell-cafe] Space usage problems

2006-01-10 Thread Daniel Fischer
Am Dienstag, 10. Januar 2006 17:44 schrieb Ian Lynagh: Hi all, I am having space issues with some decompression code; I've attached a much simplified version as Test1.hs. At the bottom (foo/bar) is the equivalent of deflate. This should be a standalone module which doesn't know about the

Re: [Haskell-cafe] Space usage problems

2006-01-10 Thread Ian Lynagh
On Tue, Jan 10, 2006 at 04:44:33PM +, Ian Lynagh wrote: readChunks :: FirstMonad String readChunks = do xs - get if null xs then return [] else do let (ys, zs) = foo xs put zs

Re: [Haskell-cafe] Fannkuch timings

2006-01-10 Thread Daniel Fischer
Am Dienstag, 10. Januar 2006 19:11 schrieben Sie: Hello Daniel, Tuesday, January 10, 2006, 7:40:24 PM, you wrote: DF These are user/MUT times, at the moment, my machine is busy, so that elapsed DF time is about double that, otherwise these times are rather consistently DF reproduced

Re: [Haskell-cafe] Fannkuch timings

2006-01-10 Thread Donald Bruce Stewart
daniel.is.fischer: Am Dienstag, 10. Januar 2006 19:11 schrieben Sie: Hello Daniel, Tuesday, January 10, 2006, 7:40:24 PM, you wrote: DF These are user/MUT times, at the moment, my machine is busy, so that elapsed DF time is about double that, otherwise these times are rather

Re: [Haskell-cafe] rank-2 :(

2006-01-10 Thread Ross Paterson
On Tue, Jan 10, 2006 at 08:47:32PM +0300, Bulat Ziganshin wrote: those rank-2 types wil make me mad :) encodeHelper :: (MRef m r, Binary m a, BitStream m (StringBuffer m r)) = a - m String encodeHelper x = do h - newStringBuffer stringBufferDefaultCloseFunc

Re: [Haskell-cafe] Intersection types for Haskell?

2006-01-10 Thread Brian Hulley
Brian Hulley wrote: snip which is perhaps clearer and prevents bad types such as (Int - String Int - Char) by construction. Oops! I forgot that functions with such types can exist via multi-parameter type classes and overloading - this may be one reason why intersection types have not yet

Re: [Haskell-cafe] Intersection types for Haskell?

2006-01-10 Thread David Menendez
Brian Hulley writes: Also, as a second point, could functional dependencies in type classes be written using a similar syntax eg instead of class Insert t c a | c a - t where insert :: t - c a - c a we could write: class Insert (h (c a)) c a where insert :: h