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

2010-03-10 Thread Ketil Malde
Stephen Tetley stephen.tet...@gmail.com writes: oddSquareSum :: Integer oddSquareSum = sum . takeWhile (1) . filter odd . map (^2) $ [1..] Why filter out the evens after generating them? In other words: sum . takeWhile (1) . filter odd . map (^2) $ [1..] Since odd (x^2) = odd x:

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

2010-03-12 Thread Ketil Malde
Casey Hawthorne cas...@istar.ca writes: For example, I have this: list1 = [a, b, c] list2 = [d, e, f] list3 = [g, h, i] Think in abstract terms what you want to accomplish. A bit more specifically, let's say the input is a list of lists, and you want to produce all combinations of drawing

Re: [Haskell-cafe] Re: If wishes were horses...

2010-03-12 Thread Ketil Malde
Johannes Waldmann waldm...@imn.htwk-leipzig.de writes: Well, meaningful identifier names is nice, but I think here we have a case of the code smell type info embedded in the name. Strictness of a function should be expressed in the function's type instead. I've stumbled into this sentiment

Re: [Haskell-cafe] Space leak

2010-03-15 Thread Ketil Malde
Arnoldo Muller arnoldomul...@gmail.com writes: 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. Funny you should mention it. I've written a

Re: [Haskell-cafe] Re: Parallel Pi

2010-03-19 Thread Ketil Malde
Daniel Fischer daniel.is.fisc...@web.de writes: 3.06GHz Pentium 4, 2 cores. [I.e. a single-core hyperthreaded CPU] I have mixed results with parallelism, some programmes get a speed-up of nearly a factor 2 (wall-clock time), others 1.4, 1.5 or so, yet others take about the same wall-clock

[Haskell-cafe] openFile and portability

2010-03-23 Thread Ketil Malde
Hi, For convenience, I often build binaries with -optl-static, and distribute them. Except for the slightly annoying necessity of adding -optl-pthread as well, this works great. Now I just upgraded my Ubuntu box from 9.10 (Karmic) to 10.4 (Lucid), and suddently static binaries refuse to work

[Haskell-cafe] Mail threading

2010-03-24 Thread Ketil Malde
sorry. My mistake :-). I wanted to send to haskell-cafe, so I just pick up a mail thread and send reply. But I forgot to change the title. Don't do that! Your email contains headers like the following: In-Reply-To: ccd8be491003232152u60ed0396wc01eecd00c296...@mail.gmail.com References:

Re: [Haskell-cafe] Testing for valid data

2010-03-27 Thread Ketil Malde
michael rice nowg...@yahoo.com writes: When I'm learning a new language I like to translate old programs into the new language as a test of my understanding. However, many of the old programs are from old programming texts, many written in the time of punch-cards for batch processing, and

Re: [Haskell-cafe] Haskell-friendly Linux Distribution

2010-03-28 Thread Ketil Malde
Chris Dornan ch...@chrisdornan.com writes: I am choosing a Linux distribution for a production Haskell project and would would normally just go with Debian I think Debian (I use Ubuntu, which inherits its packages) just got a lot better. I upgraded to 10.4 Lucid, and now I have ghc 6.12.1 and

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

