Re: [Haskell-cafe] Caching the Result of a Transaction?

2008-04-26 Thread Jake Mcarthur
On Apr 26, 2008, at 7:18 PM, Conal Elliott wrote: Here's another angle on part of Jake's question: Can we implement a type 'TIVal a' (preferably without unsafePerformIO) with the following interface: newIVal :: STM (TIVal a, a -> STM ()) -- or IO (...) force :: TIVal a -> STM a

Re: [Haskell-cafe] Caching the Result of a Transaction?

2008-04-26 Thread Matthew Brecknell
Conal Elliott said: > Can we implement a type 'TIVal a' (preferably without unsafePerformIO) > with the following interface: > > newIVal :: STM (TIVal a, a -> STM ()) -- or IO (...) > force :: TIVal a -> STM a > > instance Functor IVal > instance Applicative IVal > insta

Re: [Haskell-cafe] announce: Glome.hs-0.3 (ray tracing digression, glome tutorial)

2008-04-26 Thread Jim Snow
David48 wrote: On Sat, Apr 26, 2008 at 9:33 AM, Andrew Coppin <[EMAIL PROTECTED]> wrote: > Personally, I don't see the point in rendering a couple of million > mathematically flat surfaces, What about speed ? That is a good point. Ray tracing may give you a better image approximati

Re: [Haskell-cafe] Caching the Result of a Transaction?

2008-04-26 Thread Conal Elliott
Here's another angle on part of Jake's question: Can we implement a type 'TIVal a' (preferably without unsafePerformIO) with the following interface: newIVal :: STM (TIVal a, a -> STM ()) -- or IO (...) force :: TIVal a -> STM a instance Functor IVal instance Applicative IV

Re: [Haskell-cafe] Trouble compiling collections-0.3 (from Hackage)

