Re: [Haskell-cafe] Using ShowS or Difference Lists

2010-02-06 Thread Daniel Fischer
Am Samstag 06 Februar 2010 13:42:40 schrieb Mark Spezzano: > Hi, > > Just wondering whether I can use ShowS or tupling or Difference Lists to > speed up the following code? > > It's basic text processing. It takes in a list of Lines where each Line > is a list of Words and intersperses " " between

Re: [Haskell-cafe] Interpreting profiling results

2010-02-08 Thread Daniel Fischer
Am Montag 08 Februar 2010 17:04:44 schrieb Gregory Collins: > Hello all, > > A friend and I are trying to benchmark some network server code which > runs fine on my OSX laptop (~7500 req/s) but which is >10x slower on a > much faster 8-core Xeon Linux box. > > The profiling run on Linux looks like

Re: [Haskell-cafe] Interpreting profiling results

2010-02-08 Thread Daniel Fischer
Am Montag 08 Februar 2010 18:15:30 schrieb Gregory Collins: > > I'm just curious as to what the meaning of the MAIN cost centre is -- is > it just a catch-all bucket? Are we measuring time spent in the runtime > system? > > G MAIN is always the root of the call-tree, so I think it's the cost-centr

Re: [Haskell-cafe] Spelling checker exercise

2010-02-08 Thread Daniel Fischer
Am Montag 08 Februar 2010 22:58:03 schrieb Matthew Phillips: > P.S. > > > Daniel: > > > > [*] classic example: why will > > > > average xs = sum / len > >   where > >      (sum,len) = foldl' accum (0,0) xs > >      accum (sm,ln) x = (sm+x,ln+1) > > > > cause a stack overflow for long lists? > > You

Re: [Haskell-cafe] Iteratee, parsec & co.

2010-02-09 Thread Daniel Fischer
Am Dienstag 09 Februar 2010 10:03:46 schrieb Maciej Piechotka: Sorry, I haven't looked at iteratees at all, so I can't answer your questions. > PS. I guess iteratee does qualify as cafe but if beginner would be more > appropriate group then I'm sorry - I'll remember next time. It's not that one

Re: [Haskell-cafe] Generate random UArray in constant memory space.

2010-02-09 Thread Daniel Fischer
Am Dienstag 09 Februar 2010 13:18:23 schrieb Vasyl Pasternak: > Hello Cafe, > > I tried to generate memory-efficient list of random numbers, so I've > used uvector library for this task. But it doesn't work, > it still allocates more than 6Gb of memory for the random list of 10 > > million elements

Re: [Haskell-cafe] Generate random UArray in constant memory space.

2010-02-09 Thread Daniel Fischer
andom list, just to replace `enumFromToU` with my own list generator. > > So the question - is it possible to implement random list similary to > enumFromToU? > > > [1]http://donsbot.wordpress.com/2008/06/04/haskell-as-fast-as-c-working- >at-a-high-altitude-for-low-level-perfo

Re: [Haskell-cafe] Generate random UArray in constant memory space.

2010-02-09 Thread Daniel Fischer
; >>   printf "%d\n"  (sumU ints) > > > > This code runs in constant space (on my pc ~25kb allocates on the > > heap) regardless of array size. So I tried to achieve similar with > > random list, just to replace `enumFromToU` with my own list generator. > >

Re: [Haskell-cafe] Generate random UArray in constant memory space.

