[Haskell-cafe] Re: Finding points contained within a convex hull.

2007-06-07 Thread DavidA
It's been a while, but I believe that you can solve integer programming problems of this type using Groebner bases. (Google for integer programming with Groebner bases). I have some Groebner basis code in Haskell at http://www.polyomino.f2s.com/david/haskell/commalg.html

Re: [Haskell-cafe] Finding points contained within a convex hull.

2007-06-07 Thread Jan-Willem Maessen
On Jun 6, 2007, at 11:38 PM, Daniel McAllansmith wrote: [Trying to find the domain of a bounded integer linear program] How would you go about finding extreme vertices? Would it be quicker than solving the constraints for each max/min? If you're just looking to find bounding coordinates

[Haskell-cafe] GTK2HS

2007-06-07 Thread Andrew Coppin
Erm... wuh? I just tried to install Gtk2hs and got an error message to the effect that it cannot be installed since I have GHC 6.6.1, which isn't 6.6 or 6.4. Anybody know how to fix this? Am I being dumb? Thanks. Andrew. ___ Haskell-Cafe mailing

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

2007-06-07 Thread Grzegorz
apfelmus apfelmus at quantentunnel.de writes: [ .. lengthy discussion and implementation .. ] As an example, we have Just Earth == lookup (at Milky Way / at Sun) universe assuming that universe :: Data.Map String (Data.Map String String) All this hard work for something that in a

Re: [Haskell-cafe] Good article on why implementing a functional back end is really different

2007-06-07 Thread Neil Mitchell
Hi Help. I need support for a technical argument: why going to an intermediate form for an existing functional back end like Haskell really, truly is better for implementing a functional language than is going to an intermediate form like the Java intermediate form and re-doing all the various

Re: [Haskell-cafe] GTK2HS

2007-06-07 Thread Neil Mitchell
Hi Andrew, I just tried to install Gtk2hs and got an error message to the effect that it cannot be installed since I have GHC 6.6.1, which isn't 6.6 or 6.4. Anybody know how to fix this? Am I being dumb? Are you running Windows or Linux? If Linux, where did you get your package from? After

Re: [Haskell-cafe] GTK2HS

2007-06-07 Thread Andrew Coppin
Neil Mitchell wrote: Hi Andrew, I just tried to install Gtk2hs and got an error message to the effect that it cannot be installed since I have GHC 6.6.1, which isn't 6.6 or 6.4. Anybody know how to fix this? Am I being dumb? Are you running Windows or Linux? If Linux, where did you get

[Haskell-cafe] problem implementing an EDSL in Haskell

2007-06-07 Thread Daniil Elovkov
Hello folks Haskell is considered good for embedded DSLs. I'm trying to implement some simple EDSL in a typeful manner and having a problem with looking up variable values. I've got an Expression GADT, which admits variables. The problem is with writing compute function which will lookup

[Haskell-cafe] Re: Good article on why implementing a functional

2007-06-07 Thread Monique Monteiro
I think that using an existing back end of an optimizing compiler such as GHC is more promising than targetting Java, C# or other imperative/OO language. GHC already does a lot of work to achieve a good performance. So, if you generate Java code, you'd have to do a lot of work to get good

Re: [Haskell-cafe] HopenGL

2007-06-07 Thread Dan Piponi
On 6/6/07, Ruben Zilibowitz [EMAIL PROTECTED] wrote: If anyone knows how to get HOpenGL to draw coloured lines, I'd like... See http://cvs.haskell.org/cgi-bin/cvsweb.cgi/~checkout~/fptools/libraries/GLUT/examples/RedBook/Lines.hs Note the color line which in this example uses white. For

[Haskell-cafe] Examples of OpenAL and ALUT?

2007-06-07 Thread Dan Piponi
Does anyone have any sample Haskell code they'd like to share for doing things like creating a waveform from a list of samples or a mathematical function and playing them using these libraries (or indeed any easy to install on MacOS X Haskell library)? -- Dan

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

2007-06-07 Thread Daniil Elovkov
Hi 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 will obviously help)

[Haskell-cafe] type versus data declarations