2010-03-28 Thread Ketil Malde
Jochem Berndsen joc...@functor.nl writes: Could you point us to any evidence that supports your assumption that there are sexual differences in mathematical abilities? Luce Irigaray? (Amply butcherd by Sokal and Bricmont, or see e.g. http://www.absoluteastronomy.com/topics/Luce_Irigaray)

Re: [Haskell-cafe] Are there any gay haskelleres?

2010-03-28 Thread Ketil Malde
Günther Schmidt gue.schm...@web.de writes: are there any gay haskellers? Look, Günther, I'll give you credit for trying, but you might as well accept the fact that using Haskell isn't going to get you laid. Which is just as well, since this list is for discussing a certain programming

[Haskell-cafe] GSoC and Machine learning

2010-03-30 Thread Ketil Malde
Hi, Once upon a time, I proposed a GSoC project for a machine learning library. I still get some email from prospective students about this, whom I discourage as best I can by saying I don't have the time or interest to pursue it, and that chances aren't so great since you guys tend to prefer

Re: [Haskell-cafe] Where are the haskell elders?

2010-03-30 Thread Ketil Malde
Don Stewart d...@galois.com writes: I notice that posts from the Haskell elders are pretty rare now. Only every now and then we hear from them. I'm not sure who the 'elders' are, but generally grown-ups with a day time job (professorships, say) tend to be busy people, without much time for

Re: [Haskell-cafe] Re: Haskell-friendly Linux Distribution

2010-03-30 Thread Ketil Malde
Jason Dagit: The reason I started telling everyone to avoid GHC in apt was the way it was packaged. [..] If they are lucky they figure out which apt package to install. I think people who are too lazy to bother to find out how their distribution works, should avoid any distribution. %

Re: [Haskell-cafe] Re: Haskell-friendly Linux Distribution

2010-03-30 Thread Ketil Malde
Joachim Breitner nome...@debian.org writes: The profiling data is put in -prof packages, i.e. ghc-prof, libghc6-network-prof etc. Indeed, there is no easy way to tell the package system: Whenever I install a Haskell -dev package, please install the -prof package as well. One option might to

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

2010-04-06 Thread Ketil Malde
Pekka Enberg penb...@cs.helsinki.fi writes: Can you really legally distribute your software under an open source license if you don't use your real name? I think it would be hard to enforce any copyright license without revealing the connection between your pseudonym and real person, but I

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

2010-04-06 Thread Ketil Malde
David House dmho...@gmail.com writes: Let me summarise the main arguments against the restriction: 1. It stops people from contributing [..] 2. Inconsistency [..] 3. Privacy issues [..] 4. It inteferes with people's freedom - who has the right to dictate what name a person (or, for that

Re: [Haskell-cafe] How do I use ByteString?

2010-04-06 Thread Ketil Malde
Mads Lindstrøm mads_lindstr...@yahoo.dk writes: It may seem unfair that I put byte-strings and char-strings in the same bucket, but libraries do use byte-strings to contain characters. For example, Parsec has a [Char] and a bytestring interface. It bears noting that Data.ByteString and

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

2010-04-08 Thread Ketil Malde
Daniel Fischer daniel.is.fisc...@web.de writes: However, I wanted to know what the etc stood for, with taking care of dependencies and uninstalling already mentioned. Upgrading, yes, but what else? Keeping the system consistent with other systems? If I use the system packages, I can have a

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

2010-04-08 Thread Ketil Malde
Ivan Miljenovic ivan.miljeno...@gmail.com writes: Which packages are these? I don't recall seeing any with this kind of maintainer address... http://www.google.no/search?q=site%3Ahackage.haskell.org+maintainer+libraries%40haskell.org -k -- If I haven't seen further, it is by standing in

Re: [Haskell-cafe] Suitable structure to represents lots of similar lists

2010-04-08 Thread Ketil Malde
Dan Piponi dpip...@gmail.com writes: I have a situation where I have a bunch of lists and I'll frequently be making new lists from the old ones by applying map and filter. (While keeping the old ones around, I presume?) One option (or source of inspiration) might be lazy bytestrings, which

Re: [Haskell-cafe] Cabal dependency hell

2010-04-12 Thread Ketil Malde
Duncan Coutts duncan.cou...@googlemail.com writes: Here are a few things which I would like to see implemented that would help all this: * Build reporting in the hackage server The idea here is that cabal sends back anonymous reports to the server to say if a package

Re: [Haskell-cafe] instance Eq (a - b)

2010-04-14 Thread Ketil Malde
Joe Fredette jfred...@gmail.com writes: Consider the set of all rationals with 1 as a numerator, and positive denominator, eg: S = {1/n, n : Nat} this is bounded, enumerable, but infinite. Isn't making this an instance of Enum something of an abuse? How would you use enumFromThenTo

[Haskell-cafe] Re: instance Eq (a - b)

2010-04-14 Thread Ketil Malde
Ashley Yakeley ash...@semantic.org writes: Another practical consideration is that checking a function taking a simple Int parameter for equality would mean 2^65 function evaluations. I think function equality would be too much of a black hole to be worth it. Oh FFS, _don't do that_. I

Re: [Haskell-cafe] Re: instance Eq (a - b)

2010-04-16 Thread Ketil Malde
Ashley Yakeley ash...@semantic.org writes: There's an impedance mismatch between the IEEE notion of equality (under which -0.0 == 0.0), and the Haskell notion of equality (where we'd want x == y to imply f x == f y). Do we also want to modify equality for lazy bytestrings, where equality is

Re: [Haskell-cafe] Benchmarks game updated to ghc 6.12.2

2010-04-29 Thread Ketil Malde
Don Stewart d...@galois.com writes: http://shootout.alioth.debian.org/u64q/haskell.php Observations: Although we're mostly beaten on speed, and about the same on code size, we're using a lot less memory than Java. As for code size, the programs are heavily tuned for speed. Although it is

Re: [Haskell-cafe] Benchmarks game updated to ghc 6.12.2