2010-02-09 Thread Daniel Fischer
sters on either system (BTW, have you tried it with the specialised PRNG code in the source file? I'm not sure whether that might be just small enough to run in the registers on a 64-bit system.). > > 2010/2/9 Daniel Fischer : > > Am Tuesday 09 February 2010 15:43:13 schrieben Sie:

Re: [Haskell-cafe] Generate random UArray in constant memory space.

2010-02-09 Thread Daniel Fischer
Am Dienstag 09 Februar 2010 19:27:58 schrieb Bryan O'Sullivan: > On Tue, Feb 9, 2010 at 4:18 AM, Vasyl Pasternak > > wrote: > > I tried to generate memory-efficient list of random numbers, so I've > > used uvector library for this task. > > Use the mwc-random package. It provides a function that do

Re: [Haskell-cafe] Using Cabal during development

2010-02-10 Thread Daniel Fischer
Am Mittwoch 10 Februar 2010 18:16:42 schrieb Limestraël: > Neil Brown-7 wrote: > > Don't you simply need to do what the error message says, and add (*in > > the Executable section*, at the end of the file): > > Nope, just check my previous message (my issue (2)): I think http://www.haskell.org/ghc

Re: [Haskell-cafe] Haskell IDEs on Windows; gtk2hs

2010-02-12 Thread Daniel Fischer
Am Freitag 12 Februar 2010 22:45:10 schrieb Alistair Bayley: > I thought I'd try some of the Haskell IDEs: eclipsefp, leksah, and yi. > So far, leksah requires gtk2hs (and apparently yi can use it too?), > and the latest gtk2hs installer for Windows doesn't like the latest > Haskell Platform, so I'

Re: [Haskell-cafe] Interpreting profiling results

2010-02-16 Thread Daniel Fischer
Am Dienstag 16 Februar 2010 15:45:38 schrieb Jean-Marie Gaillourdet: > Warning: speculation ahead, but is based on my knowledge on other > profilers. > > Many profilers work statistically, they interrupt a program at more less > random (or equal) intervals and inspect the stack, whick is of course

Re: [Haskell-cafe] Pointfree composition for higher arity

2010-02-17 Thread Daniel Fischer
Am Mittwoch 17 Februar 2010 16:31:16 schrieb Sean Leather: > I find myself often writing this pattern: > > someFun x y z = ... > > > > fun y z = runFun $ someFun someDefault y z > > > or, alternatively: > > fun y = runFun . someFun someDefault y > > > The second option approaches the ideal pointfre

Re: [Haskell-cafe] Re: Implementing "unionAll"

2010-02-17 Thread Daniel Fischer
Am Mittwoch 17 Februar 2010 17:46:38 schrieb Ozgur Akgun: > > The easiest solution is simply to define > > > >unionAll = nub . mergeAll > >where > >-- specialized definition of nub > >nub = map head . groupBy (==) > > Talking about the easiest solution, I guess this is

Re: [Haskell-cafe] Re: Implementing "unionAll"

2010-02-17 Thread Daniel Fischer
Am Mittwoch 17 Februar 2010 18:59:42 schrieb Ozgur Akgun: > Ooops I thought the inner lists are possibly of infinite size. > Both, I think. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Daniel Fischer
Am Donnerstag 18 Februar 2010 14:48:08 schrieb Nick Rudnick: > even in Germany, where the > term «ring» seems to originate from, since at least a century nowbody > has the least idea it once had an alternative meaning «gang,band,group», Wrong. The term "Ring" is still in use with that meaning in c

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Daniel Fischer
ns. > > Thanks for your examples: A «gang» {of smugglers|car thieves} shows even > the original meaning -- once knowed -- does not reflect the > characteristics of the mathematical structure. > > Cheers, > > Nick > > Daniel Fischer wrote: > > Am Donnerstag 18 Febru

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Daniel Fischer
Am Donnerstag 18 Februar 2010 19:19:36 schrieb Nick Rudnick: > Hi Hans, > > agreed, but, in my eyes, you directly point to the problem: > > * doesn't this just delegate the problem to the topic of limit > operations, i.e., in how far is the term «closed» here more perspicuous? It's fairly natural

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Daniel Fischer
Am Donnerstag 18 Februar 2010 19:55:31 schrieb Nick Rudnick: > Gregg Reynolds wrote: > > On Thu, Feb 18, 2010 at 7:48 AM, Nick Rudnick > > mailto:joerg.rudn...@t-online.de>> wrote: > > > > IM(H??)O, a really introductive book on category theory still is > > to be written -- if category theo

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Daniel Fischer
Am Donnerstag 18 Februar 2010 21:47:02 schrieb Hans Aberg: > On 18 Feb 2010, at 20:20, Daniel Fischer wrote: > >> + definition backtracking: «A closure operation c is defined by the > >> property c(c(x)) = c(x). > > > > Actually, that's incomplete, ... > &

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Daniel Fischer
Am Freitag 19 Februar 2010 00:24:23 schrieb Richard O'Keefe: > On Feb 19, 2010, at 3:55 AM, Daniel Fischer wrote: > > Am Donnerstag 18 Februar 2010 14:48:08 schrieb Nick Rudnick: > >> even in Germany, where the > >> term «ring» seems to originate from, since at leas

Re: [Haskell-cafe] Category Theory woes

2010-02-19 Thread Daniel Fischer
Am Freitag 19 Februar 2010 10:42:59 schrieb Hans Aberg: > On 19 Feb 2010, at 00:55, Daniel Fischer wrote: > >> I'd always assumed "ring" was generalised from Z[n]. > > > > As in "cyclic group", arrange the numbers in a ring like on a > > cloc

Re: [Haskell-cafe] Category Theory woes

2010-02-19 Thread Daniel Fischer
Am Freitag 19 Februar 2010 01:49:05 schrieb Nick Rudnick: > Daniel Fischer wrote: > > Am Donnerstag 18 Februar 2010 19:19:36 schrieb Nick Rudnick: > >> Hi Hans, > >> > >> agreed, but, in my eyes, you directly point to the problem: > >> > >> *

Re: [Haskell-cafe] Category Theory woes

2010-02-19 Thread Daniel Fischer
Am Freitag 19 Februar 2010 02:48:59 schrieb Nick Rudnick: > Hi, > > wow, a topic specific response, at last... But I wish you would be more > specific... ;-) > > >> A *referrer* (object) refers to a *referee* (object) by a *reference* > >> (arrow). > > > > Doesn't work for me. Not in Ens (sets, map

