Re: [Haskell-cafe] Norvig's Sudoku Solver in Haskell

2007-08-27 Thread Daniel Fischer
Am Montag, 27. August 2007 14:40 schrieb Jon Harrop: Probably not, but what's wrong with using arrays (here and in general)? Here I find arrays very natural, after all a grid has a fixed set of indices. And as they have a much faster lookup than maps (not to mention lists), what do you

Re: [Haskell-cafe] Norvig's Sudoku Solver in Haskell

2007-08-27 Thread Daniel Fischer
Am Montag, 27. August 2007 10:09 schrieb manu: Daniel Fischer's modifications to my original program lead to a 400 % speed boost !!! (It now runs in 22 seconds on my machine) He avoided unecessary calls to 'length', uses Array instead of Map, refactored 'search' function (details below)

Re: [Haskell-cafe] Looking for suggestions to improve my algorithm

2007-08-29 Thread Daniel Fischer
Am Mittwoch, 29. August 2007 23:12 schrieb David Frey: Hello Haskellers, I have been trying to learn a bit about Haskell by solving Project Euler problems. Good :) For those of you who don't know what Project Euler is, see http://projecteuler.net After solving problem 21, which is

Re: [Haskell-cafe] Looking for suggestions to improve my algorithm

2007-08-29 Thread Daniel Fischer
Am Donnerstag, 30. August 2007 01:08 schrieb Brent Yorgey: Hi David, Project Euler is a good way to learn some Haskell, although it does tend to give you a crash course in understanding laziness, efficiency and such in Haskell (whether that's good or bad depends on your point of view!). All

Re: [Haskell-cafe] A possibly stupid doubt about the GHC's overlapping instances flag's

2007-10-24 Thread Daniel Fischer
Am Mittwoch, 24. Oktober 2007 10:35 schrieb Bas van Dijk: Suppose you have: {-# OPTIONS_GHC -fglasgow-exts -fallow-overlapping-instances #-} classC a b where foo :: a - b - (a, b) instance C Int a where foo n x = (n+1, x) -- (A) instance C a Bool where foo x

Re: [Haskell-cafe] newbie optimization question

2007-10-28 Thread Daniel Fischer
Am Sonntag, 28. Oktober 2007 20:09 schrieb Derek Elkins: snip That fits with my experience writing low level numeric code -- Integer can be a killer. Inline machine operations v. out-of-line calls to an arbitrary precision integer C library: there shouldn't be any surprise here.

Re: [Haskell-cafe] Re: newbie optimization question

2007-10-29 Thread Daniel Fischer
Am Montag, 29. Oktober 2007 13:49 schrieb Dusan Kolar: Hello all, just to compare the stuff, I get quite other results being on other OS. Thus, the result of C++ compiler may not be that interesting as I do not have the one presented below. Just to chime in, my results with the code below:

Re: [Haskell-cafe] More on Fibonacci numbers

2007-11-08 Thread Daniel Fischer
Am Freitag, 9. November 2007 02:25 schrieb [EMAIL PROTECTED]: Since I have no idea what a real mail client is, you will not frighten me! My mail client is apparently complex. As long as it's not purely imaginary... Jerzy Karczmarczuk Cheers, Daniel

Re: [Haskell-cafe] Sinus in Haskell

2007-11-09 Thread Daniel Fischer
Am Freitag, 9. November 2007 21:02 schrieb Hans van Thiel: On Fri, 2007-11-09 at 14:30 -0500, Brent Yorgey wrote: On Nov 9, 2007 2:08 PM, Hans van Thiel [EMAIL PROTECTED] wrote: Hello All, Can anybody explain the results for 1.0, 2.0 and 3.0 times pi below?

Re: [Haskell-cafe] Sinus in Haskell

2007-11-09 Thread Daniel Fischer
Am Samstag, 10. November 2007 00:36 schrieb Carl Witty: Actually, there are about 95 million floating-point values in the vicinity of pi/2 such that the best possible floating-point approximation of sin on those values is exactly 1.0 (this number is 2^(53/2), where 53 is the number of mantissa

Re: [Haskell-cafe] A tale of Project Euler

2007-11-28 Thread Daniel Fischer
Am Mittwoch, 28. November 2007 22:31 schrieb Andrew Coppin: There are problems for which it's important to know how many times a given prime factor occurs. And there are other problems where it is merely necessary to know which primes are factors. I would say it's useful to have *both*

Re: [Haskell-cafe] A tale of Project Euler

2007-11-29 Thread Daniel Fischer
Am Donnerstag, 29. November 2007 19:43 schrieb Andrew Coppin: Daniel Fischer wrote: One thing: since You check the array bounds, the system needn't check them again, use unsafeWrite and unsafeRead. And use Int for the index, that would be MUCH faster. I can't find the functions you're

Re: [Haskell-cafe] A tale of Project Euler

2007-11-30 Thread Daniel Fischer
Am Freitag, 30. November 2007 14:39 schrieb Henning Thielemann: Is this thread still about the prime sieve? As I mentioned, I think one can avoid the mutable array, because if there is only a small number of array updates with much changes per update, it should be efficient enough to copy the

Re: [Haskell-cafe] Editorial error or something meaningful?

2007-12-01 Thread Daniel Fischer
Am Samstag, 1. Dezember 2007 07:18 schrieb PR Stanley: Hi taken from ch.8.3 in the Hutton book: Whereas return v always succeeds, the dual parser failure always fails regardless of the contents of the input string: The dual parser failure? Cheers, Paul The dual parser, failure, probably.

[Haskell-cafe] Problems building and using ghc-6.9

2007-12-03 Thread Daniel Fischer
Hi, so today I built ghc-6.9.20071124. First, make died because HsColour version = 1.8 was needed, couldn't determine the version. I had HsColour 1.6, got myself 1.8, built and installed. make died again, same problem. I added (v, Version) to the optionTable in HsColour.hs and it worked :)

Re: [Haskell-cafe] IO is a bad example for Monads [was: do]

2007-12-09 Thread Daniel Fischer
Am Sonntag, 9. Dezember 2007 18:31 schrieb Conal Elliott: IO is important because you can't write any real program without using it. Ouch! I get awfully discouraged when I read statements like this one. The more people who believe it, the more true it becomes. If you want to do

Re: [Haskell-cafe] Do real programs need IO? (was IO is a bad example for Monads)

2007-12-09 Thread Daniel Fischer
Am Sonntag, 9. Dezember 2007 21:29 schrieb Conal Elliott: I think your real point is that some things we still haven't figured out how to express functionally. Right? That's my point, at least. Currently, AFAIK, the only way to get input and produce output is via the IO monad, so it is de

Re: [Haskell-cafe] IO is a bad example for Monads

2007-12-09 Thread Daniel Fischer
Am Sonntag, 9. Dezember 2007 23:35 schrieb Ketil Malde: Daniel Fischer [EMAIL PROTECTED] writes: IO is important because you can't write any real program without using it. Ouch! I get awfully discouraged when I read statements like this one. I think Lennart was referring

Re: [Haskell-cafe] IO is a bad example for Monads

2007-12-10 Thread Daniel Fischer
Am Montag, 10. Dezember 2007 10:36 schrieb Ketil Malde: Daniel Fischer [EMAIL PROTECTED] writes: Well, I guess you could get pretty far using 'interact' - far enough in an educational setting to do lists and Maybe, and then monads, before introducing monadic IO. Pretty far, yes

Re: [Haskell-cafe] Re: Do real programs need IO? (was IO is a bad example for Monads)

2007-12-10 Thread Daniel Fischer
Am Montag, 10. Dezember 2007 07:05 schrieb Maurí­cio: (...) Would you deny that any useful programme has to do at least some of the following: -accept programme arguments at invocation -get input, be it from a keyboard, mouse, reading files, pipes... -output a result

Re: [Haskell-cafe] help

2007-12-10 Thread Daniel Fischer
Am Montag, 10. Dezember 2007 14:45 schrieb Ryan Bloor: hi I am writing a basic Parser from scratch. So far I have functions;# removeSpaces# match - which checks if a string is a substring of another# orParser which combines two parser's abilities# Basic pasrers like... parseInt, parseTrue,

Re: [Haskell-cafe] [RFC] benchmarks of bytestrings, teaser

2007-12-15 Thread Daniel Fischer
Am Sonntag, 16. Dezember 2007 04:07 schrieb Don Stewart: Program 7: == hs/space-x-foldl.hs: {-# LANGUAGE BangPatterns #-} cnt :: String - Int cnt bs

Re: [Haskell-cafe] MonadFix

2007-12-18 Thread Daniel Fischer
Am Dienstag, 18. Dezember 2007 17:26 schrieb Joost Behrends: Hi, since about three weeks i am learning Haskell now. One of my first excercises is to decompose an Integer into its primefactors. I already posted discussion on the solution to the problem 35 in 99 excercises. My simple

Re: [Haskell-cafe] Is StateT what I need?

2007-12-18 Thread Daniel Fischer
Am Dienstag, 18. Dezember 2007 19:47 schrieb Andre Nathan: Hello On Mon, 2007-12-17 at 21:22 -0200, Andre Nathan wrote: Thanks everyone for the great suggestions. The code is much cleaner now (not to mention it works :) I'm trying to finish the process tree construction but I guess I'll

Re: [Haskell-cafe] Re: MonadFix

2007-12-21 Thread Daniel Fischer
Am Freitag, 21. Dezember 2007 11:33 schrieb apfelmus: Joost Behrends wrote: apfelmus writes: How about separating the candidate prime numbers from the recursion factorize :: Integer - [Integer] factorize = f primes' where primes' = 2:[3,5..] f (p:ps) n

Re: [Haskell-cafe] Re: Importing Data.Char speeds up ghc around 70%

2007-12-22 Thread Daniel Fischer
Am Samstag, 22. Dezember 2007 20:48 schrieb Joost Behrends: Daniel Fischer daniel.is.fischer at web.de writes: I can't reproduce it, both run in 130s here (SuSE 8.2, 1200MHz Duron). However, it's running over 30 minutes now trying to factorise 2^88+1 without any sign of approaching success

Re: [Haskell-cafe] Re: Importing Data.Char speeds up ghc around 70%

2007-12-22 Thread Daniel Fischer
Am Samstag, 22. Dezember 2007 21:28 schrieb Joost Behrends: Of course, one minute after I sent my previous mail, I receive this one :( However, one point, it might be faster to factor out all factors p in found and only then compute the intsqrt, like found x = x{dividend = xstop, bound =

Re: [Haskell-cafe] Re: Importing Data.Char speeds up ghc around 70%

2007-12-22 Thread Daniel Fischer
Am Samstag, 22. Dezember 2007 22:57 schrieb Joost Behrends: Daniel Fischer daniel.is.fischer at web.de writes: Of course, one minute after I sent my previous mail, I receive this one :( However, one point, it might be faster to factor out all factors p in found and only then compute

Re: [Haskell-cafe] Re: Wikipedia on first-class object

2007-12-28 Thread Daniel Fischer
Am Freitag, 28. Dezember 2007 17:27 schrieb Achim Schneider: Both have an infinite number of 1. Why do you say “always”? It seems that you think of x and y as “variables” whose values change over time. This is not the case. They both have a single value for all time: the infinite list

Re: [Haskell-cafe] Newbie question: can laziness lead to space compression?

2007-12-29 Thread Daniel Fischer
Am Samstag, 29. Dezember 2007 16:00 schrieb Brian Hurt: My apologies if this has been beat to death before, I'm still new to Haskell. But I was wondering if it is possible that lazy evaluation could lead to space compression, especially under heavily persistant usage patterns? Here's the

Re: [Haskell-cafe] Re: Wikipedia on first-class object

2007-12-29 Thread Daniel Fischer
Could you please agree to disagree? It was fun for a while, but it gets annoying now. Cheers, Daniel Am Samstag, 29. Dezember 2007 22:52 schrieb Bulat Ziganshin: Hello Achim, Sunday, December 30, 2007, 12:32:51 AM, you wrote: And, pray, what problem does the nature wants to solve that it

Re: [Haskell-cafe] Re: Wikipedia on first-class object

2007-12-30 Thread Daniel Fischer
Am Sonntag, 30. Dezember 2007 17:14 schrieb Cristian Baboi: On Sat, 29 Dec 2007 21:49:16 +0200, Jonathan Cast [EMAIL PROTECTED] wrote: On 29 Dec 2007, at 5:01 AM, Cristian Baboi wrote: By portable I mean: works on the same machine, with the same OS, but with different Haskell

Re: [Haskell-cafe] Re: Wikipedia on first-class object

2007-12-30 Thread Daniel Fischer
Am Sonntag, 30. Dezember 2007 17:55 schrieb Cristian Baboi: On Sun, 30 Dec 2007 18:34:08 +0200, Daniel Fischer [EMAIL PROTECTED] wrote: True, but again, what are you trying to do? I've already did what I was trying to do. Congrats. How

Re: [Haskell-cafe] Re: Wikipedia on first-class object

2007-12-30 Thread Daniel Fischer
Am Sonntag, 30. Dezember 2007 18:16 schrieb Cristian Baboi: A simple question: Can you write the value of x to a file where x = (1:x) ? Not in finite time and space :) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Re: Wikipedia on first-class object

2007-12-30 Thread Daniel Fischer
Am Sonntag, 30. Dezember 2007 19:04 schrieb Cristian Baboi: On Sun, 30 Dec 2007 20:00:05 +0200, Daniel Fischer [EMAIL PROTECTED] wrote: Am Sonntag, 30. Dezember 2007 18:16 schrieb Cristian Baboi: A simple question: Can you write the value of x to a file where x = (1:x

Re: [Haskell-cafe] Re: Wikipedia on first-class object

2007-12-30 Thread Daniel Fischer
Am Sonntag, 30. Dezember 2007 19:31 schrieb Cristian Baboi: On Sun, 30 Dec 2007 20:24:23 +0200, Daniel Fischer [EMAIL PROTECTED] wrote: Am Sonntag, 30. Dezember 2007 19:04 schrieb Cristian Baboi: On Sun, 30 Dec 2007 20:00:05 +0200, Daniel Fischer [EMAIL PROTECTED] wrote: Am Sonntag

Re: [Haskell-cafe] Difference lists and ShowS (Was: The Worker/Wrapper Transformation)

2008-01-03 Thread Daniel Fischer
Am Donnerstag, 3. Januar 2008 14:48 schrieb Henning Thielemann: On Thu, 3 Jan 2008, Isaac Dupree wrote: Achim Schneider wrote: Achim Schneider [EMAIL PROTECTED] wrote: [...] I'm trying to grok that [] = id ++ = . in the context of Hughes lists. they are also known

Re: [Haskell-cafe] Instance classes and error (also, related to Data.Binary.GET)

2008-01-03 Thread Daniel Fischer
I've no experience with Data.Binary, but I noticed you declared instance Binary YourType where... and the compiler says instance Binary (Get YourType) is missing. That might be worth looking into. Cheers, Daniel Am Freitag, 4. Januar 2008 00:13 schrieb bbrown: I am using the Data.Binary

Re: [Haskell-cafe] US Homeland Security program language security risks

2008-01-06 Thread Daniel Fischer
Am Sonntag, 6. Januar 2008 14:27 schrieb Mads Lindstrøm: Hi, Andrew Coppin wrote: Galchin Vasili wrote: Hello, https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/coding /295.html I stumbled across this page. It seems that Haskell and other strongly typed

Re: [Haskell-cafe] US Homeland Security program language security risks

2008-01-06 Thread Daniel Fischer
Am Sonntag, 6. Januar 2008 15:18 schrieb Andrew Coppin: Daniel Fischer wrote: Just because I don't know: what bugs would be possible in a language having only the instruction return () Bug #1: You cannot write any nontrivial programs. ;-) That's not a bug, that's a feature

Re: [Haskell-cafe] Re: US Homeland Security program language security risks

2008-01-06 Thread Daniel Fischer
Am Sonntag, 6. Januar 2008 15:54 schrieb Achim Schneider: Daniel Fischer [EMAIL PROTECTED] wrote: Am Sonntag, 6. Januar 2008 15:18 schrieb Andrew Coppin: Daniel Fischer wrote: Just because I don't know: what bugs would be possible in a language having only the instruction return

Re: [Haskell-cafe] Solving a geometry problem with Haskell

2008-01-12 Thread Daniel Fischer
Am Samstag, 12. Januar 2008 22:48 schrieb Luke Palmer: On Jan 12, 2008 9:19 PM, Rafael Almeida [EMAIL PROTECTED] wrote: After some profiling I found out that about 94% of the execution time is spent in the ``isPerfectSquare'' function. That function is quite inefficient for large numbers.

Re: [Haskell-cafe] the trivial monad- thoughts and a question

2008-01-12 Thread Daniel Fischer
Am Sonntag, 13. Januar 2008 01:47 schrieb Brian Hurt: So, I've been playing around with what I call the trivial monad: module TrivialMonad where data TrivialMonad a = M a recover :: TrivialMonad a - a recover (M x) = x instance Monad TrivialMonad where (M x) = f = f x (M

Re: Naming and coding style (was: [Haskell-cafe] First time haskell - parse error!)

2010-03-10 Thread Daniel Fischer
Am Mittwoch 10 März 2010 13:03:59 schrieb Ketil Malde: never introduce names if it increases the size of your program.  (Corrolary: don't name things that aren't referred to at least twice) Objection! If the final result of your function is a combination of a handful or two of long (and

Re: [Haskell-cafe] First time haskell - parse error!

2010-03-10 Thread Daniel Fischer
Am Mittwoch 10 März 2010 14:53:32 schrieb Stephen Tetley: Hello all Algorithmically oddSquareSum is a bit below par though... oddSquareSum :: Integer oddSquareSum = sum . takeWhile (1) . filter odd . map (^2) $ [1..] Why filter out the evens after generating them? oos1 ::

Re: [Haskell-cafe] Space leak

2010-03-10 Thread Daniel Fischer
Am Mittwoch 10 März 2010 21:45:56 schrieb Arnoldo Muller: Hello, I am learning haskell and I found a space leak that I find difficult to solve. I've been asking at #haskell but we could not solve the issue. I want to lazily read a set of 22 files of about 200MB each, filter them and then I

Re: [Haskell-cafe] definition of sum

2010-03-10 Thread Daniel Fischer
Am Mittwoch 10 März 2010 22:33:43 schrieb TeXitoi: After programming as an exercice the sum function, my version is faster than the Data.List's version. Looking at the source code, Data.List uses a foldl and not a foldl'. foldl' seems faster and allows to use very big lists. So, why is foldl

Re: [Haskell-cafe] Space leak

2010-03-10 Thread Daniel Fischer
Am Mittwoch 10 März 2010 23:01:28 schrieb Arnoldo Muller: Hello Daniel: Thanks! I employed mapM'_ but I am still getting the space leak. Any other hint? Hmm, offhand, I don't see why that isn't strict enough. With some datafiles, I could try to investigate. One question, how does programme

Re: [Haskell-cafe] Problem installing wxHaskell on Haskell Platform on OSX.

2010-03-10 Thread Daniel Fischer
Am Mittwoch 10 März 2010 23:31:15 schrieb Ivan Miljenovic: On 11 March 2010 09:14, David Place d...@vidplace.com wrote: $ cabal install wx Resolving dependencies... cabal: cannot configure containers-0.3.0.0. It requires base =4.2 6 For the dependency on base =4.2 6 there are these

Re: [Haskell-cafe] definition of sum

2010-03-11 Thread Daniel Fischer
Am Donnerstag 11 März 2010 15:23:32 schrieb Yitzchak Gale: TeXitoi wrote: why is foldl used by Data.List for sum? Daniel Fischer wrote: Because Haskell is a non-strict language, and foldl' is strict -- someone might write a (legitimate) Num instance for a datatype such that foldl (+) 0

Re: [Haskell-cafe] Space leak

2010-03-11 Thread Daniel Fischer
Am Donnerstag 11 März 2010 00:24:28 schrieb Daniel Fischer: Hmm, offhand, I don't see why that isn't strict enough. Turns out, mapM_ was a red herring. The villain was (zip and map). I must confess, I don't know why it sort-of worked without the mapM_, though. sort-of, because that also hung

Re: [Haskell-cafe] Re: If wishes were horses... (was: Re: definition of sum)

2010-03-12 Thread Daniel Fischer
Am Freitag 12 März 2010 12:14:06 schrieb Paul R: wren I wish Haskell allowed ! to occur (non-initially) in alphanum_' wren identifiers as well as in symbolic ones. Then we could be more wren consistent about having ! mean strictness BTW, does something in haskell syntax prevent '?' from

Re: [Haskell-cafe] When is a bug GHC's fault/strange STM behaviour

2010-03-13 Thread Daniel Fischer
Am Samstag 13 März 2010 17:36:49 schrieb Michael Lesniak: Hello, In one of my example programs I have a strange behaviour: it is a very simple taskpool using STM; in pseudocode it's 1. generate data structures 2. initialize data structures 3. fork threads 4. wait (using STM) until the

Re: [Haskell-cafe] Space leak

2010-03-13 Thread Daniel Fischer
Am Sonntag 14 März 2010 00:58:09 schrieb Arnoldo Muller: Jason, I am trying to use haskell in the analysis of bio data. One of the main reasons I wanted to use haskell is because lazy I/O allows you to see a large bio-sequence as if it was a string in memory. In order to achieve the same

Re: [Haskell-cafe] Splitting list with predicate

2010-03-14 Thread Daniel Fischer
Am Sonntag 14 März 2010 21:19:19 schrieb michael rice: Thanks all, Wouldn't one need to know the order of the arguments? (a - Bool) - [a] - ([a], [a]) hoogle also lists functions with similar types, so it probably also would find partition if you searched for a function of type [a] - (a -

Re: [Haskell-cafe] How to do the permutation and combination thing?

2010-03-15 Thread Daniel Fischer
Am Montag 15 März 2010 08:37:20 schrieb Magicloud Magiclouds: Sorry, I did not make it clear, since I did not know how to say this in technical terms. With comprehension, I could get all the possibilities that draw one elem from each list and put them together. But consider this: for example,

Re: [Haskell-cafe] Re: HGL concurrency problems

2010-03-16 Thread Daniel Fischer
Am Dienstag 16 März 2010 20:23:54 schrieb Carsten Schultz: Am 16.03.10 19:55, schrieb Carsten Schultz: I would also like to know if it works on other platforms/versions. To answer my own question: I just tested Debian / ghc 6.8.2 / HGL 3.2.0.0-3 (with X redirected to a Mac, though) The

Re: [Haskell-cafe] Alternative dependencies in Cabal file

2010-03-17 Thread Daniel Fischer
Am Mittwoch 17 März 2010 12:11:53 schrieb Matthias Reisner: Hi, for a package I need to ensure the user uses a certain package configuration. So how would I rewrite the following pseudo-cabal description? Build-Depends: packageA X, packageB Y or

Re: [Haskell-cafe] stuck with a sample of programming in haskell

2010-03-17 Thread Daniel Fischer
Am Mittwoch 17 März 2010 16:35:08 schrieb 国平张: Thanks very much. It works! I just wonder if you can help me to define a Monad to make do notion works :-) ? To make an instance of Monad, you must create a new datatype, for example module Parse where newtype Parser a = P { parse :: (String -

Re: [Haskell-cafe] Iteratee performance

2010-03-17 Thread Daniel Fischer
Am Mittwoch 17 März 2010 17:01:06 schrieb Gregory Collins: Vasyl Pasternak vasyl.paster...@gmail.com writes: Hi Cafe, Yesterday I played with iteratee package, and wanted to check its performance. I tried to count lines in a file, as Oleg in his famous lazy_vs_correct[1] article. The

Re: [Haskell-cafe] Parallel Pi

2010-03-17 Thread Daniel Fischer
Am Mittwoch 17 März 2010 19:49:57 schrieb Artyom Kazak: Hello! I tried to implement the parallel Monte-Carlo method of computing Pi number, using two cores: move But it uses only on core: snip We see that our one spark is pruned. Why? Well, the problem is that your tasks don't do any

Re: [Haskell-cafe] How to improve its performance ?

2010-03-17 Thread Daniel Fischer
Am Donnerstag 18 März 2010 00:53:28 schrieb zaxis: import Data.List combination :: [a] - [[a]] combination [] = [[]] combination (x:xs) = (map (x:) (combination xs) )++ (combination xs) That would normally be called sublists (or subsets, if one regards lists as representing a set), I

Re: [Haskell-cafe] How to improve its performance ?

2010-03-18 Thread Daniel Fischer
Am Donnerstag 18 März 2010 05:03:28 schrieb Alexander Solla: On Mar 17, 2010, at 8:33 PM, zaxis wrote: `allPairs list = [(x,y) | x - list, y - list] ` is not what `combination` does ! let allPairs list = [(x,y) | x - list, y - list] allPairs [1,2,3]

Re: [Haskell-cafe] How to improve its performance ?

2010-03-18 Thread Daniel Fischer
enumeration. Now, if you actually let ghci print out the result, the printing takes a long time. So much that the difference in efficiency is hardly discernible or not at all. Daniel Fischer-4 wrote: Am Donnerstag 18 März 2010 00:53:28 schrieb zaxis: import Data.List combination

Re: [Haskell-cafe] Performance question

2010-03-18 Thread Daniel Fischer
Am Donnerstag 18 März 2010 19:59:33 schrieb Arnoldo Muller: Hello! I am trying to implement a binary search function that returns the index of an exact or the (index + 1) where the item should be inserted in an array if the item to be searched is not found (I am not trying to insert data in

Re: [Haskell-cafe] Performance question

2010-03-18 Thread Daniel Fischer
Am Donnerstag 18 März 2010 20:49:30 schrieb Daniel Fischer: Am Donnerstag 18 März 2010 19:59:33 schrieb Arnoldo Muller: Hello! I am trying to implement a binary search function that returns the index of an exact or the (index + 1) where the item should be inserted in an array

Re: [Haskell-cafe] Performance question

2010-03-18 Thread Daniel Fischer
Am Donnerstag 18 März 2010 21:57:34 schrieb Daniel Fischer: Contrary to my expectations, however, using unboxed arrays is slower than straight arrays (in my tests). However, a few {-# SPECIALISE #-} pragmas set the record straight. Specialising speeds up both, boxed and unboxed arrays

Re: [Haskell-cafe] Re: Parallel Pi

2010-03-18 Thread Daniel Fischer
Am Freitag 19 März 2010 00:56:15 schrieb Erik de Castro Lopo: Daniel Fischer wrote: 3.06GHz Pentium 4, 2 cores. Do you have more info on that? Try: grep 'model name' /proc/cpuinfo Well, $ cat /proc/cpuinfo processor : 0

Re: [Haskell-cafe] Re: Parallel Pi

2010-03-18 Thread Daniel Fischer
Am Freitag 19 März 2010 02:25:47 schrieb Xiao-Yong Jin: On Fri, 19 Mar 2010 01:22:58 +0100, Daniel Fischer wrote: core id : 0 cpu cores : 1 It is one of those pathetic single core pentium4 with so called hyper-threading enabled. 'kay, but why does it say processor : 0

Re: [Haskell-cafe] How to improve its performance ?

2010-03-18 Thread Daniel Fischer
Am Freitag 19 März 2010 02:56:36 schrieb zaxis: %cat Test.hs module Test(mcombs) where import Data.List mcombs = foldr (flip (=) . f) [[]] where f x xs = [x:xs,xs] %ghc -c -O2 Test.hs %ghci :l Test Ok, modules loaded: Test. :set +s length $ mcombs [1..20] 1048576 (0.06 secs,

Re: [Haskell-cafe] Re: Parallel Pi

2010-03-18 Thread Daniel Fischer
Am Freitag 19 März 2010 04:24:21 schrieb Erik de Castro Lopo: Daniel Fischer wrote: Am Freitag 19 März 2010 02:25:47 schrieb Xiao-Yong Jin: It is one of those pathetic single core pentium4 with so called hyper-threading enabled. 'kay, but why does it say processor : 0

Re: [Haskell-cafe] Why does `flip` cause function type so different ?

2010-03-18 Thread Daniel Fischer
Am Freitag 19 März 2010 04:34:53 schrieb zaxis: let f x xs = [x:xs,xs] :t f f :: a - [a] - [[a]] :t (=) .f (=) .f :: a - ([[a]] - [a] - b) - [a] - b :t (flip (=) .f) (flip (=) .f) :: a - [[a]] - [[a]] Why is the type of `(=) .f` and `flip (=) .f` so different ? Because the

[Haskell-cafe] Re: Parallel Pi

2010-03-21 Thread Daniel Fischer
-Ursprüngliche Nachricht- Von: Simon Marlow marlo...@gmail.com Gesendet: 19.03.2010 09:24:12 An: Daniel Fischer daniel.is.fisc...@web.de Betreff: Re: Parallel Pi On 18/03/10 22:52, Daniel Fischer wrote: Am Donnerstag 18 März 2010 22:44:55 schrieb Simon Marlow: On 17/03/10 21:30, Daniel

Re: [Haskell-cafe] Re: Occurs check error, help!

2010-03-22 Thread Daniel Fischer
-Ursprüngliche Nachricht- Von: adamtheturtle kill2thr...@hotmail.com Gesendet: 22.03.2010 04:52:19 An: haskell-cafe@haskell.org Betreff: [Haskell-cafe] Re: Occurs check error, help! Ivan Miljenovic ivan.miljenovic [ gmail.com writes: Since my answer before to your question obviously

Re: [Haskell-cafe] accents

2010-03-24 Thread Daniel Fischer
-Ursprüngliche Nachricht- Von: Dupont Corentin corentin.dup...@gmail.com Gesendet: 24.03.2010 11:01:32 An: haskell haskell-cafe@haskell.org Betreff: [Haskell-cafe] accents Hello, i have a list of french words with accents. How could i handle them? If i load them with ghci i get: a -

Re: [Haskell-cafe] Re: really difficult for a beginner like me...

2010-03-24 Thread Daniel Fischer
-Ursprüngliche Nachricht- Von: saaj [ Gesendet: 24.03.2010 13:13:29 An: haskell-cafe@haskell.org Betreff: [Haskell-cafe] Re: really difficult for a beginner like me... saaJamal [ hotmail.com writes: U happen to find a way for your problem? I tried a lot for more than a week now, but

Re: [Haskell-cafe] Re: really difficult for a beginner like me...

2010-03-24 Thread Daniel Fischer
-Ursprüngliche Nachricht- Von: saaj [ Gesendet: 24.03.2010 15:17:19 An: haskell-cafe@haskell.org Betreff: [Haskell-cafe] Re: really difficult for a beginner like me... Thank you. I will try it What about the second part, capitalisation thing? can you help me with that as well? Treat a

Re: [Haskell-cafe] Are there any female Haskellers?

2010-03-27 Thread Daniel Fischer
-Ursprüngliche Nachricht- Von: Günther Schmidt gue.schm...@web.de Gesendet: 27.03.2010 16:14:57 An: haskell-cafe@haskell.org Betreff: [Haskell-cafe] Are there any female Haskellers? Hi all, from the names of people on the list it seems that all users here are males. Just out of

[Haskell-cafe] ANN: New wxHaskell

2010-04-01 Thread Daniel Fischer
I've uploaded a new wx-suite, wxdirect-0.12.1.3, wxcore-0.12.1.4, wx-0.12.1.4, wx now builds with ghc-6.10 and ghc-6.12, sorry for breaking 6.10 earlier. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Different behavior of GHC 6.10.1 and Hugs (Sep 2006)

2010-04-03 Thread Daniel Fischer
Am Samstag 03 April 2010 15:40:03 schrieb Vladimir Reshetnikov: Hi list, GHC 6.10.1: Prelude :t let f x y = return x == return y in f let f x y = return x == return y in f :: (Eq (m a), Monad m) = a - a - Bool Hugs (Sep 2006): Hugs :t let f x y = return x == return y in f ERROR -

Re: [Haskell-cafe] A function that makes list of Bool lists from list of Int lists

2010-04-03 Thread Daniel Fischer
Am Samstag 03 April 2010 15:54:26 schrieb Maur Toter: Hey, I am new with Haskell so I think this will be a pretty dumb question. I would like to make a function that makes this: listbool :: [[Int]] - [[Bool]] in this way: listbool [[1,2],[3,4]] == [[True, True],[False, False]] listbool

Re: [Haskell-cafe] A function that makes list of Bool lists from list of Int lists

2010-04-03 Thread Daniel Fischer
Am Samstag 03 April 2010 19:44:51 schrieb Alexandru Scvortov: Look at it from the inside, out. What does const do? Const is a function that takes two parameters and always returns the first one. For instance, const True x is True, for all x. What's \x - map (const x) then? (or map.const

Re: [Haskell-cafe] The 8 Most Important GSoC Projects

2010-04-03 Thread Daniel Fischer
Am Samstag 03 April 2010 20:45:47 schrieb Don Stewart: schlepptop: Don Stewart schrieb: While at ZuriHac, a few of us GSoC mentors got together to discuss what we think the most important student projects for the summer should be. Here's the list:

Re: [Haskell-cafe] Haskell on Debian

2010-04-05 Thread Daniel Fischer
Am Montag 05 April 2010 17:19:35 schrieb Alex Rozenshteyn: Anyone? base isn't listed among the build-depends of the executable, so the obvious thing is to add base to the build-depends and see what happens then (might also be necessary for some other packages). I'm not sure whether iterating

Re: [Haskell-cafe] Haskell on Debian

2010-04-05 Thread Daniel Fischer
Am Montag 05 April 2010 17:39:29 schrieb Alex Rozenshteyn: I did try that; after adding a bunch of packages to the .cabal file and trying to build i get this: [ 1 of 81] Compiling Plugin.Dict.DictLookup ( Plugin/Dict/DictLookup.hs, dist/build/lambdabot/lambdabot-tmp/Plugin/Dict/DictLookup.o )

Re: [Haskell-cafe] Re: Hackage accounts and real names

2010-04-06 Thread Daniel Fischer
Am Dienstag 06 April 2010 14:57:30 schrieb Heinrich Apfelmus: Edward Z. Yang wrote: This is a pretty terrible reason, but I'm going to throw it out there: I like real names because they're much more aesthetically pleasing. I agree, and this is why I phased out apfelmus in favor of the

Re: [Haskell-cafe] Re: Haskell.org re-design

2010-04-07 Thread Daniel Fischer
Am Mittwoch 07 April 2010 04:09:17 schrieb Gregory Crosswhite: While I think that (d) is a valid concern, it is also important not to let the perfect be the enemy of the good.  If we agree that the proposed web site layout is sufficiently better than the current one and is good enough

Re: [Haskell-cafe] Re: Haskell.org re-design

2010-04-07 Thread Daniel Fischer
Am Mittwoch 07 April 2010 18:53:28 schrieb Thomas Schilling: Yup, I have to agree. The Ruby web site certainly is the best web site for a programming language that I've come across, but it's certainly not amazing. I like the python documentation design, but their home page is a bit dull.

Re: [Haskell-cafe] Simple binary-protocol through network test

2010-04-07 Thread Daniel Fischer
Am Mittwoch 07 April 2010 19:50:43 schrieb Yves Parès: I'm wondering, would it be a problem of chunk size when using L.hGetContents? Since the data to read is shorter than the default chunk size (32k), would it cause problems? That shouldn't cause problems. When less than the default chunk

Re: [Haskell-cafe] Simple binary-protocol through network test

2010-04-07 Thread Daniel Fischer
\NUL\NUL\ETX and exiting, but that is to be expected, isn't it? Daniel Fischer-4 wrote: That shouldn't cause problems. When less than the default chunk size is available, it makes a chunk of what it got and tries to get more later (unless it found EOF, then it closes the handle

Re: [Haskell-cafe] Simple binary-protocol through network test

2010-04-07 Thread Daniel Fischer
Am Mittwoch 07 April 2010 21:53:20 schrieb Daniel Fischer: Am Mittwoch 07 April 2010 20:43:24 schrieb Yves Parès: Yes, from what I read, I assumed it had this behavior. But, then, I don't see why the server holds... I've posted a mail on Haskell-Cafe called Network: buffering troubles

Re: [Haskell-cafe] Confusions about the Haskell Platform (for Mac)

2010-04-07 Thread Daniel Fischer
Am Mittwoch 07 April 2010 23:43:05 schrieb Ivan Lazar Miljenovic: Malcolm Wallace malcolm.wall...@cs.york.ac.uk writes: The Haskell Platform is not like a standard user application, where it would be reasonable to have only one version installed at a time. As far as I know, most Linux

Re: [Haskell-cafe] Confusions about the Haskell Platform (for Mac)

2010-04-07 Thread Daniel Fischer
Am Donnerstag 08 April 2010 00:09:34 schrieb Ivan Lazar Miljenovic: Daniel Fischer daniel.is.fisc...@web.de writes: I currently have 6.10.1, 6.10.3 and 6.12.1 installed (openSuSe 11.1), no problem. On my previous computer (SuSE 8.2), I had every release from 6.2.2 to 6.8.2, no problem

Re: [Haskell-cafe] Confusions about the Haskell Platform (for Mac)

2010-04-07 Thread Daniel Fischer
Am Donnerstag 08 April 2010 01:47:19 schrieb Ivan Miljenovic: On 8 April 2010 08:25, Daniel Fischer daniel.is.fisc...@web.de wrote: Am Donnerstag 08 April 2010 00:09:34 schrieb Ivan Lazar Miljenovic: etc. ... Such as? To avoid stating these all over again: http

Re: [Haskell-cafe] Simple binary-protocol through network test

2010-04-08 Thread Daniel Fischer
Am Donnerstag 08 April 2010 09:17:04 schrieb Yves Parès: Problem tracked! It comes from the last version of bytestring package. Alas, it's maybe not so simple. I tried with bytestring-0.9.1.5, and it works perfectly. I just tried with bytestring-0.9.1.6 and it worked perfectly for sending

Re: [Haskell-cafe] haskell gsoc proposal for richer numerical type classes and supporting algorithms

2010-04-08 Thread Daniel Fischer
Am Freitag 09 April 2010 02:51:23 schrieb Gregory Crosswhite: On Apr 8, 2010, at 5:30 PM, Casey McCann wrote: On Thu, Apr 8, 2010 at 7:58 PM, wren ng thornton w...@freegeek.org wrote: Exactly. NaN /= NaN [...] Indeed. NaN means that equality is not reflexive for floats in general,

Re: [Haskell-cafe] Cabal dependency hell

2010-04-11 Thread Daniel Fischer
Am Sonntag 11 April 2010 18:43:30 schrieb Maciej Piechotka: * Build reporting in the hackage server The idea here is that cabal sends back anonymous reports to the server to say if a package compiled or not, and against what versions of dependencies. This would make it

Re: [Haskell-cafe] Can't login to GHC trac

2010-04-13 Thread Daniel Fischer
Am Dienstag 13 April 2010 09:29:18 schrieb Erik de Castro Lopo: Hi all, I'm having trouble logging into GHC's Trac bug tracker at: http://hackage.haskell.org/trac/ghc/ I'm using Iceweasel 3.5.8 (Debian's rebranded Firefox) and I've also tried Galeon. The message I get is:

Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-14 Thread Daniel Fischer
Am Mittwoch 14 April 2010 23:13:13 schrieb Gregory Collins: Jesper Louis Andersen jesper.louis.ander...@gmail.com writes: This post describes some odd behaviour I have seen in GHC 6.12.1 when writing Combinatorrent. The post is literate Haskell so you can run it. The executive summary: A

Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-14 Thread Daniel Fischer
Am Mittwoch 14 April 2010 23:49:43 schrieb Jason Dagit: It will be interesting to hear what fixes this! forever' m = do _ - m                 forever' m When I define that version of forever, the space leak goes away. Not with optimisations.

  1   2   3   4   5   6   7   8   9   10   >