2010-04-29 Thread Ketil Malde
Ketil Malde ke...@malde.org writes: Is it an idea to go back a few steps to more idiomatic code? I had a whirl at the 'reverse complement' benchmark, where we're in the Java ballpark for performance and memory, but at twice the code size. My simple implmentation is down from seventy to about

Re: [Haskell-cafe] Benchmarks game updated to ghc 6.12.2

2010-04-29 Thread Ketil Malde
Felipe Lessa felipe.le...@gmail.com writes: On Thu, Apr 29, 2010 at 10:54:09AM +0200, Ketil Malde wrote: Anyway - it occurs to me that this can fairly simply be sped up by parallelizing: chunk the input, complement chunks in parallel, and reverse. Any takers? Do you mean, something like

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-03 Thread Ketil Malde
Henning Thielemann lemm...@henning-thielemann.de writes: http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/Control-Exception.html#v%3Athrow I see. This should be forbidden, at all! :-) Why is this worse than or different from 'error'? To me it looks like 'error', only with a

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-03 Thread Ketil Malde
Gregory Collins g...@gregorycollins.net writes: Henning Thielemann lemm...@henning-thielemann.de writes: http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/Control-Exception.html#v%3Athrow I see. This should be forbidden, at all! :-) Why is this worse than or different from

Re: [Haskell-cafe] debugging a hanging program: where to start?

2010-05-13 Thread Ketil Malde
Aran Donohue aran.dono...@gmail.com writes: I have a program that I can reliably cause to hang. It's concurrent using STM, so I think it could be a deadlock or related issue. I also do some IO, so I think it could be blocking in a system call. If it's the latter, 'strace' might help you. Use

Re: [Haskell] Re: [Haskell-cafe] Work on Video Games in Haskell

2010-05-27 Thread Ketil Malde
b...@telenet.be writes: Or maybe this would be a nice research topic: how to generate C code that looks like it’s human written… Nah, that's too easy: just add a sprinkling of buffer overflows, undefined behavior, and off-by one index errors. -k -- If I haven't seen further, it is by

Re: [Haskell-cafe] Google Summer of Code: BlazeHTML RFC

2010-05-27 Thread Ketil Malde
Michael Snoyman mich...@snoyman.com writes: * If you're standardizing on UTF-8, why not support bytestrings? +1 I'm aware that a user could shoot him/herself in the foot by passing in non-UTF8 data, but I would imagine the performance gains would outweigh this. Wrap them in a (new)type?

Re: [Haskell-cafe] Sockets get bound to wrong port on Windows

2010-06-03 Thread Ketil Malde
Antoine Latter aslat...@gmail.com writes:   *Main PortNum   47138 The PortNum constructor should rarely be used directly So, shouldn't the constructor be hidden, and exported from an .Internal module? - it contains the port number in network-order. You should try: Or perhaps even

Re: [Haskell-cafe] Efficient string construction

2010-06-04 Thread Ketil Malde
Daniel Fischer daniel.is.fisc...@web.de writes: So why is there a UTF8 implementation for bytestrings? Does that not duplicate what Text is trying to do? If so, why the duplication? I think Data.ByteString.UTF8 predates Data.Text. One difference is that Data.Text uses UTF-16 internally, not

Re: [Haskell-cafe] alphanum in infix constructors (and possibly functions as well) - why not?

2010-06-04 Thread Ketil Malde
Ozgur Akgun ozgurak...@gmail.com writes: Then people would need to put spaces between those things, right? What a horrible consequence! I like to think that Haskell is a language where aesthetics matter. So, in my opinion this is indeed a horrible consequence. I find mixing of symbols and

Re: [Haskell-cafe] Reporting a problem with binary-0.5

2010-06-04 Thread Ketil Malde
Pete Chown 1...@234.cx writes: This code attempts to create an infinite list of random numbers -- a technique also used by network-dns. It turns out that this code works with binary-0.4.4 but not with binary-0.5.0.2. There was a deliberate change in strictness in 0.5 making binary strict,

Re: [Haskell-cafe] Reporting a problem with binary-0.5

2010-06-07 Thread Ketil Malde
Alexey Khudyakov alexey.sklad...@gmail.com writes: This issue was discussed on the list before. Get monad definition was changed in binary 0.5.0.2. It was made strict and evaluation of result of runGet is forced. This increased performance but broke programs which relies on lazyness to work.

Re: [Haskell-cafe] How to name a mapped function?

2010-06-07 Thread Ketil Malde
Martin Drautzburg martin.drautzb...@web.de writes: If I have a function, say compute whose last parameter is some value ... and I create another function, which applies compute to a list of values, how would I call this function? If I understand you correctly, and it's not simply map .

Re: [Haskell-cafe] Re: Mining Twitter data in Haskell and Clojure