2008-04-26 Thread Jake Mcarthur
On Apr 26, 2008, at 4:25 PM, David F. Place wrote: Data/Collections.hs:154:17: Could not find module `Data.ByteString.Lazy': it is a member of package bytestring-0.9.0.4, which is hidden In the .cabal file, add "bytestring" to the dependencies property. - Jake __

[Haskell-cafe] Trouble compiling collections-0.3 (from Hackage)

2008-04-26 Thread David F. Place
Hi, I am not able to build collections-0.3 because on an error. I hope someone can give me a hint. Below, please find a short transcript with various version information. Cheers, David [EMAIL PROTECTED] ~]$ cd Desktop/collections-0.3 [EMAIL PROTECTED] collections-0.3]$ runghc Setup.hs co

Re: [Haskell-cafe] lookup tables & style guidelines

2008-04-26 Thread Jan-Willem Maessen
On Apr 26, 2008, at 7:41 AM, Adrian Hey wrote: Jan-Willem Maessen wrote: On Apr 24, 2008, at 11:33 AM, Adrian Hey wrote: Also, if you're likely to be using union/intersection a lot you should know that Data.Map/Set are very slow for this because they use the not efficient hedge algorithm :-

Re: [Haskell-cafe] announce: Glome.hs-0.3 (Haskell raytracer)

2008-04-26 Thread Andrew Coppin
david48 wrote: On Sat, Apr 26, 2008 at 9:33 AM, Andrew Coppin <[EMAIL PROTECTED]> wrote: Personally, I don't see the point in rendering a couple of million mathematically flat surfaces, What about speed ? Speed is not always the most important thing. ;-) ["The best things come

Re: [Haskell-cafe] announce: Glome.hs-0.3 (Haskell raytracer)

2008-04-26 Thread Sebastian Sylvan
On Sat, Apr 26, 2008 at 10:21 AM, david48 <[EMAIL PROTECTED]<[EMAIL PROTECTED]>> wrote: > On Sat, Apr 26, 2008 at 9:33 AM, Andrew Coppin > <[EMAIL PROTECTED]> wrote: > > > Personally, I don't see the point in rendering a couple of million > > mathematically flat surfaces, > > What about speed ? >

Re: [Haskell-cafe] asserting the type of a binding in a "do" expression

2008-04-26 Thread Philip Weaver
On Fri, Apr 25, 2008 at 11:49 PM, Brandon S. Allbery KF8NH <[EMAIL PROTECTED]> wrote: > > On Apr 26, 2008, at 2:36 , Ken Takusagawa wrote: > > > > But this does not: > > > > foo::IO a; > > foo = do{ > > (x::a) <- bar; > > return x;}; > > > > Error message: A pattern type signature cannot bin

Re: [Haskell-cafe] Replacing RDMS - why I want this retrying?

2008-04-26 Thread Mads Lindstrøm
Hi, Marc Weber wrote: > > Another question is why do you want to we replace RDBMS-es? > a) Speed. A simple HAppS state benchmark shows that inserting records >can be 10 times faster than MySQL >don't know wether its' because switching processes, parsing SQL queries ? You could try using

[Haskell-cafe] Caching the Result of a Transaction?

2008-04-26 Thread Jake Mcarthur
I have a problem I've been trying to work around using the existing STM API, and so far it seems that I may be unable to do it. For more background, see my blog post at . Here, for brevity, I will only describe exactly what I think I

Re: [Haskell-cafe] Replacing RDMS - why I want this retrying?

2008-04-26 Thread Marc Weber
> Have you looked at http://happs.org/ ? :) It should be used with HAppS. But it's only a state system. It doesn't tell you yet how to organize your data. The IxSet is nice but it's not relational. > Another question is why do you want to we replace RDBMS-es? a) Speed. A simple HAppS state benchma

[Haskell-cafe] Generic functional references for free, now!

2008-04-26 Thread Sterling Clover
Recent discussions inspired me to cook up the attached, which through controlled abuse of various extensions gives functional references for all records deriving Data and Typeable for free, with no template haskell necessary. Composition is fully supported, as is "overloading" of standard r

[Haskell-cafe] Simplest possible Fasta shootout entry. How do I zap the ugly line? Suggest any other improvements.

2008-04-26 Thread Richard Kelsall
(Extracting these questions from my previous thread for clarity.) Below is my simplest possible program to solve the Fasta shootout benchmark. http://shootout.alioth.debian.org/gp4/benchmark.php?test=fasta&lang=all http://haskell.org/haskellwiki/Shootout/Fasta I can see one remaining flaw - the

Re: [Haskell-cafe] Why doesn't GHC use the Hugs definition of splitAt to avoid traversing the first part of the list twice?

2008-04-26 Thread Richard Kelsall
Brandon S. Allbery KF8NH wrote: On Apr 26, 2008, at 9:02 , Richard Kelsall wrote: I'm now wondering why my splitAtRK function in the following code makes it run in 11 seconds given a parameter of 250 but it takes 14 seconds when I change it to splitAt. Am I accidentally invoking It's som

Re: [Haskell-cafe] Replacing RDMS - global lock and STM preventing retrying?

2008-04-26 Thread Mads Lindstrøm
Hi Marc Weber wrote: > What would be the right way to go to replace RDBMS (postgres/ mysql) etc > using haskell only for small to medium sized (web)applications? > I guess one way to go is using STM. > But what happens if you have some tables each row represented as TVar > and you'd like to do a f

Re: [Haskell-cafe] announce: Glome.hs-0.3 (Haskell raytracer)

2008-04-26 Thread Ketil Malde
david48 <[EMAIL PROTECTED]> writes: >> Personally, I don't see the point in rendering a couple of million >> mathematically flat surfaces, > What about speed ? "If it doesn't have to be correct, it can be arbitrarily fast" :-) -k -- If I haven't seen further, it is by standing in the footprin

[Haskell-cafe] Replacing RDMS - global lock and STM preventing retrying?

2008-04-26 Thread Marc Weber
What would be the right way to go to replace RDBMS (postgres/ mysql) etc using haskell only for small to medium sized (web)applications? I guess one way to go is using STM. But what happens if you have some tables each row represented as TVar and you'd like to do a full backup? Some occasionally oc

Re: [Haskell-cafe] Why doesn't GHC use the Hugs definition of splitAt to avoid traversing the first part of the list twice?

2008-04-26 Thread Brandon S. Allbery KF8NH
On Apr 26, 2008, at 9:02 , Richard Kelsall wrote: I'm now wondering why my splitAtRK function in the following code makes it run in 11 seconds given a parameter of 250 but it takes 14 seconds when I change it to splitAt. Am I accidentally invoking It's somewhat unusual to build the standa

Re: [Haskell-cafe] Why doesn't GHC use the Hugs definition of splitAt to avoid traversing the first part of the list twice?

2008-04-26 Thread Richard Kelsall
Duncan Coutts wrote: On Fri, 2008-04-25 at 17:30 +0100, Richard Kelsall wrote: I've just been investigating a performance oddity in using splitAt on a long stream of random numbers. I don't understand why GHC appears to want to traverse the first part of the list twice. GHC seems to implement t

Re: [Haskell-cafe] lookup tables & style guidelines

2008-04-26 Thread Adrian Hey
Jan-Willem Maessen wrote: On Apr 24, 2008, at 11:33 AM, Adrian Hey wrote: Also, if you're likely to be using union/intersection a lot you should know that Data.Map/Set are very slow for this because they use the not efficient hedge algorithm :-) OK, I'm going to bite here: What's the efficie

[Haskell-cafe] Function Type Calculation (revisited)

2008-04-26 Thread PR Stanley
Hi I know we've already looked at the topic of function type calculation though last time I didn't have the chance to go through it thoroughly. So here it is again. Apologies for the repetition. I've had a try at calculating function types for two examples below. So to start with I'd be gratef

Re[2]: [Haskell-cafe] n00b circular dep question

2008-04-26 Thread Bulat Ziganshin
Hello Stuart, Saturday, April 26, 2008, 1:57:47 PM, you wrote: > Are you sure? I would be very interested in a switch that > automatically generates hs-boot files, but I've been unable to find > any mention of it. no, i never used this function, so you should be informed better -- Best regard

Re: [Haskell-cafe] n00b circular dep question

2008-04-26 Thread Stuart Cook
On Sat, Apr 26, 2008 at 4:07 AM, Bulat Ziganshin <[EMAIL PROTECTED]> wrote: > 2. ghc supports this part of standard in a rather awkward way - you > need to generate .hs-boot files using some switch (look into docs). > which is like .h files generated automatic from .cpp. once these files > areg

Re: [Haskell-cafe] Why doesn't GHC use the Hugs definition of splitAt to avoid traversing the first part of the list twice?

2008-04-26 Thread Duncan Coutts
On Fri, 2008-04-25 at 17:30 +0100, Richard Kelsall wrote: > I've just been investigating a performance oddity in using splitAt > on a long stream of random numbers. I don't understand why GHC > appears to want to traverse the first part of the list twice. > > GHC seems to implement the splitAt fu

Re: Re[2]: a faster, accumulating mapM (was Re: [Haskell-cafe] mapM vs mapM_ performance)

2008-04-26 Thread Neil Mitchell
Hi > I didn't say I agree, I most certainly don't. What I meant with my > comment was that a slowdown of 10x, just to preserve laziness, is > perfect fuel for those who claim that laziness is good in theory but > bad in practice. A bad implementation of laziness will always be slower than a ba

Re: [Haskell-cafe] announce: Glome.hs-0.3 (Haskell raytracer)

2008-04-26 Thread david48
On Sat, Apr 26, 2008 at 9:33 AM, Andrew Coppin <[EMAIL PROTECTED]> wrote: > Personally, I don't see the point in rendering a couple of million > mathematically flat surfaces, What about speed ? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org htt

Re: [Haskell-cafe] asserting the type of a binding in a "do" expression

2008-04-26 Thread Henning Thielemann
On Sat, 26 Apr 2008, Ken Takusagawa wrote: This works (with -fglasgow-exts): foo::IO Int; foo = do{ (x::Int) <- bar; return x;}; bar = undefined But this does not: foo::IO a; foo = do{ (x::a) <- bar; return x;}; Error message: A pattern type signature cannot bind scoped type variab

Re: [Haskell-cafe] announce: Glome.hs-0.3 (Haskell raytracer)

2008-04-26 Thread Andrew Coppin
Jim Snow wrote: The Scene Description Language (SDL) is the best and worst thing about POV-Ray. Indeed. It's very intuitive and user-friendly, so a person can reasonably write a complex scene in pure code without using an external GUI editor. Not to mention that there's a smooth and continu

Re: [Haskell-cafe] announce: Glome.hs-0.3 (Haskell raytracer)

2008-04-26 Thread Andrew Coppin
Jon Harrop wrote: On Thursday 24 April 2008 20:29:50 Andrew Coppin wrote: 2. It's the only program I've seen that can render *real* curves, not fake trickery with triangle meshes. What you called "fake trickery with triangle meshes" is the core of all modern computer graphics. Focussi