[Haskell-cafe] Re: overlapping instances, selecting if type a does not belong to class?

2007-02-27 Thread oleg
The problem you report can be fixed with some trickery and local functional dependencies. I'd like to show a different solution, which follows a useful general pattern, of isolating overlapping instances to one small part of the program that analyzes the type. The rest of the type program just use

Re: [Haskell-cafe] Re: problems installing ghc 6.6 with extralibs (bad interface file)

2007-02-27 Thread Paul Brown
On 2/27/07, Seth Gordon <[EMAIL PROTECTED]> wrote: Thomas Hartman wrote: > Thanks. I incorporated these changes, and it cranks longer now before > failing. But still fails, now with a seg fault. According to conventional wisdom, when gcc segfaults on a big compilation job (e.g., the Linux kernel)

Re: [Haskell-cafe] Plotting in Haskell

2007-02-27 Thread Tim Docker
Chirs Witte wrote: > Are there any good libraries for drawing plots (2D and 3D) in Haskell > (under Windows using GHC)? Dons has already mentioned my charting library: http://dockerz.net/software/chart.html This is 2D only for now. "good" depends your perspective :-) It is (intended to be)

Re: [Haskell-cafe] Re: problems installing ghc 6.6 with extralibs (bad interface file)

2007-02-27 Thread Seth Gordon
Thomas Hartman wrote: > Thanks. I incorporated these changes, and it cranks longer now before > failing. But still fails, now with a seg fault. > * > gcc: Internal error: Segmentation fault (program cc1) > Please submit a full bug report. > See http://gcc.gnu.org/bugs.html> for instruct

Re: [Haskell-cafe] Plotting in Haskell

2007-02-27 Thread Ricardo Herrmann
http://dockerz.net/software/chart.html This one just appeared in programming.reddit.com today, but it's 2D only. Uses cairo for rendering On 2/27/07, Chris Witte <[EMAIL PROTECTED]> wrote: Are there any good libraries for drawing plots (2D and 3D) in Haskell (under Windows using GHC)? Cheers

Re: [Haskell-cafe] Plotting in Haskell

2007-02-27 Thread Donald Bruce Stewart
cwitte: > Are there any good libraries for drawing plots (2D and 3D) in Haskell > (under Windows using GHC)? There's the 'charts' library, http://dockerz.net/software/chart.html Alternatively, a binding to gnuplot is pretty trivial to hack up (see darcs-graph): http://www.cse.unsw.edu.au/

[Haskell-cafe] Plotting in Haskell

2007-02-27 Thread Chris Witte
Are there any good libraries for drawing plots (2D and 3D) in Haskell (under Windows using GHC)? Cheers Chris Witte ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] What inhabits this type: (forall a. a -> b) -> (forall a. m a -> m b)

2007-02-27 Thread Neil Mitchell
Hi I have looked on Hoogle. I would have asked Djinn, but I don't have it around. So, can someone find a term that inhabits (forall a. a -> b) -> (forall a. m a -> m b) Asking hoogle about rank-2 types won't get you very far, the development version of Hoogle gives a warning that it ignores

Re: [Haskell-cafe] Re: problems installing ghc 6.6 with extralibs (bad interface file)

2007-02-27 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thomas Hartman wrote: > Thanks. I incorporated these changes, and it cranks longer now before > failing. But still fails, now with a seg fault. > > Does this just mean I don't have enough ram, or cpu, or ... Any ideas? > [...] > gcc: Internal error: S

Re: [Haskell-cafe] What inhabits this type: (forall a. a -> b) -> (forall a. m a -> m b)

2007-02-27 Thread Nicolas Frisby
The type doesn't actually indicate that the type m supports a return operation. I introduced the qualifier that it was a functor. You implicity introduced the constraint that it is a monad (actually a "pointed functor", but that's a Monad's return operator). With that constraint, your thought proc

Re: [Haskell-cafe] Re: [Haskell] [Fwd: Re: Computer Language Shootout]

2007-02-27 Thread Claus Reinke
It'd be interesting to get the real code for this. Partly to just try optimising it but more so as a real test case for list/array fusion. As far as I see, there's no reason that consuming an assoc list of a bool vector with a foldl' (the ' is probably essential) should be slow. If it's fused pro

Re: [Haskell-cafe] What inhabits this type: (forall a. a -> b) -> (forall a. m a -> m b)

2007-02-27 Thread Bryan Burgers
Since my last query was answered so quickly, let's try another. I have looked on Hoogle. I would have asked Djinn, but I don't have it around. So, can someone find a term that inhabits (forall a. a -> b) -> (forall a. m a -> m b) ? I think of this as the type of functions that, given a functio

Re: [Haskell-cafe] What inhabits this type: (forall a. a -> b) -> (forall a. m a -> m b)