2010-06-15 Thread Ketil Malde
braver delivera...@gmail.com writes: In fact, the tag cafe2, when run on the full dataset, gets stuck at 11 days, with RAM slowly getting into 50 GB One tip might be to limit available heap memory by using +RTS -M2G (or whatever your real memory is). If (as seems likely) the RAM usage leads

Re: [Haskell-cafe] HaskellWiki and Wikipedia

2010-06-16 Thread Ketil Malde
Edward Kmett ekm...@gmail.com writes: I realize that this is addressing the symptom, not the cause I'm not so sure Wikipedia is a good source of information for this. I've tried to read some of their articles on e.g. type systems or generic programming, but they tend to be confused by other

Re: [Haskell-cafe] HaskellWiki and Wikipedia

2010-06-21 Thread Ketil Malde
Roman Beslik ber...@ukr.net writes: I do not agree. They are not confused by other languages, they treat all languages as born equal. Are you saying this is a good thing? creating our separate source of knowledge leads to isolationism and narrow-minded vision. But also to a consistent,

Re: [Haskell-cafe] HaskellWiki and Wikipedia

2010-06-21 Thread Ketil Malde
Roman Beslik ber...@ukr.net writes: I do not agree. They are not confused by other languages, they treat all languages as born equal. Are you saying this is a good thing? Yes. There is more than Haskell. Sure. But when I am programming in Haskell, I am generally most interested in using

Re: [Haskell-cafe] Fwd: signficant improvements to the containers package

2010-06-25 Thread Ketil Malde
Don Stewart d...@galois.com writes: Some people might be quite excited by Milan's work on significant performance improvements to the containers package... Yes, this is great news - both a well written article and an important piece of work on a cornerstone of the Haskell libraries. But I am

Re: [Haskell-cafe] whine and solution about programmers not respecting documentations

2010-06-28 Thread Ketil Malde
Albert Y.C.Lai tre...@vex.net writes: The doc of deleteBy states: The deleteBy function behaves like delete, but takes a user-supplied equality predicate. A precondition is that the user-supplied predicate is an equality predicate. (=) is not an equality predicate, be it in the layperson

Re: [Haskell-cafe] whine and solution about programmers not respecting documentations

2010-06-29 Thread Ketil Malde
Daniel Fischer daniel.is.fisc...@web.de writes: Maybe it is because deleteBy is defined wrongly? i.e. it is not logical, doesn't follow the common sense user might expect. It accepts any predicate but narrows requirements only in docs. Unfortunately, you can't easily encode the requirement

Re: [Haskell-cafe] whine and solution about programmers not respecting documentations

2010-06-29 Thread Ketil Malde
Max Rabkin max.rab...@gmail.com writes: Your deleteBy is (filter . not), isn't it? With the caveat that I haven't actually used it, my impression is that delete only removes one element, while filter removes all of them. -k -- If I haven't seen further, it is by standing in the footprints of

Re: [Haskell-cafe] whine and solution about programmers not respecting documentations

2010-06-29 Thread Ketil Malde
Daniel Fischer daniel.is.fisc...@web.de writes: An important point of a powerful type system is to model your program so that only sensible code is legal. That would be an awesomely powerful type system :) Heh. But while we're waiting for it, we can try to use what we got to eliminate as

Re: [Haskell-cafe] functional dependencies question

2010-07-01 Thread Ketil Malde
Patrick Browne patrick.bro...@dit.ie writes: Why do some cases such as 1) fail to run even if they are the only instantiation. I think this is because literal numbers are polymorphic, i.e. a '1' in your source code is shorthand for 'fromIntegral 1', which is a type of Num a = a. Thus,

Re: [Haskell-cafe] Status of status on freenode

2010-07-03 Thread Ketil Malde
Walt Rorie-Baety black.m...@gmail.com writes: My work environment is what I'd call typical US corporate - IRC nodes are blocked, but I can use a web-based client to access it. I solve these kinds of problems by routing stuff through an SSH connection to an outside server - which isn't blocked,

Re: [Haskell-cafe] Re: Rewriting a famous library and using the same name: pros and cons

