Re: [Haskell-cafe] Problem with monadic formlets

2009-08-28 Thread Colin Paul Adams
Jeremy == Jeremy Shaw jer...@n-heptane.com writes: Jeremy Hello, I hacked your code into a runnable example, and it Jeremy seems to work for me. Jeremy Which looks correct to me. Your code looks fine to me as Jeremy well... Perhaps the error is not in the code you pasted,

Re: [Haskell-cafe] ANN: moe html combinator

2009-08-28 Thread Jason Dusek
2009/08/27 Bulat Ziganshin bulat.zigans...@gmail.com: ...stop reusing Prelude operators, in particular, replace - with $? I have to say, the `$ do` construct is an eyesore and `- do` is a lot easier on the eyes. Would it introduce ambiguity in the Haskell grammar if foo do...

Re: [Haskell-cafe] Re: Is logBase right?

2009-08-28 Thread Ketil Malde
Lennart Augustsson lenn...@augustsson.net writes: Prelude toRational 697.04157958259998 3065621287177675 % 4398046511104 Prelude toRational 697.0415795826 3065621287177675 % 4398046511104 As you can see, both numbers are represented by the same Double. Haskell prints a Double with the

[Haskell-cafe] Re: Mapping over multiple values of a list at once?

2009-08-28 Thread Jon Fairbairn
Raynor Vliegendhart shinnon...@gmail.com writes: Just wondering, what should be the expected output be of something like mavg 4 [1..3]? [3%2] or []? [0%1, 1%4, 3%4, 3%2, 3%2, 5%4, 3%4, 0%1], of course ;-P -- Jón Fairbairn jon.fairba...@cl.cam.ac.uk

[Haskell-cafe] tomorrow: Edinburgh Meetup (Sat 29 Aug) and Hack Day (Sun 30 Aug)

2009-08-28 Thread Eric Y. Kow
Dear Haskellers, Last minute reminder: We will be having a Hack Day in Edinburgh on Sunday 30 August (ICFP venue). That's this weekend! For the interested, we will also be meeting up the day before 09:30 Saturday 29 August just outside the RCPE (ie. the ICFP venue again). We'll have a quick

[Haskell-cafe] Uninstall a cabal package?

2009-08-28 Thread Colin Paul Adams
What is the procedure to uninstall a cabal package? -- Colin Adams Preston Lancashire ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: Re[Haskell-cafe] duction Sequence of simple Fibonacci sequence implementation

2009-08-28 Thread staafmeister
Thanks for the memo trick! Now I understand that the haskell compiler cannot memoize functions of integers, because it could change the space behaviour. However I think it could memoize everything else. Because all types that are data objects sitting in memory (so the arg is essentially a

Re[2]: Re[Haskell-cafe] duction Sequence of simple Fibonacci sequence implementation

2009-08-28 Thread Bulat Ziganshin
Hello staafmeister, Friday, August 28, 2009, 1:54:38 PM, you wrote: it just works other way. imagine a whole haskell program as a graph. i.e. expression 1+2, for example, forms a node with (=) in its root and 1 and 2 as its subtrees. computation of program is a series of graph reductions,

Re: Re[Haskell-cafe] duction Sequence of simple Fibonacci sequence implementation

2009-08-28 Thread Luke Palmer
On Fri, Aug 28, 2009 at 3:54 AM, staafmeisterg.c.stave...@uu.nl wrote: Thanks for the memo trick! Now I understand that the haskell compiler cannot memoize functions of integers, because it could change the space behaviour. However I think it could memoize everything else. Because all types

Re: Re[Haskell-cafe] [2]: Reduction Sequence of simple Fibonacci sequence implementation

2009-08-28 Thread staafmeister
Bulat Ziganshin-2 wrote: this graph can share computations in only one way - when you give sharec node a name and use this name twice. for example, the following sum[1..1000] + prod[1..1000] don't share anything, but this let list = [1..1000] in sum list + prod list share the

Re: [Haskell-cafe] Uninstall a cabal package?

2009-08-28 Thread Peter Robinson
As far as I know the current stable release of Cabal doesn't keep track of installed packages, so you can only # ghc-pkg unregister pkg-id and then manually delete the files. Peter 2009/8/28 Colin Paul Adams co...@colina.demon.co.uk: What is the procedure to uninstall a cabal package? --

Re[2]: Re[Haskell-cafe] [2]: Reduction Sequence of simple Fibonacci sequence implementation

2009-08-28 Thread Bulat Ziganshin
Hello staafmeister, Friday, August 28, 2009, 2:34:07 PM, you wrote: Well in case I call (prod list) again it could lookup the reference and see so it should keep a list of all values ever computed in program, together with their expressions? :) are you like idea of prod[1..10^6] computation