Re: [Haskell-cafe] A small oversight

2010-02-20 Thread Daniel Fischer
Am Samstag 20 Februar 2010 13:39:24 schrieb Ben Millwood: > a technique which I believe is called a Schwarzian transform. Schwartzian transform, with a tz. After Randal L. Schwartz. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskel

Re: [Haskell-cafe] STArray newListArray

2010-02-21 Thread Daniel Fischer
Am Sonntag 21 Februar 2010 16:30:00 schrieb Vojtěch Knyttl: > Hello, > > I am trying to create STArray with newListArray like this: > la x y = newListArray ((1,1),(x,y)) [(x'+y') | x' <- [1..x], y' <- > [1..y]] > > – but it does not work: > No instance for (MArray a Field m) > > I tried to define t

Re: [Haskell-cafe] GHC RTS question

2010-02-21 Thread Daniel Fischer
Am Sonntag 21 Februar 2010 16:45:22 schrieb Artyom Kazak: > Hello everybody! > I want to write a little program, that will receive a string as > command-line argument and write it in the file. But if this string > contains '+RTS', GHC runtime won't pass the rest of the string to my > program. > Wha

Re: [Haskell-cafe] GHC RTS question

2010-02-21 Thread Daniel Fischer
Am Sonntag 21 Februar 2010 18:20:43 schrieb Artyom Kazak: > > Enclose it in double quotes (perhaps single quotes would also work) > > No, I want my program to work the same way as UNIX "echo" does. > Without any double quotes. Okay, what about "If you absolutely positively want all the rest of th

Re: [Haskell-cafe] Profiling

2010-02-21 Thread Daniel Fischer
Am Sonntag 21 Februar 2010 18:22:07 schrieb Andrew Coppin: > Patai Gergely wrote: > >> I tried to compile my program with -prof, but GHC just whines at me > >> that the packages I'm using haven't been compiled for profiling. Do I > >> really need to go recompile every single package I'm using with

Re: [Haskell-cafe] GHC RTS question