2007-02-27 Thread Nicolas Frisby
At the risk of seeming terribly naive, I'm going to go ahead and share my intuition. Would not any function of type (forall a. a -> b) be a constant function in b? If the function is allowed no inspection of its argument, it must not depend on its argument. The same intuition could be applied to

Re: [Haskell-cafe] What inhabits this type: (forall a. a -> b) -> (forall a. m a -> m b)

2007-02-27 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jacques Carette wrote: > Since my last query was answered so quickly, let's try another. > > I have looked on Hoogle. I would have asked Djinn, but I don't have it > around. So, can someone find a term that inhabits > (forall a. a -> b) -> (forall a

Re: [Haskell-cafe] What inhabits this type: (forall a. a -> b) -> (forall a. m a -> m b)

2007-02-27 Thread Stefan O'Rear
On Tue, Feb 27, 2007 at 06:01:44PM -0500, Jacques Carette wrote: > Since my last query was answered so quickly, let's try another. > > I have looked on Hoogle. I would have asked Djinn, but I don't have it No you couldn't. Djinn doesn't support rank2 types. (FWIW you can go to #haskell at cha

[Haskell-cafe] What inhabits this type: (forall a. a -> b) -> (forall a. m a -> m b)

2007-02-27 Thread Jacques Carette
Since my last query was answered so quickly, let's try another. I have looked on Hoogle. I would have asked Djinn, but I don't have it around. So, can someone find a term that inhabits (forall a. a -> b) -> (forall a. m a -> m b) ? I think of this as the type of functions that, given a funct

Re: [Haskell-cafe] Logic programming using lazy evaluation

2007-02-27 Thread Chris Kuklewicz
Henning Thielemann wrote: > I suspect that someone has already done this: A Haskell library which > solves a system of simple equations, where it is only necessary to derive > a value from an equation where all but one variables are determined. Say > > 1+2=x -- add 1 2 x > y*z=20 -- times

[Haskell-cafe] Re: [Haskell] [Fwd: Re: Computer Language Shootout]

2007-02-27 Thread Andrzej Jaworski
On 2/26/07, Kirsten Chevalier honored me with his attention: >Can you clarify what you mean by this? How do you formally prove that >a programming language (rather than a specific implementation of one) >performs better for a given problem? (..) It is about my saying:"SML was exhaustively proved

Re: [Haskell-cafe] Re: [Haskell] [Fwd: Re: Computer Language Shootout]

2007-02-27 Thread Duncan Coutts
On Tue, 2007-02-27 at 16:51 +, Claus Reinke wrote: > okay, profiling was not available for the Haskell version back then, but > using ML > profiling to improve a Haskell version sounds highly dangerous to me, even > more > so if the authors do not even mention any awareness of this danger.

Re: [Haskell-cafe] Re: Trouble with record syntax and classes

2007-02-27 Thread Albert Y. C. Lai
Thomas Nelson wrote: data ISine = Sine Integer Integer Integer String | MetaSine Integer Integer Integer [ISine] Having advised you to use different field names for different record types last time, I now confuse you by saying you can share field names in the different cases insid

Re: [Haskell-cafe] Logic programming using lazy evaluation

2007-02-27 Thread Henning Thielemann
On Tue, 27 Feb 2007, Ulf Norell wrote: > On 2/27/07, Henning Thielemann <[EMAIL PROTECTED]> wrote: > > > > I suspect that someone has already done this: A Haskell library which > > solves a system of simple equations, where it is only necessary to derive > > a value from an equation where all but

Re: [Haskell-cafe] Declaring variance of class parameters?

2007-02-27 Thread Ross Paterson
On Tue, Feb 27, 2007 at 02:00:29PM -0500, Jacques Carette wrote: > If I have a class, say > class Symantics repr where > int:: Int -> repr Int > > and so on, I would like to *require* that 'repr' be covariant. Is there > any way to do that? class Functor repr => Symantics repr would b

[Haskell-cafe] Declaring variance of class parameters?

2007-02-27 Thread Jacques Carette
If I have a class, say class Symantics repr where int:: Int -> repr Int and so on, I would like to *require* that 'repr' be covariant. Is there any way to do that? Jacques ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.or

[Haskell-cafe] Re: overlapping instances, selecting if type a does not belong to class?

2007-02-27 Thread Marc Weber
> However, it seems that your particular problem can be solved with > simpler means: > > > instance (HList a) => HListAppendArbitrary a HNil a where > > hAppendArbitrary a _ = a > > instance (HList a, HList b, HList c) > > => HListAppendArbitrary a (HCons b d) c where > > hAppendArbitrary

[Haskell-cafe] Re: [Haskell] [Fwd: Re: Computer Language Shootout]

2007-02-27 Thread Claus Reinke
I hoped at least to stimulate interest in repeating GP experiment with latest GHC version. until that happens, I'd be wary to draw too many conclusions for today's applications from this paper. two orders of magnitude difference would seem to imply programming problems to me (though the author

Re: [Haskell-cafe] Logic programming using lazy evaluation

2007-02-27 Thread Ulf Norell
On 2/27/07, Henning Thielemann <[EMAIL PROTECTED]> wrote: I suspect that someone has already done this: A Haskell library which solves a system of simple equations, where it is only necessary to derive a value from an equation where all but one variables are determined. Say You might want to c

[Haskell-cafe] Re: problems installing ghc 6.6 with extralibs (bad interface file)

2007-02-27 Thread Thomas Hartman
Thanks. I incorporated these changes, and it cranks longer now before failing. But still fails, now with a seg fault. Does this just mean I don't have enough ram, or cpu, or ... Any ideas? thomas. * [EMAIL PROTECTED]:~/haskellInstalls$ tail -n13 out.txt ../compiler/ghc-inplace -H16

Re: [Haskell-cafe] Trouble with record syntax and classes

2007-02-27 Thread Andreas Rossberg
<[EMAIL PROTECTED]> wrote: When you type "class Foo" in Java or C++, it does three things: 1. It declares a new type called "Foo". 2. It declares a _set_ of types (i.e. a "class"). 3. It declares that the type Foo (and all of its subtypes) is a member of the set of types Foo. I would add:

[Haskell-cafe] Re: [Haskell] [Fwd: Re: Computer Language Shootout]

2007-02-27 Thread Fawzi Mohamed
On Feb 27, 2007, at 3:51 PM, Andrzej Jaworski wrote: [...] Nevertheless my point is still valid: when on compiler side the heap is stretched and on program side you need Ockham's Razor in action Haskell chokes. I hoped at least to stimulate interest in repeating GP experiment with latest G

[Haskell-cafe] Logic programming using lazy evaluation

2007-02-27 Thread Henning Thielemann
I suspect that someone has already done this: A Haskell library which solves a system of simple equations, where it is only necessary to derive a value from an equation where all but one variables are determined. Say 1+2=x -- add 1 2 x y*z=20 -- times y z 20 x+y=5 -- add x y 5 shou

[Haskell-cafe] Re: [Haskell] [Fwd: Re: Computer Language Shootout]

2007-02-27 Thread Fawzi Mohamed
On Feb 27, 2007, at 1:59 PM, Sven Panne wrote: On Tuesday 27 February 2007 13:44, Andrzej Jaworski wrote: I have learned logic from much deeper sources;-) My statement was: Guys started in Haskell and got to conclusion that for performance reasons it is better to move to C. The guys know w

Re: [Haskell-cafe] Delaling with State StateT and IO in the same function

2007-02-27 Thread Andrew Wagner
I don't know if this will help or not, but there's a basic StateT example on the haskell wiki that you could look at, to see how to deal with State in general. The code is at http://www.haskell.org/haskellwiki/Simple_StateT_use and is thanks to Don Stewart. Maybe I'll just paste the code with a fe

Re: [Haskell-cafe] Safe lists with GADT's

2007-02-27 Thread Neil Mitchell
Hi Coq does have termination checking, and Neil Mitchell is working on a case-and-termination checker for Haskell. I was working on a case and termination checker. Now I'm just working on a case checker (which is pretty much done). The main reason I gave up on termination is that it was done

[Haskell-cafe] Re: problems installing ghc 6.6 with extralibs (bad interface file)

2007-02-27 Thread Simon Marlow
Thomas Hartman wrote: I installed ghc 6.6 from source ok. But then when I tried installing it with the "extralibs" to get all the functionality that had been unbundled in 6.6, I hit a glitch. Anyone ever seen anything like this? In case it matters, this is ssh-ed in to a virtualized user mode l

Re[2]: [Haskell-cafe] FFI basics

2007-02-27 Thread Bulat Ziganshin
Hello Evan, Tuesday, February 27, 2007, 12:02:57 AM, you wrote: > Unfortunately, ghc doesn't seem relink the target if cfile.o changed, > so as a hack I put 'rm target' before the ghc line to make it link > every time. it's a bug. i don't know whether it's already fixed, try it with the latest 6

Re: [Haskell-cafe] Re: AT solution: rebinding >>= for restricted monads

2007-02-27 Thread Pepe Iborra
Did anyone with knowledge of Associated Types pursue this solution? Where did you get this from. My haskell-cafe mail folder doesn't seem to have the thread you are replying to. Sorry I replied from gmane; I should have included a link to the original thread, but I really expected gmane t