Re: Re[Haskell-cafe] [2]: Re[2]: Reduction Sequence of simple Fibonacci sequence implementation

2009-08-28 Thread staafmeister
Bulat Ziganshin-2 wrote: Hello staafmeister, Friday, August 28, 2009, 2:34:07 PM, you wrote: Well in case I call (prod list) again it could lookup the reference and see so it should keep a list of all values ever computed in program, together with their expressions? :) are you like

Re: Re[Haskell-cafe] [2]: Re[2]: Reduction Sequence of simple Fibonacci sequence implementation

2009-08-28 Thread david48
On Fri, Aug 28, 2009 at 1:03 PM, staafmeisterg.c.stave...@uu.nl wrote: The list you give prod is also 10 MB so it not a terribly inefficient program. That list takes memory only if it is forced. If it is passed to a lazy function, all the list may not be in memory at once.

Re[2]: Re[Haskell-cafe] [2]: Re[2]: Reduction Sequence of simple Fibonacci sequence implementation

2009-08-28 Thread Bulat Ziganshin
Hello staafmeister, Friday, August 28, 2009, 3:03:13 PM, you wrote: so it should keep a list of all values ever computed in program, together with their expressions? :) are you like idea of prod[1..10^6] computation taking 10 mbytes of memory? The list you give prod is also 10 MB so it not a

Re: Re[Haskell-cafe] [2]: Re[2]: Reduction Sequence of simple Fibonacci sequence implementation

2009-08-28 Thread staafmeister
david48 wrote: On Fri, Aug 28, 2009 at 1:03 PM, staafmeisterg.c.stave...@uu.nl wrote: The list you give prod is also 10 MB so it not a terribly inefficient program. That list takes memory only if it is forced. If it is passed to a lazy function, all the list may not be in memory at

Re: Re[Haskell-cafe] [2]: Re[2]: Re[2]: Reduction Sequence of simple Fibonacci sequence implementation

2009-08-28 Thread staafmeister
Bulat Ziganshin-2 wrote: Hello staafmeister, Friday, August 28, 2009, 3:03:13 PM, you wrote: so it should keep a list of all values ever computed in program, together with their expressions? :) are you like idea of prod[1..10^6] computation taking 10 mbytes of memory? The list you

Re: [Haskell-cafe] Uninstall a cabal package?

2009-08-28 Thread Colin Paul Adams
Peter == Peter Robinson thaldy...@gmail.com writes: Peter As far as I know the current stable release of Cabal Peter doesn't keep track of installed packages, so you can only # Peter ghc-pkg unregister pkg-id and then manually delete the Peter files. Thanks. That works. --

Re: [Haskell-cafe] Problem with monadic formlets

2009-08-28 Thread Colin Paul Adams
Colin == Colin Paul Adams co...@colina.demon.co.uk writes: Jeremy == Jeremy Shaw jer...@n-heptane.com writes: Colin apparent data corruprion is occurring. I am suspecting a Colin bug in the formlets library (I have version 0.6). Colin So I have created a slightly cut-down (no

Re: Re[Haskell-cafe] [2]: Re[2]: Reduction Sequence of simple Fibonacci sequence implementation

2009-08-28 Thread Ketil Malde
staafmeister g.c.stave...@uu.nl writes: The list you give prod is also 10 MB so it not a terribly inefficient program. It's a factor of 2. No, it is not. The expression: prod [1..1000] + sum [1..1000] will first evaluate prod [1..1000], generating values from 1 to 1000 lazily and

Re[2]: Re[Haskell-cafe] [2]: Re[2]: Re[2]: Reduction Sequence of simple Fibonacci sequence implementation

2009-08-28 Thread Bulat Ziganshin
Hello staafmeister, Friday, August 28, 2009, 3:31:13 PM, you wrote: All the values that are computed but are also GCed (and they will be, 10^9 bytes is the mem limit). If the GC removes a value then all references in cache to those values can also be removed. it looks like cache of

[Haskell-cafe] Arrows extentions and ArrowApplicable

2009-08-28 Thread Maciej Piechotka
Arrows syntax supports Arrow, ArrowChoice(if, case etc.) and ArrowLoop(rec) - but not ArrowApplicable. Therefore it is not possible to write: proc x - do a - someArrow - x a - x but proc x - do a - someArrow - x app - (a, x) and proc x - do a -

[Haskell-cafe] Re: Mapping over multiple values of a list at once?

2009-08-28 Thread Heinrich Apfelmus
hask...@kudling.de wrote: You are asked to iterate over the list and calculate the average value of each 3 neighbouring values. Lambda Fu, form 72 - three way dragon zip averages3 xs = zipWith3 avg xs (drop 1 xs) (drop 2 xs) where avg a b c = (a+b+c) / 3 Regards, apfelmus --

Re: [Haskell-cafe] Arrows extentions and ArrowApplicable

2009-08-28 Thread Ross Paterson
On Fri, Aug 28, 2009 at 02:33:08PM +0200, Maciej Piechotka wrote: Arrows syntax supports Arrow, ArrowChoice(if, case etc.) and ArrowLoop(rec) - but not ArrowApplicable. Therefore it is not possible to write: proc x - do a - someArrow - x a - x You can write proc x - do

[Haskell-cafe] Time constrained computation

2009-08-28 Thread Mitar
Hi! I am not really sure if this is correct term for it but I am open to better (search) terms. pure ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Time constrained computation

2009-08-28 Thread Mitar
Hi! Ups, missed save button and pressed send. ;-) So I am not really sure if this is correct term for it but I am open to better (search) terms. I am wondering if it is possible to make a time constrained computation. For example if I have a computation of an approximation of a value which can