2007-06-07 Thread Emilio Jesús Gallego Arias
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) a :: FSet Double a _ = 0 fails with All of the type variables in the constraint `Show a' are already in scope (at

[Haskell-cafe] class MonoidBreak?

2007-06-07 Thread Alex Jacobson
Is there a standard class that looks something like this: class (Monoid m) = MonoidBreak m where mbreak::a-m a-(m a,m a) and it should follow some law like: m == uncurry mappend $ mbreak x m -Alex- ___ Haskell-Cafe mailing list

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

2007-06-07 Thread Felipe Almeida Lessa
Hello everybody! (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, like in

[Haskell-cafe] Re: problem implementing an EDSL in Haskell

2007-06-07 Thread Daniil Elovkov
Hey, I've solved the problem. To unify static and dynamic types I didn't have to introduce FType m a. Rather I had to do the 'matches' function a member of Typed class. class Typed a where typ :: m a - Type m matches :: m a - Type m - Maybe (m a) with a trivial implementation

Re: [Haskell-cafe] class MonoidBreak?

2007-06-07 Thread Dan Piponi
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 kind issue going on here. If m is a Monoid I'm not sure what m a means. Looks like

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

2007-06-07 Thread apfelmus
Grzegorz wrote: apfelmus apfelmus at quantentunnel.de writes: [ .. lengthy discussion and implementation .. ] As an example, we have Just Earth == lookup (at Milky Way / at Sun) universe assuming that universe :: Data.Map String (Data.Map String String) All this hard work for

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

2007-06-07 Thread Justin Bailey
On 6/7/07, Grzegorz [EMAIL PROTECTED] wrote: All this hard work for something that in a lesser language would be the unimpressive: universe[Milky Way][Sun] ;-P Well, if you want to get picky there is the '!' operator defined in Data.Map: import Data.Map universe :: Map String (Map

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

2007-06-07 Thread Albert Y. C. Lai
Justin Bailey wrote: On 6/7/07, Grzegorz [EMAIL PROTECTED] wrote: All this hard work for something that in a lesser language would be the unimpressive: universe[Milky Way][Sun] ;-P Well, if you want to get picky there is the '!' operator defined in Data.Map: universe ! Milky Way ! Sun I

[Haskell-cafe] haskell version of fractal benchmark

2007-06-07 Thread brad clawsie
i recently saw a (yet-another) benchark comparing various languages: http://www.timestretch.com/FractalBenchmark.html while no haskell example was listed, i thought i would try a naive implementation myself for comparison. it is available here: http://www.b7j0c.org/dev/haskell/misc/time.hs my

Re: [Haskell-cafe] HopenGL

2007-06-07 Thread Ruben Zilibowitz
Hi, Thanks for the reply. The Lines.hs example program seems to work just right. Unfortunately I still can't get colored lines to work in my 3d program. Maybe it has something to do with the fact my one is 3d and the example program is in 2d. Any other ideas? I would post some source

Re: [Haskell-cafe] HopenGL

2007-06-07 Thread Jason Dagit
On 6/7/07, Ruben Zilibowitz [EMAIL PROTECTED] wrote: Hi, Thanks for the reply. The Lines.hs example program seems to work just right. Unfortunately I still can't get colored lines to work in my 3d program. Maybe it has something to do with the fact my one is 3d and the example program is in

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

2007-06-07 Thread Donald Bruce Stewart
mdanish: Hello, I've been playing with the INTEST problem on SPOJ which demonstrates the ability to write a program which processes large quantities of input data. http://www.spoj.pl/problems/INTEST/ But when I make a slight modification, the program chews up a ton more memory and

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

2007-06-07 Thread Donald Bruce Stewart
dons: mdanish: Hello, I've been playing with the INTEST problem on SPOJ which demonstrates the ability to write a program which processes large quantities of input data. http://www.spoj.pl/problems/INTEST/ But when I make a slight modification, the program chews up a ton more

Re: [Haskell-cafe] haskell wiki indexing

2007-06-07 Thread Jason Dagit
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 still the wiki

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

2007-06-07 Thread Donald Bruce Stewart
clawsie: i recently saw a (yet-another) benchark comparing various languages: http://www.timestretch.com/FractalBenchmark.html while no haskell example was listed, i thought i would try a naive implementation myself for comparison. it is available here:

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

2007-06-07 Thread Donald Bruce Stewart
dons: dons: mdanish: Hello, I've been playing with the INTEST problem on SPOJ which demonstrates the ability to write a program which processes large quantities of input data. http://www.spoj.pl/problems/INTEST/ But when I make a slight modification, the program chews

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

2007-06-07 Thread Simon Peyton-Jones
Alistair 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. If you can make a reproducible test case of the unexpected behaviour please