2010-02-21 Thread Daniel Fischer
Am Sonntag 21 Februar 2010 19:58:12 schrieb Artyom Kazak: > 2010/2/21 Daniel Fischer : > > Am Sonntag 21 Februar 2010 18:20:43 schrieb Artyom Kazak: > >> > Enclose it in double quotes (perhaps single quotes would also work) > >> > >> No, I want my program t

Re: [Haskell-cafe] STArray newListArray

2010-02-21 Thread Daniel Fischer
Am Sonntag 21 Februar 2010 21:26:31 schrieb Vojtěch Knyttl: > Ok, the problem was the Monad, which I still don't get completely, > because I continue like this: > > data Field = W|B|H|D deriving (Eq,Show) > > pas :: ST s (STArray s (Int, Int) Field) -> ST s (STArray s (Int, Int) > Field) pas b = do

Re: [Haskell-cafe] Profiling

2010-02-21 Thread Daniel Fischer
Am Sonntag 21 Februar 2010 21:44:57 schrieb Andrew Coppin: > Daniel Fischer wrote: > > Am Sonntag 21 Februar 2010 18:22:07 schrieb Andrew Coppin: > >> Oh, right. So I actually need cabal.exe to do this then? > > > > No, you can also > > > > $ ./rungh

Re: [Haskell-cafe] Re: Function to detect duplicates

2010-02-23 Thread Daniel Fischer
Am Dienstag 23 Februar 2010 13:03:45 schrieb Ertugrul Soeylemez: > Rafael Gustavo da Cunha Pereira Pinto wrote: > > While solving a puzzle, I was posed the problem of finding if there > > was no duplicates on a list. > > > > First I used: > > > > noneRepeated=null.(filter (>1)).(map length).group.

Re: [Haskell-cafe] Re: Function to detect duplicates

2010-02-23 Thread Daniel Fischer
Am Dienstag 23 Februar 2010 13:59:49 schrieb Ertugrul Soeylemez: > Jonas Almström Duregård wrote: > > Ertugrul: while your solution is minimalistic, Rafael deemed his > > ~n*log n implementation too inefficient. Thus your ~n^3 implementation > > is hardly an improvement... Not quite as bad, nub i

Re: [Haskell-cafe] Re: Function to detect duplicates

2010-02-23 Thread Daniel Fischer
Am Dienstag 23 Februar 2010 14:54:36 schrieb Jonas Almström Duregård: > You are correct of course. Still, it will probably be a bit less > inefficient if the length of the lists are compared (as opposed to the > elements): > > noneRepeated xs = length xs == length (nub xs) Only if no repeated elem

Re: [Haskell-cafe] Proper round-trip HughesPJ/Parsec for Doubles?

2010-02-23 Thread Daniel Fischer
Am Dienstag 23 Februar 2010 14:44:50 schrieb Andy Gimblett: > Hi all, > > Short version: How can I pretty print and parse values of type Double > such that those operations are each other's inverse? > > Long version: I'm writing and QuickCheck-testing a parser using the > approach set out here: > >

Re: [Haskell-cafe] Re: Function to detect duplicates

2010-02-24 Thread Daniel Fischer
Am Mittwoch 24 Februar 2010 14:25:20 schrieb Ertugrul Soeylemez: > Jonas Almström Duregård wrote: > > >>noneRepeated xs = xs == nub xs > > > > > > Not quite as bad, nub is O(n^2) > > > > You are correct of course. Still, it will probably be a bit less > > inefficient if the length of the lists are

Re: [Haskell-cafe] Function to detect duplicates

2010-02-24 Thread Daniel Fischer
Am Mittwoch 24 Februar 2010 21:25:04 schrieb Gwern Branwen: > 2010/2/23 Jonas Almström Duregård : > > Hi Rafael, > > > > I assume you will perform this operation on some very large lists, or > > performance would not be an issue. Have you tested if your optimized > > version is better than your ini

Re: [Haskell-cafe] OpenSUSE 11.2

2010-02-24 Thread Daniel Fischer
Am Mittwoch 24 Februar 2010 23:17:46 schrieb Andrew Coppin: > Erlend Hamberg wrote: > > if you open the software manager and go to configuration → > > repositories, you should be able to add new software sources. i use > > the following repository: > > > > Server name: download.opensuse.org > > Dir