2010-07-04 Thread Ketil Malde
Ivan Lazar Miljenovic ivan.miljeno...@gmail.com writes: People still use Hugs? :p Well, I just did a quick count of Haskell libraries in Debian and Ubuntu (as a sort of comment to Don's blog post), but I forgot Hugs. It seems to be installed on 6000 Ubuntu-respondents, compared to 17000

The state of Hugs (was: Re: [Haskell-cafe] Re: Rewriting a famous library and using the same name: pros and cons)

2010-07-06 Thread Ketil Malde
wren ng thornton w...@freegeek.org writes: A bit more seriously: is there any listing anywhere of which extensions Hugs supports? Cabal has a partial listing embedded in its code, though I can't seem to find a textual version at the moment. In general, Hugs has all the features of GHC 6.6:

Re: [Haskell-cafe] Actually loading a Cabal package in GHCi

2010-07-12 Thread Ketil Malde
d...@patriot.net writes: d...@hypno:~/haschorus-1.2.1$ ghci GHCi, version 6.10.4: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. Prelude :m Haskore No error

Re: [Haskell-cafe] [Newbie] What to improve in my code

2010-07-19 Thread Ketil Malde
Daniel Fischer daniel.is.fisc...@web.de writes: First of all: I'm not sure if this question is allowed here. If not, I apologize You might want to check out the haskell-beginners list, but IMO most questions are okay to post here. Just a couple of style issues Daniel didn't mention: process

Re: [Haskell-cafe] A question about State Monad and Monad in general

2010-07-19 Thread Ketil Malde
C K Kashyap ckkash...@gmail.com writes: I looked at State Monad yesterday and this question popped into my mind. From what I gather State Monad essentially allows the use of Haskell's do notation to invisibly pass around a state. So, does the use of Monadic style fetch us more than syntactic

Re: [Haskell-cafe] Hackage survey

2010-07-20 Thread Ketil Malde
Ivan Lazar Miljenovic ivan.miljeno...@gmail.com writes: I'd like to request some clarification of some of the questions: You might want to add a don't know or similar option, so that people don't have to fill in questions arbitrarily in the case they feel none of the answers match. 3. I use

Re: [Haskell-cafe] Design for 2010.2.x series Haskell Platform site

2010-07-20 Thread Ketil Malde
Christopher Done chrisd...@googlemail.com writes: Sadly nobody has the time nor inclination to do proper web development and actually test designs and get feedback, so I suppose we're working with the time we've got. At least with theme support, we can write a load of themes, and then

Re: [Haskell-cafe] Design for 2010.2.x series Haskell Platform site

2010-07-20 Thread Ketil Malde
Don Stewart d...@galois.com writes: (Looking at http://code.haskell.org/haskell-platform/download-website) * The three columns at the bottom overlap! Perhaps this is a valid case for a table rather than three divs and CSS layout. Agreed and implemented. That was easier! Scaling is still a

Re: [Haskell-cafe] Merge hsql and HDBC -- there can only be one!

2010-07-21 Thread Ketil Malde
John Goerzen jgoer...@complete.org writes: I need to read the LGPL and analyze it closer, but my first analysis suggests that this would work fine for me and others. I'm using the LGPL for library code, and GPL for applications. Although a lot of noise is generated from the linking issues,

Re: [Haskell-cafe] Merge hsql and HDBC -- there can only be one!

2010-07-21 Thread Ketil Malde
Vo Minh Thu not...@gmail.com writes: For a LGPL library, why do you make the distinction between open source and proprietary applications? They can all link to a LGPL library. The problem with the LGPL is that in order to distribute a program using an LGPL library, the recipient must be

[Haskell-cafe] Experiences with cabal-install and Hackage

2010-07-22 Thread Ketil Malde
I've rather recently started to use cabal-install to install packages from Hackage. Unfortunately, so far many packages fail to install. I try to email authors/maintainers, but when I check build logs on Hackage, I discover that some of these packages have failed building for some time.

Re: [Haskell-cafe] Page rank and GHC docs directory organization

2010-07-23 Thread Ketil Malde
Robin KAY komad...@gekkou.co.uk writes: the redirects and ignore the original URLs [2]. Using a 302 Found redirect instead might produce better results, at least for Google But the page you point to suggests 302 is discouraged, and says they don't help for the other search engines. Perhaps

Re: [Haskell-cafe] Haskell Forum

2010-07-27 Thread Ketil Malde
Brandon S Allbery KF8NH allb...@ece.cmu.edu writes: Usenet *is* NNTP. In the same way the web is HTTP... (Usenet is a set of global, distributed forums using a message format similar enough to email (RFC822 + extensions) that many mail reader software supports news, and vice versa. NNTP is

Re: [Haskell-cafe] Chart package segfaults when rendering to window

2010-08-01 Thread Ketil Malde
bri...@aracnet.com writes: Seems to be ok rendering to png files. I'm using timeplot, which is based on Chart, to plot temperatures from my server in the attic (http://malde.org/~ketil/temp.png if you're curious :-). This runs from crontab, and I notice that I occasionally get mails saying

[Haskell-cafe] Cabal and linking with static libs (.a files)

2006-06-09 Thread Ketil Malde
(Reposted to café - my -libraries mail seems to have gotten lost along the way) Hi, I'm building an interface to a C library, which comes in the form of two .a files. I can't seem to get Cabal to link statically with these, so that the resulting package (libHSfoo-v.v.a) is self contained.

[Haskell-cafe] Re: Cabal and linking with static libs (.a files)

2006-06-12 Thread Ketil Malde
Simon Marlow [EMAIL PROTECTED] writes: What you actually want to do, I suspect, is to include verbatim copies of the .a dependencies in your (binary) Cabal package, to make it self-contained. Exactly. But it's quite easy: just copy the .a files from /usr/lib (or wherever) and put them in

Re: [Haskell-cafe] Re: Cabal and linking with static libs (.a files)

2006-06-12 Thread Ketil Malde
Ketil Malde [EMAIL PROTECTED] writes: But it's quite easy: just copy the .a files from /usr/lib (or wherever) and put them in the same place as your libHSpackage.a. I managed to get it to work by following that advice, and also renaming foo.a to libfoo.a, and linking with -lfoo. Now you see

Re: [Haskell-cafe] Closure trace?

2006-06-14 Thread Ketil Malde
Bulat Ziganshin [EMAIL PROTECTED] writes: I'm not belittling the underlying problem, which is real. But there do seem to be many possible design choices without an obvious optimium. If someone can boil out a principled and simple solution, it'd be a good contribution. You can also use CPP

Re: [Haskell-cafe] Functional progr., images, laziness and all therest

2006-06-23 Thread Ketil Malde
Brian Hulley [EMAIL PROTECTED] writes: But how does this change the fact that y still has 1 more element than yq? yq is after all, not a circular list. infinity+1 = infinity Surely this is just a mathematical convention, not reality! :-) Not even that. Infinity isn't a number, and it

[Haskell-cafe] Re: Cabal and linking with static libs (.a files)

2006-06-27 Thread Ketil Malde
Simon Marlow [EMAIL PROTECTED] writes: No idea, I'm afraid. ghc -v might help you. Try cut-and-pasting the linker command line and play around with ordering of -l options. I noticed the linker is incredibly picky about the sequence of options. Anyway, I suspected that, but I couldn't seem

[Haskell-cafe] Re: Packages and modules

2006-07-05 Thread Ketil Malde
Brian Hulley [EMAIL PROTECTED] writes: because if the suggested syntax is used, import directives come in two flavours: ones that use from to import from a different package and ones that don't use from and therefore must refer to the current package. What is the current package? My

[Haskell-cafe] Re: Packages and modules

2006-07-07 Thread Ketil Malde
Simon Peyton-Jones [EMAIL PROTECTED] writes: Brian Hulley wrote: | import A.B.C( T1 ) from foo | import A.B.C( T2 ) from bar | type S = A.B.C.T1 - A.B.C.T2 | I'd suggest that the above should give a compiler error that A.B.C is | ambiguous (as a qualifier), rather than allowing T1

Re: [Haskell-cafe] Re: Why Haskell?

2006-08-14 Thread Ketil Malde
Bulat Ziganshin [EMAIL PROTECTED] writes: The problem I'm having with SQL right now is that there are a number of not complete and splintered implementation efforts. Having one library outside GHCs libraries but still promoted as the default implementation (and hosted under haskell.org) would

Re: [Haskell-cafe] Re: how do you debug programs?

2006-09-06 Thread Ketil Malde
Tamas K Papp [EMAIL PROTECTED] writes: Most of the mistakes I make are related to indentation, I use Emacs, which has a reasonably decent mode for this. Hit TAB repeatedly to show the possible indentations. precedence (need to remember that function application binds tightly). It's not

Re: [Haskell-cafe] Slow IO

2006-09-13 Thread Ketil Malde
Daniel Fischer [EMAIL PROTECTED] writes: Maybe I've misused the word segfault. I think so. A segfault is the operating-system complaining about an illegal memory access. If you get them from Haskell, it is likely a bug in the compiler or run-time system (or you were using unsafeAt, or FFI).

Re: [Haskell-cafe] Problems interpreting

2006-09-18 Thread Ketil Malde
Carajillu [EMAIL PROTECTED] writes: I get line 18:parse error (possibly incorrect indentation) ..which is a bit misleading, as the problem is on the preceeding line of code. if x == e then return l2 And if x /= e? What is check_elem then?¹ -- Tries to match two lists. If

Re: [Haskell-cafe] Java or C to Haskell

2006-09-20 Thread Ketil Malde
Andrea Rossato [EMAIL PROTECTED] writes: I forgot, obviously, that lists are an instance of the Eq class... so, this is enough: comp l1 l2 = if l1 == l2 then True else False Or why not: comp l1 l2 = l1 == l2 Or simply: comp = (==) :-) -k -- If I haven't seen further, it is by

