[Haskell-cafe] Re: Existential types (Was: Type vs TypeClass duality)

2007-10-26 Thread apfelmus
Wouter Swierstra wrote: In a sense, that's also the reason why stream fusion à la Duncan + Roman + Don uses an existential type data Stream a where Stream :: ∀s. s - (s - Step a s) - Stream a data Step a s = Done | Yield a s | Skip s I thought there

Re: [Haskell-cafe] Haskell to math

2007-10-26 Thread jerzy . karczmarczuk
Henning Thielemann writes: Peter Verswyvelen wrote: Now what I would like to do, is to create a mathematical expression in Haskell (using e.g. an expression tree), which can be evaluated in Haskell, and be converted to something pretty-math-printable (MathML, PS, PDF, LaTex, whatever).

Re: [Haskell-cafe] Haskell to math

2007-10-26 Thread Henning Thielemann
On Fri, 26 Oct 2007, Peter Verswyvelen wrote: Some packages like Open Office and Microsoft Word contain a math expression writer. The same can be done with Maple, etc. Standard formats such as MathML, LaTex etc exist. Now what I would like to do, is to create a mathematical expression in

[Haskell-cafe] Haskell to math

2007-10-26 Thread Peter Verswyvelen
Some packages like Open Office and Microsoft Word contain a math expression writer. The same can be done with Maple, etc. Standard formats such as MathML, LaTex etc exist. Now what I would like to do, is to create a mathematical expression in Haskell (using e.g. an expression tree), which can

[Haskell-cafe] Linking problems with a fresh gtk2hs build

2007-10-26 Thread Olivier Boudry
Hello, I just built gtk2hs 0.9.12 using MinGW, GTK_2.0 and ghc-6.8.0.20071016. I just changed some EXTERNALDEPS in the Makefile based on info found in the following page http://haskell.org/haskellwiki/Grapefruit 25a126,128 if HAVE_SPLIT_BASE tools_c2hs_c2hsLocal_EXTERNALDEPS += pretty

Re: [Haskell-cafe] lazily traversing a foreign data structure

2007-10-26 Thread Graham Fawcett
On 10/25/07, Derek Elkins [EMAIL PROTECTED] wrote: On Thu, 2007-10-25 at 11:30 -0400, Graham Fawcett wrote: I'm writing a Gnu DBM module as an exercise for learning Haskell and its FFI. I'm wondering how I might write a function that returns the database keys as a lazy list. Just use

Re: [Haskell-cafe] Haskell to math

2007-10-26 Thread Peter Verswyvelen
Jerzy K wrote wants. He wants a specific pretty-printer *in Haskell*. This was most probably a subject of many students' exercices... Yes Jerzy, exactly. I wrote some Haskell code to create plots of binary relations and functions on the Cartesian plane, using GTK2HS (Cairo). I have to pretty

RE: [Haskell-cafe] How to thoroughly clean up Haskell stuff on linux

2007-10-26 Thread Lihn, Steve
Tom, Although there are ghc rpms (http://www.haskell.org/ghc/dist/6.6.1/rpm/), it can not be installed as non-root user. The rpm lock and rpm db issue makes it a complicated and pathological case -- see thread here https://lists.dulug.duke.edu/pipermail/rpm-devel/2005-April/000403.html

Re: [Haskell-cafe] Fusing foldr's

2007-10-26 Thread Josef Svenningsson
Sorry for reacting so late on this mail. I'm digging through some old mails... On 10/12/07, Dan Weston [EMAIL PROTECTED] wrote: Always check optimizations to make sure they are not pessimizations! Actually, traversing the list twice is very cheap compared to space leakage, and accumulating

Re: [Haskell-cafe] Linking problems with a fresh gtk2hs build

2007-10-26 Thread Duncan Coutts
On Fri, 2007-10-26 at 09:17 -0400, Olivier Boudry wrote: Hello, I just built gtk2hs 0.9.12 using MinGW, GTK_2.0 and ghc-6.8.0.20071016. I just changed some EXTERNALDEPS in the Makefile based on info found in the following page http://haskell.org/haskellwiki/Grapefruit I'm not sure what's

[Haskell-cafe] Re: Linking problems with a fresh gtk2hs build

2007-10-26 Thread Olivier Boudry
More info on this problem: I rebuilt the whole stuff using exactly the same method and working from a new extract of the sources. Now I get the same kind of error but on another object. This error looks a bit random!?! nm.exe libHSgtk.a /dev/null C:\MinGW\bin\nm.exe: TextView__112.o: File

Re: [Haskell-cafe] lazily traversing a foreign data structure

2007-10-26 Thread Brent Yorgey
On 10/26/07, Graham Fawcett [EMAIL PROTECTED] wrote: On 10/25/07, Derek Elkins [EMAIL PROTECTED] wrote: On Thu, 2007-10-25 at 11:30 -0400, Graham Fawcett wrote: I'm writing a Gnu DBM module as an exercise for learning Haskell and its FFI. I'm wondering how I might write a function that

Re: [Haskell-cafe] Fusing foldr's

2007-10-26 Thread Dan Weston
Thanks for letting me know about the Data.Strict library on Hackage. I will definitely make use of that! BTW, you left out an import Data.List(foldl') in your example. My timing test is an order of magnitude worse than yours. Do you have an extra zero in your list endpoint? I fed these

Re: [Haskell-cafe] lazily traversing a foreign data structure

2007-10-26 Thread Graham Fawcett
On 10/26/07, Brent Yorgey [EMAIL PROTECTED] wrote: In the end it looks to me like you're probably better off just implementing traverse directly as you have done, although perhaps someone will find a better way. Beginner's luck. ;-) I see the unfold similarity, but yes, it doesn't seem a good