Re: [Haskell-cafe] hdbc-mysql fails to compile

2010-02-25 Thread Daniel Fischer
Am Donnerstag 25 Februar 2010 20:01:34 schrieb Thomas Girod: > Hi there. Looks like hdbc-mysql cannot compile against GHC-6.12 -- > confirmed by the hackage build logs. [1] Change in the Cabal API. > > anyone know a way to dodge the problem ? Rewrite Setup.[l]hs to work with the new API or peste

Re: [Haskell-cafe] Re: Function to detect duplicates

2010-02-25 Thread Daniel Fischer
Am Freitag 26 Februar 2010 00:57:48 schrieb Rafael Gustavo da Cunha Pereira Pinto: > Just to clarify the issue, I will propose the puzzle: > > There is a single 10 digit number that: > > 1) uses all ten digits [0..9], with no repetitions > 2) the number formed by the first digit (right to left, mo

Re: [Haskell-cafe] problem loading package unix-2.3.2.0 while installing hackages on OpenSuse

2010-02-26 Thread Daniel Fischer
Am Freitag 26 Februar 2010 12:52:36 schrieb gmi: > I have OpenSuse 11.2 running on VMWare and I have recently installed ghc > 6.10.4 from the RPM from OpenSuse. Now I want to install cabal. I have > downloaded the required packages from hackage and I try to run: In principle, just unpacking the ca

Re: GUI (was: Re: [Haskell-cafe] DLL on Windows)

2010-02-26 Thread Daniel Fischer
Am Mittwoch 17 Februar 2010 12:17:10 schrieb Jeremy O'Donoghue: > You're probably correct about the dependencies. I have never tried to > compile wxHaskell against GHC 6.12.1 > > I'm waiting for Haskell Platform to be released to make the required > changes since (working primarily on Windows) I ju

Re: [Haskell-cafe] Generalizing nested list comprehensions

2010-02-26 Thread Daniel Fischer
Am Freitag 26 Februar 2010 15:52:15 schrieb Ishaaq Chandy: > Hi all, > If this question sounds a bit noob-ish, that would be because I am one - > so apologies in advance! > > I have functions that look something like these: > > f1 :: [a] -> [b] > f1 xs = [foo [x1, x2] | > x1 <- xs, > x2 <

[Haskell-cafe] ANNOUNCE: wxHaskell for ghc-6.12.1

2010-02-26 Thread Daniel Fischer
Hi all, there's a new suite of wxHaskell on hackage, http://hackage.haskell.org/package/wxdirect-0.12.1.2 http://hackage.haskell.org/package/wxcore-0.12.1.3 http://hackage.haskell.org/package/wx-0.12.1.3 If you have ghc-6.12.1 and wxWidgets-2.8, a simple cabal install wx should give you wx GUI

Re: [Haskell-cafe] Re: Function to detect duplicates

2010-02-26 Thread Daniel Fischer
Am Freitag 26 Februar 2010 16:50:42 schrieb Ketil Malde: > | Am Freitag 26 Februar 2010 00:57:48 schrieb Rafael Gustavo da Cunha > | Pereira > | > | Pinto: > |> There is a single 10 digit number that: > |> > |> 1) uses all ten digits [0..9], with no repetitions > |> 2) the number formed by the firs

Re: [Haskell-cafe] Re: Function to detect duplicates