Re: [Haskell-cafe] Unable to profile program using Data.ByteString.Lazy

2006-09-27 Thread Ketil Malde
Jason Dagit [EMAIL PROTECTED] writes: Ubuntu seems to be a bit behind then. The current official release of the 6.4 branch is at 6.4.2. Debian seems to provide this version, maybe you can use the debian package? But, if I were you I wouldn't worry so much about upgrading ghc but instead

Re: [Haskell-cafe] Unable to profile program using Data.ByteString.Lazy

2006-09-27 Thread Ketil Malde
Ketil Malde [EMAIL PROTECTED] writes: I filed a request to backport [ghc 6.4.2 to Ubuntu Dapper], but for some reason, I am unable to find it again. Hah! Found it (with some IRC assistance): https://launchpad.net/distros/ubuntu/+source/ghc6/+bug/56516 -k -- If I haven't seen further

Re: [Haskell-cafe] Optimizing a title matcher

2006-09-27 Thread Ketil Malde
Lyle Kopnicky [EMAIL PROTECTED] writes: If you have some other metric other than prefix in mind for partial matches, then things probably get a lot more complicated. You're probably looking at calculating minimum distances in some feature-space, which calls for pretty sophisticated

Re: [Haskell-cafe] [off-topic / administrative] List Reply-to

