Re: [Haskell-cafe] Scope of type variables in associated types

2007-06-08 Thread Manuel M T Chakravarty
Matthew Sackman wrote: Andres Loeh [EMAIL PROTECTED] wrote: class OneStep a data OS a :: * instance OneStep (Cons v t) data OS (Cons v t) = t class TwoStep a data TS a :: * instance (OneStep a, OneStep b) = TwoStep a instance (OneStep a, OneStep (OS a)) = TwoStep a ? Doesn't

Re: [Haskell-cafe] OK, so this VIM thing -- how do I make it actually work?

2007-06-08 Thread Arthur van Leeuwen
On 5-jun-2007, at 10:58, Michael T. Richter wrote: I've given up on getting a decent text editor for editing Haskell (specifically literate Haskell -- plain Haskell works fine in GEDIT). Instead I fire up VIM and get ... a total mess. At first I think maybe I've screwed up a whole bunch

Re: [Haskell-cafe] haskell version of fractal benchmark

2007-06-08 Thread Andrew Coppin
Donald Bruce Stewart wrote: Some things to remember using Doubles: * {-# OPTIONS -fexcess-precision #-} * -fvia-C * -fbang-patterns * -optc-O2 -optc-mfpmath=sse -optc-msse2 * -optc-march=pentium4 1. What do all those things do? 2. Is the effect actually that large?

[Haskell-cafe] Re: Parallelism and expensive calculations that may not be needed

2007-06-08 Thread Simon Marlow
Felipe Almeida Lessa wrote: (Sorry if this is a newbie question, couldn't find the answer anywhere) Suppose I have an expensive function (such that even to be reduced to WHNF it takes a long processing time) expensive :: Foo - Maybe Bar and I want to calculate it on multiple processors,

RE: [Haskell-cafe] haskell version of fractal benchmark

2007-06-08 Thread Bayley, Alistair
[mailto:[EMAIL PROTECTED] On Behalf Of Andrew Coppin Donald Bruce Stewart wrote: Some things to remember using Doubles: * {-# OPTIONS -fexcess-precision #-} * -fvia-C * -fbang-patterns * -optc-O2 -optc-mfpmath=sse -optc-msse2 * -optc-march=pentium4 1. What

Re: [Haskell-cafe] haskell version of fractal benchmark

2007-06-08 Thread Donald Bruce Stewart
andrewcoppin: Donald Bruce Stewart wrote: Some things to remember using Doubles: * {-# OPTIONS -fexcess-precision #-} * -fvia-C * -fbang-patterns * -optc-O2 -optc-mfpmath=sse -optc-msse2 * -optc-march=pentium4 1. What do all those things do? Check the GHC

Re: [Haskell-cafe] HopenGL

2007-06-08 Thread Ruben Zilibowitz
Hi, Thanks. I eventually figured it out by doing pretty much what you suggested with Lines.hs. I discovered that the thing that made lines come out only in black was: lighting $= Enabled So disabling lighting before drawing lines and re-enabling it afterwards allows me to draw colored

[Haskell-cafe] Re: ghc wiki registration failure ( was: Failure in GHC compilation)

2007-06-08 Thread Simon Marlow
Daniil Elovkov wrote: I wanted to add a couple of words that another solution would be to add an option to xargs in target.mk xargs -n NNN where NNN is less than the OS limit. (That helped me to build LambdaVM on windows, there are quite a lot of class files there, and no SPLITOBJS

RE: [Haskell-cafe] haskell version of fractal benchmark

2007-06-08 Thread Bayley, Alistair
[mailto:[EMAIL PROTECTED] On Behalf Of Donald Bruce Stewart 3) -fbang-patterns Better than `seq` Better in the more convenient to write sense, right? AFAIUI, seq and bang patterns should be equivalent. Alistair *

Re: [Haskell-cafe] Optimising UTF8-CString - String marshaling, plus comments on withCStringLen/peekCStringLen

2007-06-08 Thread Alistair Bayley
Simon, You're right, both versions should give the same code. Which version of GHC are you using? Both with the HEAD and with 6.6.1 I get the nice unboxed code with the `seq` version too. My test program is below. I'm using 6.6, so I'll upgrade to 6.6.1 and retest. Preusmably you're only

Re: [Haskell-cafe] haskell version of fractal benchmark

2007-06-08 Thread Donald Bruce Stewart
Alistair_Bayley: [mailto:[EMAIL PROTECTED] On Behalf Of Donald Bruce Stewart 3) -fbang-patterns Better than `seq` Better in the more convenient to write sense, right? AFAIUI, seq and bang patterns should be equivalent. Yes, in the 'more convenient' sense. Adding strictness

[Haskell-cafe] Re: haskell wiki indexing

2007-06-08 Thread Simon Marlow
Jason Dagit wrote: On 5/22/07, Robin Green [EMAIL PROTECTED] wrote: On Tue, 22 May 2007 15:05:48 +0100 Duncan Coutts [EMAIL PROTECTED] wrote: On Tue, 2007-05-22 at 14:40 +0100, Claus Reinke wrote: so the situation for mailing lists and online docs seems to have improved, but there is

Re: [Haskell-cafe] haskell version of fractal benchmark

2007-06-08 Thread Andrew Coppin
Bayley, Alistair wrote: [mailto:[EMAIL PROTECTED]] On Behalf Of Andrew Coppin Donald Bruce Stewart wrote: Some things to remember using Doubles: * {-# OPTIONS -fexcess-precision #-} * -fvia-C * -fbang-patterns * -optc-O2 -optc-mfpmath=sse -optc-msse2

Re: [Haskell-cafe] HopenGL

2007-06-08 Thread Jon Harrop
On Friday 08 June 2007 01:19:02 Jason Dagit wrote: Did you remember to do all the double buffering operations? Did you setup the clear color first? One thing that you have to be careful about with OpenGL is that you correctly manage the state of the opengl machine. Haskell should have a

Re: [Haskell-cafe] type versus data declarations

2007-06-08 Thread Alfonso Acosta
Hola Emilio! On 6/7/07, Emilio Jesús Gallego Arias [EMAIL PROTECTED] wrote: Hello, I'm wondering why you can write data FSet a = Show a = M (a - Double) a :: FSet Double a = M $ \x - 0 and it works, but type FSet a = Show a = (a - Double) type only works for redefinitions (i.e.

Re: [Haskell-cafe] Fast number parsing with strict bytestrings [Was: Re: Seemingly subtle change causes large performance variation]

2007-06-08 Thread Bulat Ziganshin
Hello Donald, Friday, June 8, 2007, 5:42:41 AM, you wrote: Previous experience[1] indicates it is pretty hard to write a C line parsing program[2] that that run this fast. And the code, with comments: [2] uses gets() function while your haskell code read whole buffer each time. that is the

[Haskell-cafe] Re: Parallelism and expensive calculations that may not be needed

2007-06-08 Thread Felipe Almeida Lessa
On 6/8/07, Simon Marlow [EMAIL PROTECTED] wrote: The problem occurs when you've found the Nothing, but the rest of the list has already been sparked. You really want to throw away all those sparks, but there's no way to do that currently. One way you could improve the situation though is to

[Haskell-cafe] killThread on a terminated thread.

2007-06-08 Thread Bit Connor
Hello, Is it safe to use killThread to terminate a thread that has already terminated(it's IO action has run to completion)? Or are ThreadIds reused, potentially causing an unwanted thread to be terminated? I'm using ghc 6.6 Thanks, bit ___

[Haskell-cafe] Re: type versus data declarations

2007-06-08 Thread Emilio Jesús Gallego Arias
Hi Alfonso! Alfonso Acosta [EMAIL PROTECTED] writes: type FSet a = Show a = (a - Double) type only works for redefinitions (i.e. adding the |Show a| constraint makes FSet a different type to (a - Double)). Yes, I know. What I mean, if type is a type macro, why cannot it expand type

[Haskell-cafe] Re: [Haskell] ANN: Catch (first ever release)

2007-06-08 Thread Neil Mitchell
Following up on haskell-cafe: Hi Chris, For the last few years I've been working on a pattern-match checker for Haskell, named Catch. I'm now happy to make a release: I would love to use this with regex-tdfa (and the other regex-* modules). At the moment regex-tdfa is uses a few extensions

RE: [Haskell-cafe] haskell version of fractal benchmark

2007-06-08 Thread Simon Peyton-Jones
3) -fbang-patterns Better than `seq` Do you mean more convenient than or generates better code than. I don't think the latter should be true; send a counterexample if you find one! Simon ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] class MonoidBreak?

2007-06-08 Thread Alex Jacobson
Ok how about this class: class (Monoid m) = MonoidBreak m where mbreak::m-m-m And the condition is mappend (mbreak y z) y == z -Alex- Dan Piponi wrote: On 6/7/07, Alex Jacobson [EMAIL PROTECTED] wrote: Is there a standard class that looks something like this: class (Monoid m) =

[Haskell-cafe] Data polymorphism ?

2007-06-08 Thread Phlex
Hello all, I have this class which gives a common interface to (UniqueIndex a k) and (MultiIndex a k) : class (Show a, Key_ k) = Index_ i a k | i - k, k - a where buildKey :: (a - k) insertIndex :: Id - a - i - Maybe i deleteIndex :: Id - a - i - i updateIndex :: Id - a - a - i -

[Haskell-cafe] Re: Parallelism and expensive calculations that may not be needed

2007-06-08 Thread Simon Marlow
Felipe Almeida Lessa wrote: On 6/8/07, Simon Marlow [EMAIL PROTECTED] wrote: The problem occurs when you've found the Nothing, but the rest of the list has already been sparked. You really want to throw away all those sparks, but there's no way to do that currently. One way you could improve

[Haskell-cafe] Data polymophism

2007-06-08 Thread Phlex
Hello all, It seems this message was lost somehow, so i'm trying to send it again sorry if it comes up twice on the list ! I have this class which gives a common interface to (UniqueIndex a k) and (MultiIndex a k) : class (Show a, Key_ k) = Index_ i a k | i - k, k - a where buildKey

Re: Re[2]: [Haskell-cafe] Re: Keys and Maps [Was: Re: I just don't get it (data structures and OO)]

2007-06-08 Thread J. Garrett Morris
On 6/8/07, Bulat Ziganshin [EMAIL PROTECTED] wrote: I second that. I particularly like the elimination of ]'s. We certainly need some symbol to separate the map and the key; but we do really need to also mark here be the end of the key? and how (arr ! key ++ data) should be parsed? :)

[Haskell-cafe] LaTeX

2007-06-08 Thread Andrew Coppin
Does anybody know what the magical LaTeX command is to turn (say) ++ into two overprinted pluses? (As seems to be fashionable...) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Data polymophism

2007-06-08 Thread Christian Maeder
Phlex schrieb: I have this class which gives a common interface to (UniqueIndex a k) and (MultiIndex a k) : I do not understand this class (Show a, Key_ k) = Index_ i a k | i - k, k - a where buildKey :: (a - k) this method buildKey is not sufficient to derive the type i in an

Re: [Haskell-cafe] LaTeX

2007-06-08 Thread Andrés Sicard Ramírez
You can define \newcommand{\pp}{+ \hspace{-0.2cm} +} On 6/8/07, Andrew Coppin [EMAIL PROTECTED] wrote: Does anybody know what the magical LaTeX command is to turn (say) ++ into two overprinted pluses? (As seems to be fashionable...) ___

Re: [Haskell-cafe] Data polymophism

2007-06-08 Thread Tomasz Zielonka
On Fri, Jun 08, 2007 at 05:23:23PM +0200, Phlex wrote: But i don't seem to find a way to get out of this DbIndex type to actually work on the enclosed index. for instance, this doesn't work: liftDbIndex (DbIndex index) fun = DbIndex (fun index) The compiler probably can't infer

Re: [Haskell-cafe] Re: type versus data declarations

2007-06-08 Thread Alfonso Acosta
Hi again, On 6/8/07, Emilio Jesús Gallego Arias [EMAIL PROTECTED] wrote: I guess this is due to types like type A a = Show a = a type B a = Show a = a You're right. This is not valid in the standard nor GHC. so if you do f :: A a - B b it should get translated to f :: (Show a = a) -

Re: [Haskell-cafe] Re: type versus data declarations

2007-06-08 Thread Alfonso Acosta
On 6/8/07, Alfonso Acosta [EMAIL PROTECTED] wrote: Yep, you're right. a is alredy universally quantified in the RHS. This is probably what you're looking for: type FSet a = forall a. Show a = FSet (a - Double) I meant type FSet a = forall a. Show a = (a - Double)

Re: [Haskell-cafe] LaTeX

2007-06-08 Thread Alfonso Acosta
On 6/8/07, Andrés Sicard Ramírez [EMAIL PROTECTED] wrote: You can define \newcommand{\pp}{+ \hspace{-0.2cm} +} Why 0.2cm? Wouldn't that depend on the font size? using ems as the hspace size sounds more reasonable. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: Memoization

2007-06-08 Thread Peter Berry
Sorry for digging up such an old thread, but my undergraduate dissertation is on this topic so I couldn't resist. :) (Some credit in the following goes to my supervisor, Ulrich Berger.) Mark Engelberg wrote: I'd like to write a memoization utility. Ideally, it would look something like

[Haskell-cafe] Problem when class function doesn't mention all type parameters or...

2007-06-08 Thread Daniil Elovkov
Hi again So, I keep trying to implement the dsl, I mentioned yesterday. I ran into a problem which can be illustrated by the following small example. class Cl s1 a1 s2 a2 where clF :: a1 - a2 clF doesn't mention s1 and s2, they're used only to restrict types below data T s a where C

Re: [Haskell-cafe] Re: type versus data declarations

2007-06-08 Thread Brandon S. Allbery KF8NH
On Jun 8, 2007, at 16:25 , Emilio Jesús Gallego Arias wrote: Yeah, in general Haskell types don't carry constraints, however, I don't see the reason that this doesn't work when using type level macros, as type F a = C a = a should just be a macro and substitute. It is. That's the

Re: [Haskell-cafe] Re: Memoization

2007-06-08 Thread Peter Berry
On 08/06/07, Peter Berry [EMAIL PROTECTED] wrote: You could generate F and the Memoizable instance using TH or DrIFT or the like (allowing derivation would be really nice :). Actually F could be considered a dependent type, so you could define a pretty much universal instance using TH with that

Re: [Haskell-cafe] class MonoidBreak?

2007-06-08 Thread Stefan O'Rear
On Fri, Jun 08, 2007 at 07:24:09AM -0700, Alex Jacobson wrote: Dan Piponi wrote: On 6/7/07, Alex Jacobson [EMAIL PROTECTED] wrote: Is there a standard class that looks something like this: class (Monoid m) = MonoidBreak m where mbreak::a-m a-(m a,m a) I think you have some kind of

Re: [Haskell-cafe] LaTeX

2007-06-08 Thread Andrés Sicard Ramírez
On 6/8/07, Alfonso Acosta [EMAIL PROTECTED] wrote: \newcommand{\pp}{+ \hspace{-0.2cm} +} Why 0.2cm? Wouldn't that depend on the font size? You are right. It depends on the font size. using ems as the hspace size sounds more reasonable. Yes, we can define \pp in this way, or we can

Re: [Haskell-cafe] Data polymophism

2007-06-08 Thread Tomasz Zielonka
On Fri, Jun 08, 2007 at 07:49:20PM +0200, Tomasz Zielonka wrote: On Fri, Jun 08, 2007 at 05:23:23PM +0200, Phlex wrote: But i don't seem to find a way to get out of this DbIndex type to actually work on the enclosed index. for instance, this doesn't work: liftDbIndex (DbIndex index)