[Haskell-cafe] strictness analysis on algebraic data types

2009-08-28 Thread Peter Verswyvelen
I'm reading the book Modern Compiler Designhttp://www.cs.vu.nl/~dick/MCD.html, and in the chapter about functional programming it is stated that strictness analysis in the presence of ADTs (aka records) is a very hard problem to tackle. I'm not sure what the current state of art is here (e.g GHC

[Haskell-cafe] Another thanks for inspiration to RWH - Bloom Filters

2009-08-28 Thread Günther Schmidt
Hi all, My app has to use rather large amounts of static data in order to run. I have been using an SQLite database to hold this data so far. The largest chunk of data was a table with roughly 80k records. I only make use of this table to see if a particular key is present. Reading RWH

Re: [Haskell-cafe] Re: Time constrained computation

2009-08-28 Thread Alexander Dunlap
On Fri, Aug 28, 2009 at 6:01 AM, Mitarmmi...@gmail.com wrote: Hi! Ups, missed save button and pressed send. ;-) So I am not really sure if this is correct term for it but I am open to better (search) terms. I am wondering if it is possible to make a time constrained computation. For

Re: [Haskell-cafe] Re: Time constrained computation

2009-08-28 Thread Job Vranish
I tried this using timeout, but was never able to get it to work. The timeout doesn't behave like I expect. I can take several seconds for it to timeout, even with very low timeouts. Any ideas? - Job module Main where import Data.IORef import System.Timeout import System.IO.Unsafe tailScan f

Re: [Haskell-cafe] Re: Time constrained computation

2009-08-28 Thread Roel van Dijk
This is my go at the problem: module Main where import Control.Concurrent import Data.IORef -- From the Haskell wiki primes :: [Integer] primes = sieve [2..] where sieve (p:xs) = p : sieve [x | x - xs, x `mod` p /= 0] producePrimes :: IORef [Integer] - IO () producePrimes ref = go primes

Re: [Haskell-cafe] Re: Is logBase right?

2009-08-28 Thread Brandon S. Allbery KF8NH
On Aug 28, 2009, at 03:24 , Ketil Malde wrote: What puzzled me (and the parent article indicated), was that Python appeared to be able to work with more precision, and thus be more numerically correct than GHC. Since it's all machine precision floating point, this is even more strange, and I

Re: Re[2]: Re[Haskell-cafe] [2]: Re[2]: Re[2]: Reduction Sequence of simple Fibonacci sequence implementation

2009-08-28 Thread Luke Palmer
On Fri, Aug 28, 2009 at 6:04 AM, Bulat Ziganshinbulat.zigans...@gmail.com wrote: Hello staafmeister, Friday, August 28, 2009, 3:31:13 PM, you wrote: All the values that are computed but are also GCed (and they will be, 10^9 bytes is the mem limit). If the GC removes a value then all

Re: [Haskell-cafe] rotate image

2009-08-28 Thread h.
Hello, Nobody any idea? I want to paint in some widget, but this will be in front of some background, so the bg should be transparent. -- best regards h. -- View this message in context: http://www.nabble.com/rotate-image-tp25122912p25198054.html Sent from the Haskell - Haskell-Cafe

[Haskell-cafe] SLD resolution code in Haskell

2009-08-28 Thread Steffen Bock
Hi, is there any haskell code for SLD-resolution; I wanna learn it. Thanks a lot. Steffen. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] rotate image

2009-08-28 Thread Jeff Heard
Not really. Best thing I can think to do is use the X11 library to pull the pixels under your window then draw them as a surface on the drawingarea, then draw your rotated image on top of that. You have to have a window, and Gtk windows do not have an alpha. You'll want it to be undecorated,