2006-10-11 Thread Ketil Malde
Mikael Johansson [EMAIL PROTECTED] writes: * It violates the principle of least damage, and it encourages a failure mode that can be extremely embarrassing -- or worse. I'd be surprised if private mail leakage happens that much to Haskell-cafe, or for that matter if it'd be embarrassing to

Re: [Haskell-cafe] [off-topic / administrative] List Reply-to

2006-10-12 Thread Ketil Malde
Udo Stenzel [EMAIL PROTECTED] writes: However, I don't recall problems with multiple copies of emails. I did get your mail twice, which I don't consider a huge problem. And for people who do, perhaps they can set up procmail to deal with this? E.g.,

Re: [Haskell-cafe] function result caching

2006-10-13 Thread Ketil Malde
Silviu Gheorghe [EMAIL PROTECTED] writes: slowFunctionCacheList= [slowFunction (i) | i -[0..500]] and use slowFunctionCacheList !! i instead of slowFunction (i) i am still curious about a better method (and a general one) Not much different in principle, but better in practice - you

Re: [Haskell-cafe] function result caching

2006-10-14 Thread Ketil Malde
Robert Dockins [EMAIL PROTECTED] writes: slowFunctionCacheList= [slowFunction (i) | i -[0..500]] and use slowFunctionCacheList !! i instead of slowFunction (i) Not much different in principle, but better in practice - you could use an array rather than a list. O(1) lookups should make

Re: [Haskell-cafe] Debugging Newton's method for square roots

2006-10-16 Thread Ketil Malde
Clifford Beshers [EMAIL PROTECTED] writes: There was some excellent advice in the other responses, but I thought it worth mentioning that your Haskell code converges if you step up from Float - Float to Double - Double. Used to be faster, too, IIRC. Is that still the case? -k -- If I

Re: [Haskell-cafe] Newbie and working with IO Int and Int

2006-10-18 Thread Ketil Malde
Daniel Fischer [EMAIL PROTECTED] writes: ghci-6.6 [prints the result of IO actions] by default I consider printing the value when it is used in an assignment a bug. It makes it more difficult to test laziness issues or behavior on e.g. large files. Anybody know why it was changed to the

Re: [Haskell-cafe] More documentation: how to create a Haskell project

2006-10-30 Thread Ketil Malde
[EMAIL PROTECTED] (Donald Bruce Stewart) writes: But we could do with more information on: [...] How to make cabal projects into distribution-specific (.deb, .rpm, and so on) packages? -k -- If I haven't seen further, it is by standing in the footprints of giants

Re: [Haskell-cafe] Re: Debugging partial functions by the rules

2006-11-15 Thread Ketil Malde
Lennart Augustsson [EMAIL PROTECTED] writes: Should Haskell also provide unrestricted side effects, setjmp/ longjmp, missile launching functions, etc? After all, people who don't want to use them can just avoid them. :) Yes. It is indeed a common problem that programs have unintended

Re: [Haskell-cafe] Re: Generate 50 random coordinates

2006-12-04 Thread Ketil Malde
Henning Thielemann wrote: On Sat, 2 Dec 2006 [EMAIL PROTECTED] wrote: -- The IO -- Who rides so late through the bits and the bytes? It's Haskell with his child Hank; He has the boy type safe in his arm, He holds him pure, he holds him warm. I vote for an art/lyrics section on