2010-02-26 Thread Daniel Fischer
Am Freitag 26 Februar 2010 21:34:28 schrieb Ketil Malde: > Daniel Fischer skrev: > > Am Freitag 26 Februar 2010 16:50:42 schrieb Ketil Malde: > >>> solutions = [[x1,x2,x3,x4,x5,x6,x7,x8,x9,x10] > >>> > >>> | x1 <- [0..9] > > > >

Re: [Haskell-cafe] Re: do we need types?

2010-02-26 Thread Daniel Fischer
Am Freitag 26 Februar 2010 14:07:07 schrieb Johannes Waldmann: > I wouldn't easily give up algebraic data types Nor I. Without easily defined ADTs, Haskell wouldn't be nearly so awesome. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.h

Re: [Haskell-cafe] Hackage statistics

2010-02-26 Thread Daniel Fischer
Am Freitag 26 Februar 2010 23:57:05 schrieb Don Stewart: > > 501 users have uploaded 7202 versions of 1870 packages. > > http://hackage.haskell.org/cgi-bin/hackage-scripts/stats > > The download stats are computed occasionally, but I've not had time > since Hackage moved to the new server. Wou

[Haskell-cafe] Hackage redirect loop

2010-02-26 Thread Daniel Fischer
Trying to access http://hackage.haskell.org/trac/hackage I land in a redirection loop no matter which page or which browser I try. It worked earlier today. Has anybody an idea what the heck might be going on? Is it just me? ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Hackage redirect loop

2010-02-26 Thread Daniel Fischer
Am Samstag 27 Februar 2010 02:15:17 schrieb Felipe Lessa: > On Sat, Feb 27, 2010 at 01:56:34AM +0100, Daniel Fischer wrote: > > Trying to access http://hackage.haskell.org/trac/hackage I land in a > > redirection loop no matter which page or which browser I try. It > > work

Re: [Haskell-cafe] Cabal pre-compiled packages

2010-02-27 Thread Daniel Fischer
Am Samstag 27 Februar 2010 16:39:27 schrieb Andrew Coppin: > Diego Souza wrote: > > Hi, > > > > currently when one install a cabal package it compiles it and then > > install generated binaries. I wonder whether or not it would be useful > > to have pre-compiled binaries as many package managers us

Re: [Haskell-cafe] passing cpp options to c2hs from cabal

2010-02-27 Thread Daniel Fischer
Am Samstag 27 Februar 2010 21:27:27 schrieb Chris Casinghino: > Hi all, > > I have a question about cpp, c2hs and cabal. The short version: > > What can I put in my cabal file to get "-cppopts=-U__BLOCKS__" passed > as an argument in calls to c2hs? Maybe cc-options: -U__BLOCKS__ is worth a try.

Re: [Haskell-cafe] How to understand `|` in this code snippet ?

2010-02-27 Thread Daniel Fischer
Am Sonntag 28 Februar 2010 02:08:18 schrieb zaxis: > Then can i change it to : > case timeout of > Just str -> do > [(t, _)] <- reads str > addTimeout t (hPutStrLn stderr "*** TIMEOUT" >> _exit 1) > return () > _ -> return () > > Sincerely! No. T

Re: [Haskell-cafe] OpenSUSE 11.2

2010-02-28 Thread Daniel Fischer
Am Sonntag 28 Februar 2010 13:23:11 schrieb Andrew Coppin: > Daniel Fischer wrote: > > Or, go to http://software.opensuse.org/search/ , type ghc [alex, > > happy, ...] in the search box, click the search button and > > 1-click-install. > > This works - and adds a

Re: [Haskell-cafe] Cabal will not find HaXml

2010-02-28 Thread Daniel Fischer
Am Sonntag 28 Februar 2010 14:41:03 schrieb Mads Lindstrøm: > Hi > > When I do: > > cabal list --simple-output | grep -i "HaXml 1.20" > > I get: > > HaXml 1.20 > > HaXml 1.20.1 > > HaXml 1.20.2 So there are versions HaXml 1.20* available on hackage > > But when running: > > runhaskell Setup.hs co

Re: [Haskell-cafe] OpenSUSE 11.2

2010-02-28 Thread Daniel Fischer
Am Sonntag 28 Februar 2010 17:52:19 schrieb Andrew Coppin: > It also puts the binary in a strange place, but I guess I can live with > that... Which strange place? By default, it should go to ~/.cabal/bin, I think. Anyway, you should add that to your path, put something like if [ -z `/bin/echo $

Re: [Haskell-cafe] OpenSUSE 11.2

2010-02-28 Thread Daniel Fischer
Am Sonntag 28 Februar 2010 18:30:59 schrieb Andrew Coppin: > Daniel Fischer wrote: > > Am Sonntag 28 Februar 2010 17:52:19 schrieb Andrew Coppin: > >> It also puts the binary in a strange place, but I guess I can live > >> with that... > > > > Which str

Re: [Haskell-cafe] OpenSUSE 11.2

2010-02-28 Thread Daniel Fischer
Am Sonntag 28 Februar 2010 20:07:28 schrieb Andrew Coppin: > > Oh, right. So it's checking whether it's already in the search path > before adding it. Right. > I would have just added it. ;-) That wouldn't do much harm, you'd just have it several times in your $PATH (which means it'll take a li

Re: [Haskell-cafe] OpenSUSE 11.2

2010-02-28 Thread Daniel Fischer
Am Sonntag 28 Februar 2010 20:40:15 schrieb Andrew Coppin: > Daniel Fischer wrote: > > Let me guess, you'd have tried ';' as the path-separator? > > I didn't know you have to use "export" for this to work... > You probably wouldn't need ex

Re: [Haskell-cafe] OpenSUSE 11.2

2010-02-28 Thread Daniel Fischer
Am Sonntag 28 Februar 2010 22:57:05 schrieb Andrew Coppin: > Andrew Coppin wrote: > > Now, hypothetically, I should have a Linux Haskell system, so I can > > actually compile *anything* that's on Hackage. > > Heh, I forgot how much fun building Gtk2hs is. ;-) But that's not yet on hackage :) > Th

Re: [Haskell-cafe] Cabal pre-compiled packages

2010-02-28 Thread Daniel Fischer
Am Sonntag 28 Februar 2010 23:20:00 schrieb Ivan Miljenovic: > /me really wishes people stopped thinking of Cabal as a package manager /me really wishes there were package managers as useful and easy as Cabal for things other than Haskell :D ___ Haskell

Re: [Haskell-cafe] GHC's parallel garbage collector -- what am I doing wrong?

2010-03-01 Thread Daniel Fischer
Am Montag 01 März 2010 16:59:54 schrieb Michael Lesniak: > I've (again) a very strange behaviour with the parallel GC and would be > glad if someone could either reproduce (and explain) it or provide a > solution. Sorry, can't reproduce it: $ for i in `seq 1 5`; do time ./mlPi 5000 +RTS -N1; done

Re: [Haskell-cafe] Performance of Knight's Tour

2010-03-01 Thread Daniel Fischer
Am Montag 01 März 2010 17:07:46 schrieb Artyom Kazak: > Hi! I'm learning Haskell, and now I'm trying to make framework for > solving searching problems, such as Knight's Tour. For small boards it > answers instantly. For 7x8 board - 23 seconds. For 8x8 board - more > than 30 minutes (it hasn't fini

Re: [Haskell-cafe] GHC's parallel garbage collector -- what am I doing wrong?

2010-03-01 Thread Daniel Fischer
Am Montag 01 März 2010 18:52:53 schrieb Michael Lesniak: > Hello Daniel, > > > Sorry, can't reproduce it: > > That's also very helpful, so thanks for this :-) > > > Seems your system has a problem synchronising the cores for GC. > > Correct. Could you please tell me your system configuration (i.e.

Re: [Haskell-cafe] Performance of Knight's Tour

2010-03-01 Thread Daniel Fischer
Am Montag 01 März 2010 19:29:45 schrieb Artyom Kazak: > 2010/3/1 Daniel Fischer : > > In the algorithm. You investigate far too many dead ends. Since for > > larger boards, the number of dead ends increases fast, larger boards > > take much much longer. > > Wi

Re: [Haskell-cafe] Performance of Knight's Tour

2010-03-01 Thread Daniel Fischer
Am Montag 01 März 2010 21:40:16 schrieb Artyom Kazak: > Maybe we were compiling with different options? I compiled with -O2 > -fvia-C -optc-O3. > ... > Oh, I know! I slightly changed the code. > > import Data.Ord > > e ((x, y), arr) p = [(t, arr // [(t, p)]) | t <- changes] > where >

Re: [Haskell-cafe] How do you rewrite your code?

2010-03-02 Thread Daniel Fischer
Am Dienstag 02 März 2010 21:00:56 schrieb Felipe Lessa: > > I think the right-hand side (RHS) is more concise and simpler. The > > types here do change: the type constructor has a Monad constraint in > > the left-hand side and a Functor constraint in the RHS. Types that are > > Monad instances are

Re: [Haskell-cafe] Profiling help (Warning: Euler spoilers)

2010-03-04 Thread Daniel Fischer
Am Donnerstag 04 März 2010 04:20:05 schrieb Louis Wasserman: > James, > > Which version of Control.Monad.State are you importing? > > If you're just importing vanilla Control.Monad.State, that's actually > sending you to Control.Monad.State.Lazy. > > Using Control.Monad.State.Strict might solve you

Re: [Haskell-cafe] New OpenGL package: efficient way to convert datatypes?

2010-03-04 Thread Daniel Fischer
Am Donnerstag 04 März 2010 14:55:30 schrieb Peter Verswyvelen: > I just converted an old HOpenGL application of mine to the new Haskell > OpenGL using GHC 6.12.1, using realToFrac to convert Double to > GLdouble. > > The performance dropped from over 800 frames per second to 10 frames > per second.

Re: [Haskell-cafe] Profiling help (Warning: Euler spoilers)

2010-03-04 Thread Daniel Fischer
Am Donnerstag 04 März 2010 16:07:51 schrieb Louis Wasserman: > Actually, looking back, I'm not sure mapM is even the right choice. > I think foldM would suffice. All we're doing is finding the association > pair with the minimum key, no? In this case, foldM would do everything > we need to...and S

Re: [Haskell-cafe] New OpenGL package: efficient way to convert datatypes?

2010-03-04 Thread Daniel Fischer
Am Donnerstag 04 März 2010 16:45:03 schrieb Nick Bowler: > On 16:20 Thu 04 Mar , Daniel Fischer wrote: > > Yes, without rules, realToFrac = fromRational . toRational. > > > > > I think one would have to add {-# RULES #-} pragmas to > > Graphics.Rendering.OpenGL.R

Re: [Haskell-cafe] New OpenGL package: efficient way to convert datatypes?

2010-03-04 Thread Daniel Fischer
Am Donnerstag 04 März 2010 19:25:43 schrieb Nick Bowler: > I agree that the conversions described by the rules are precisely what > one really wants. However, this doesn't make them valid rules for > realToFrac, because they do not do the same thing as realToFrac does. > They break referential tra

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 co

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? > > >

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

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 fold

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 prog

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 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 packa

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 in

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&q

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 '?' fro

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

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 sam

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

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 > ex

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, thoug

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 > o

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 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 results somewhat

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: > > But it uses only on core: > > > We see that our one spark is pruned. Why? > Well, the problem is that your tasks don't do any rea

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] > > > > [(1,1),(

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

2010-03-18 Thread Daniel Fischer
the pointfree combinator version mcombs are equally fast and significantly faster than combination. In fact they're as fast as a simple 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 di

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 dat

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 it

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 un

Re: [Haskell-cafe] Parsec monad transformer with IO?

2010-03-18 Thread Daniel Fischer
Am Donnerstag 18 März 2010 22:34:48 schrieb Andrew Coppin: > Job Vranish wrote: > > Hoogle is a great tool for finding haskell functions: > > > > http://www.haskell.org/hoogle/ > > > > You can punch in the type of a function you want and it will give you > > a list of functions that might do what y

[Haskell-cafe] Re: Parallel Pi

2010-03-18 Thread Daniel Fischer
Am Donnerstag 18 März 2010 22:44:55 schrieb Simon Marlow: > On 17/03/10 21:30, Daniel Fischer wrote: > > 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, us

  1   2   3   4   5   6   7   8   9   10   >