[Haskell-cafe] Snow Leopard Breaks GHC

2009-08-28 Thread David Leimbach
Just thought I'd point out that my old GHC install is now broken by the update to Snow Leopard. Dave ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Snow Leopard Breaks GHC

2009-08-28 Thread Ross Mellgren
My 6.10.1 install still works alright after upgrade to 10.6/Snow Leopard. What version did you have? -Ross On Aug 28, 2009, at 7:15 PM, David Leimbach wrote: Just thought I'd point out that my old GHC install is now broken by the update to Snow Leopard. Dave

Re: [Haskell-cafe] Snow Leopard Breaks GHC

2009-08-28 Thread David Leimbach
6.10.4. Did you try to build any binaries? It doesn't produce correct assembly code (it looks like). Dave On Fri, Aug 28, 2009 at 4:55 PM, Ross Mellgren rmm-hask...@z.odi.ac wrote: My 6.10.1 install still works alright after upgrade to 10.6/Snow Leopard. What version did you have? -Ross

Re: [Haskell-cafe] Snow Leopard Breaks GHC

2009-08-28 Thread Ross Mellgren
I did a trivial compile and it worked yes (the binary it produced was alright, also). Did the binary it generate have problems, or was it the compilation that failed? -Ross On Aug 28, 2009, at 7:57 PM, David Leimbach wrote: 6.10.4. Did you try to build any binaries? It doesn't produce

Re: [Haskell-cafe] Snow Leopard Breaks GHC

2009-08-28 Thread David Leimbach
The compilation failed. On Fri, Aug 28, 2009 at 4:58 PM, Ross Mellgren rmm-hask...@z.odi.ac wrote: I did a trivial compile and it worked yes (the binary it produced was alright, also). Did the binary it generate have problems, or was it the compilation that failed? -Ross On Aug 28, 2009,

Re: [Haskell-cafe] Snow Leopard Breaks GHC

2009-08-28 Thread Dmitri Sosnik
The same here: $ghc hw.hs /var/folders/1J/1JKije6yHpm78qqdjF5N2U+++TI/-Tmp-/ghc7743_0/ ghc7743_0.s:1357:0: suffix or operands invalid for `push' /var/folders/1J/1JKije6yHpm78qqdjF5N2U+++TI/-Tmp-/ghc7743_0/ ghc7743_0.s:1401:0: suffix or operands invalid for `push' ... I've tried to

[Haskell-cafe] Re: Unifcation and matching in Abelian groups

2009-08-28 Thread John D. Ramsdell
I cleaned up the code, partitioned it into a library and an executable, and made the package available on hackage as agum-1.0. Enjoy. John ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] SLD resolution code in Haskell

2009-08-28 Thread Antoine Latter
On Fri, Aug 28, 2009 at 6:03 PM, Steffen Bockbock.stef...@yahoo.de wrote: Hi, is there any haskell code for SLD-resolution; I wanna learn it. What's SLD-resolution? Antoine ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] SLD resolution code in Haskell

2009-08-28 Thread Hector Guilarte
Hey Steffen, I actually made it one time, remember me to send it to you on monday... Hector Guilarte -Original Message- From: Steffen Bock bock.stef...@yahoo.de Date: Fri, 28 Aug 2009 23:03:24 To: Haskell-Cafe@haskell.org Subject: [Haskell-cafe] SLD resolution code in Haskell

Re: [Haskell-cafe] rotate image

2009-08-28 Thread h.
Hello, Thanks for your answers and your time, but I fear that I didn't described the problem accurately enough. The background is in the window created with gtk2hs (windowNew). It's just a fixed layout (fixedNew): bg - imageNewFromFile bg.jpg fixedPut fBox bg (0,0) If I now create the

Re: [Haskell-cafe] Snow Leopard Breaks GHC

2009-08-28 Thread David Leimbach
On Fri, Aug 28, 2009 at 5:28 PM, Dmitri Sosnik dim...@gmail.com wrote: The same here:$ghc hw.hs /var/folders/1J/1JKije6yHpm78qqdjF5N2U+++TI/-Tmp-/ghc7743_0/ghc7743_0.s:1357:0: suffix or operands invalid for `push'

Re: [Haskell-cafe] Snow Leopard Breaks GHC

2009-08-28 Thread Don Stewart
leimy2k: On Fri, Aug 28, 2009 at 5:28 PM, Dmitri Sosnik dim...@gmail.com wrote: The same here: $ghc hw.hs /var/folders/1J/1JKije6yHpm78qqdjF5N2U+++TI/-Tmp-/ghc7743_0/ ghc7743_0.s:1357:0: suffix or operands invalid for `push'