RE: [Haskell-cafe] the case of the 100-fold program speedup

2006-11-16 Thread Simon Peyton-Jones
Don't knock it! Using a functional language helped you to think about the problem in a new way, and throw together a prototype that worked in a short enough time that you actually did it. A merit of fp is, I think, that you can explore the algorithm design space much more quickly -- and

Re: [Haskell-cafe] Newbie; Can't Install Hat From Source

2006-11-16 Thread Malcolm Wallace
Aditya Siram [EMAIL PROTECTED] wrote: I have been trying to install Hat for the last couple of days but GHC does not recognize it as a package. I compiled 2.05 from source, but at the 'make install' step I see this error message: Installing hat package for ghc under

[Haskell-cafe] Generalizing zip

2006-11-16 Thread Jason Dagit
In #haskell on freenode we had a discussion about isPrefixOf, which is probably implemented roughly as so: isPrefixOf [] _ = True isPrefixOf _ [] = False isPrefixOf (x:xs) (y:ys) = x == y isPrefixOf xs ys Well, this is basically just a zip with a special base case. But you can't just write it

[Haskell-cafe] ghc 6.2 and wxhaskell

2006-11-16 Thread Leandro Maia
Hi Maybe this is not the best place to post this question, but here a lot of people will see and can direct me to the right place. I'm using Linux Slackware 10.2 and 11.0, GHC 6.2 and wxWidgets 2.6.X, 2.7.x I have already tried all kind of combinations but never worked. I tried: GHC 6.2 ,

Re: [Haskell-cafe] Generalizing zip

2006-11-16 Thread Bjorn Bringert
On 16 nov 2006, at 11.46, Jason Dagit wrote: In #haskell on freenode we had a discussion about isPrefixOf, which is probably implemented roughly as so: isPrefixOf [] _ = True isPrefixOf _ [] = False isPrefixOf (x:xs) (y:ys) = x == y isPrefixOf xs ys Well, this is basically just a zip with a

[Haskell-cafe] Re: what GUI library should i select?

2006-11-16 Thread Eric Willigers
Bulat Ziganshin bulat.ziganshin at gmail.com writes: Hello haskell-cafe, afaik, there are just two good enough libs - wxHaskell and GtkHs. can anyone point (or write) detailed comparison of their features? i plan to write large GUI program in Haskell and want to select best one. Putting

[Haskell-cafe] Implicit params and typeclasses

2006-11-16 Thread Grzegorz Chrupała
Hi all, When I try to compile the following in GHC (v 6.6) (with -fno-monomorphism-restriction -fimplicit-params) class Configuration a where thestring:: a - String foo c = let { ?c = c } in bar bar = thestring ?c I get: Ambiguous type variable `a' in the constraint: `Configuration a'

[Haskell-cafe] discouraging unsafePerformIO (Was: Debugging partial functions by the rules)

2006-11-16 Thread Henning Thielemann
On Wed, 15 Nov 2006 [EMAIL PROTECTED] wrote: ... I'd be quite happy seeing fromJust removed from the standard libraries, or at least tagged `deprecated' or with the stigma attached that is rightfully accorded to unsafePerformIO. However, unsafe* functions are still recommended by Haskell

Re: [Haskell-cafe] Re: Debugging partial functions by the rules

2006-11-16 Thread David House
On 16/11/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: And if we are absolutely positive that the value is (Just x), we can always write maybe (assert False undefined) id v It should be pointed out that Data.Maybe does export a less well-known function, fromMaybe: fromMaybe z = maybe

[Haskell-cafe] Re: Generalizing zip

2006-11-16 Thread Jón Fairbairn
Jason Dagit [EMAIL PROTECTED] writes: Well, this is basically just a zip with a special base case. But you can't just write it with zipWith because zipWith stops when it exausts either list. How about we define zipWith'' like this: zipWith'' _ [] _ l _ = [l] zipWith'' _ _

Re: [Haskell-cafe] type keeping rounding, typeable (and a difficulty)

2006-11-16 Thread isto
ke, 2006-11-15 kello 13:31 -0800, Greg Buchholz kirjoitti: isto wrote: ] let t = show (typeOf a) ] in case t of ] Double - roundDDec d a ] Complex Double - roundCDec d a Maybe you want type classes instead? yes, I was blind... Thanks! I'll guess

Re: [Haskell-cafe] type keeping rounding, typeable (and a difficulty)

2006-11-16 Thread Greg Buchholz
isto wrote: ] isto wrote: ] ] let t = show (typeOf a) ] ] in case t of ] ] Double - roundDDec d a ] ] Complex Double - roundCDec d a ] ] I'll guess the reason it didn't compile was different ] types at case branches (am I wrong?) Correct. ] Anyhow, do you know

Re: [Haskell-cafe] Re: what GUI library should i select?

2006-11-16 Thread Sebastian Sylvan
On 11/16/06, Eric Willigers [EMAIL PROTECTED] wrote: Bulat Ziganshin bulat.ziganshin at gmail.com writes: Hello haskell-cafe, afaik, there are just two good enough libs - wxHaskell and GtkHs. can anyone point (or write) detailed comparison of their features? i plan to write large GUI

[Haskell-cafe] 'type' for isomorphism [was poorly named: aggressiveness of functional dependencies]

2006-11-16 Thread Nicolas Frisby
If anyone is interested, the solution to my problem was to use a type synonym instead of an isomorphism class. Pros: - Not susceptible to the functional dependencies/overlapping instances/open-world issue - Very simple (in fact that simplicity migrated into the rest of the system) Cons: -

[Haskell-cafe] topEq for types

2006-11-16 Thread Nicolas Frisby
I'm sharing what I think is a novel extension of TypeEq. Please 1) cope with my introduction of the motivating problem 2) inform me if something similar has already been presented 3) criticize the solution This presentation is quite a simplification of my actual problem/code, but I'm trying to

Re: [Haskell-cafe] Squash ladder software in Haskell

2006-11-16 Thread Tony Morris
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello fellow squashy, Sorry I cannot provide any software references for you, but I have had similar thoughts to yourself. In particular, I keep a track of my win rate for one of the competitions I play in - but I do this manually. Each time I do, I

Re: [Haskell-cafe] Re: Debugging partial functions by the rules

2006-11-16 Thread Donald Bruce Stewart
dmhouse: On 16/11/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: And if we are absolutely positive that the value is (Just x), we can always write maybe (assert False undefined) id v It should be pointed out that Data.Maybe does export a less well-known function, fromMaybe:

Re: [Haskell-cafe] Re: Debugging partial functions by the rules

2006-11-16 Thread Donald Bruce Stewart
dons: dmhouse: On 16/11/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: And if we are absolutely positive that the value is (Just x), we can always write maybe (assert False undefined) id v It should be pointed out that Data.Maybe does export a less well-known function,

Re: [Haskell-cafe] Re: Debugging partial functions by the rules

2006-11-16 Thread S. Alexander Jacobson
As long as we are doing this, perhaps we should also discourage the use of (head list)? -Alex- __ S. Alexander Jacobson tel:917-770-6565 http://alexjacobson.com On Fri, 17 Nov 2006, Donald Bruce Stewart wrote: dons: dmhouse: On