Re: [Haskell-cafe] Writing Haskell For Dummies Or At Least For People Who Feel Like Dummies When They See The Word 'Monad'

2006-12-12 Thread Ketil Malde
Paul Hudak wrote: Maybe some of you can do better, but it's really tough to show someone how an /advanced/ Haskell programmer would solve /advanced /problems that arise in the real world. As a simple example, I love this recent quote by Garrett Morris: I'm personally fond of framing most

[Haskell-cafe] Re: a cabal/database lib experience

2006-12-12 Thread Ketil Malde
Simon Marlow wrote: + add a dedicated command cabal, which does nothing more than runhaskell Setup, but is more memorable and suggestive cabal-setup does this, but wasn't included with the latest release of Cabal. It should be in the next one, I hope. The plan is to deprecate

Re: [Haskell-cafe] for loops and 2d arrays in haskell

2007-01-19 Thread Ketil Malde
Fernan Bolando wrote: what is the simplest way to implement the following code in haskell? it's just printing the contents of 2D array. for(i = 0; i imax; i++){ for(n = 0; n nmax; n++){ printf(%i:%i = %f\n, array[i][n]); } } *%* ghci ___ ___ _ * / _ \ /\ /\/ __(_)

Re: [Haskell-cafe] basic field questions

2007-01-24 Thread Ketil Malde
jamin1001 wrote: What if I want to do something like data Chair = Chair {pos:: Int, color :: Int} data Table = Table {pos:: Int, color :: Int} data Properties = Props { pos, color :: Int } data Chair = Chair Props data Table = Table Props or: data Chair = Chair Int Int data Table =

Re: [Haskell-cafe] Re: Channel9 Interview: Software Composability and theFu ture of Languages

2007-01-31 Thread Ketil Malde
Kirsten Chevalier wrote: On 1/31/07, Bill Wood [EMAIL PROTECTED] wrote: On Wed, 2007-01-31 at 19:51 +1100, Donald Bruce Stewart wrote: . . . foldl (\water dish - wash water dish) soapywater dishes :: [Dishes] Nice example. First, note that you can't get close with map -- you need

Re: [Haskell-cafe] Newbie: generating a truth table

2007-02-06 Thread Ketil Malde
[EMAIL PROTECTED] wrote: I would like to create a Haskell function that generates a truth table, for all Boolean values, say, using the following and function : and :: Bool - Bool - Bool and a b = a b What is the type of the resulting table? I have tried creating a second function called

Re: [Haskell-cafe] Newbie: generating a truth table

2007-02-06 Thread Ketil Malde
[EMAIL PROTECTED] wrote: Ketil, thanks for you help. Here's the code: and2 :: Bool - Bool - Bool and2 a b = a b loop = [ and2 x y | x - [True,False], y - [True,False] ] Now, how do I have Haskell print printStrLn(True and True = ) + result of calling and2 True True printStrLn(True and

Re: [Haskell-cafe] Re: Generalizing three programs

2007-02-06 Thread Ketil Malde
Bjorn Lisper wrote: Erlang actually stands for Ericsson Language. I think the alternative interpretation is intentional, though. According to this: http://www.erlang.org/pipermail/erlang-questions/1999-February/98.html A.K.E. was the actual origin, but with an intentional ambiguity.

Re: [Haskell-cafe] ANNOUNCE: nobench: Haskell implementaion benchmarks. GHC v Hugs v Yhc v NHC v ...

2007-02-19 Thread Ketil Malde
Donald Bruce Stewart wrote: Following recent discussion about a cross-implementation performance benchmark suite, based on nofib, I've gone and combined nofib with the great language shootout programs, and rewritten the build system to support cross implementation measurements. Great work!

Re: [Haskell-cafe] Re: STM in F#

2008-01-18 Thread Ketil Malde
apfelmus [EMAIL PROTECTED] writes: I imagine this can only ease the process of learning Haskell, and broaden the base of possible Haskellers, as more people on using .NET stuff become familiar with modern typed FP. There's a reason the STM monad hatched in Haskell: how does the above STM in

Re: [Haskell-cafe] Has character changed in GHC 6.8?

2008-01-23 Thread Ketil Malde
Peter Verswyvelen [EMAIL PROTECTED] writes: Prelude Data.Char map ord ö [195,182] Prelude Data.Char length ö 2 there are actually 2 bytes there, but your terminal is showing them as one character. So let's all switch to unicode ASAP and leave that horrible multi-byte-string-thing behind

<    1   2   3   4   5   6   7   8   9   10   >