Re: [Haskell-cafe] Histogram creation

2008-11-11 Thread Ketil Malde
Duncan Coutts [EMAIL PROTECTED] writes: Perhaps I misunderstood but I think Alexey means that he wants to accumulate several different histograms (ie different arrays) but to only make one pass over the input data. This is precicely my problem, too. The form of accumArray does not make

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-11-05 Thread Ketil Malde
Old threads never die: Tim Newsham [EMAIL PROTECTED] writes: Chunk = { length :: Word8 elems :: [Elem] -- 0..255 repetitions } Chunks = [Chunk] -- terminated with the first 0 length Chunk I tried my hand at the encoding above:

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-11-05 Thread Ketil Malde
Ketil Malde [EMAIL PROTECTED] writes: Doing 'x - decodeFile /dev/zero Well, it turns out 'decodeFile' needs to -- or does, anyway -- check whether the file is empty. Replacing it with a combination of 'decode' and 'readFile' solved the problem. Thanks to Saizan and the other people hanging

Re: [Haskell-cafe] Problems with strictness analysis?

2008-11-04 Thread Ketil Malde
Patai Gergely [EMAIL PROTECTED] writes: My only problem is that if I try to write a program without thinking about performance first and not bothering with annotations as long as it works, I end up with something that's practically impossible to profile as the costs spread everywhere. I

Re: [Haskell-cafe] Array bug?

2008-11-03 Thread Ketil Malde
Henning Thielemann [EMAIL PROTECTED] writes: I think it is a good idea to switch this feature on and off by a compiler switch. I agree. Same with Int overflow checking, if it can be done at all. The interesting question is how to name it, the obvious -funsafe-optimization might imply

Re: [Haskell-cafe] Re: Array bug?

2008-11-03 Thread Ketil Malde
Achim Schneider [EMAIL PROTECTED] writes: -funsafe-optimization -fno-paranoia -fno-rd ? (Okay, I'll stop now :-) -k -- If I haven't seen further, it is by standing in the footprints of giants ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Automatic parallelism in Haskell, similar to make -j4?

2008-11-02 Thread Ketil Malde
Bulat Ziganshin [EMAIL PROTECTED] writes: Hello T, Monday, November 3, 2008, 2:28:08 AM, you wrote: What would it take to implement a -j equivalent for, say, GHC? Or if this is not possible, what is wrong with my reasoning? problem is that make have rather large pices of work which it

Re: [Haskell-cafe] Why 'round' does not just round numbers ?

2008-10-27 Thread Ketil Malde
Janis Voigtlaender [EMAIL PROTECTED] writes: If you round to odd instead of round to even, then 4.5 rounds to 5, Well, of course I did not learn to round to odd. I learned to round .5 to above, but not to do repeated rounding. Since just about every floating point operation involves some

Re: [Haskell-cafe] Why 'round' does not just round numbers ?

2008-10-27 Thread Ketil Malde
Janis Voigtlaender [EMAIL PROTECTED] writes: Since just about every floating point operation involves some sort of loss of precision, repeated rounding is a fact of life. Of course. But that was not the point of the discussion... Well, allow me to contribute to keeping the discussion on

Re: [Haskell] Current XML libraries status

2008-10-24 Thread Ketil Malde
Krasimir Angelov [EMAIL PROTECTED] writes: Does some one have made performance tests on the different XML libraries for Haskell? I have a 20MB xml file that I want to read. I remember from my earlier experiments (years ago) that all libraries were too slow and were consuming too much

Re: [Haskell] Re: Probably a trivial thing for people knowing Haskell

2008-10-21 Thread Ketil Malde
Friedrich [EMAIL PROTECTED] writes: Even the ruby solution need just check_downloads/check_downloads.rb . 1,25s user 0,06s system 99% cpu 1,322 total [...] but the haskell solution: ./chk_dwlds 17,71s user 0,11s system 99% cpu 17,836 total I'm very surprised to see this. Did you

Re: [Haskell-cafe] Installing ghc + gtk2hs on linux

2008-10-21 Thread Ketil Malde
Bulat Ziganshin [EMAIL PROTECTED] writes: what's the simplest way to install ghc + gtk2hs on Ubuntu x86 system? Untested, but try: sudo apt-get install libghc6-gtk-dev -k -- If I haven't seen further, it is by standing in the footprints of giants

Re: [Haskell-cafe] maybe a goal and challenge for the Haskell in terms of scientific computing

2008-10-04 Thread Ketil Malde
FWIW, I always thought that Haskell, and in particular, ghci, would be a great environment for statistics. I've used R a bit, and while it has a functional flavor to it, I find Haskell much nicer for programming. We just need a nice data frame type: a sliceable, labelable¹ multi-dimensional

Re: [Haskell-cafe] Re: Health effects

2008-10-02 Thread Ketil Malde
Adrian Neumann [EMAIL PROTECTED] writes: Does this work with more than two colours? i.e. can I recursively subdivide the halves into quarters with another cut? I don't think so. In order to divide a group, a line needs to pass through somewhere in the middle, or more precisely, it must

Re: [Haskell-cafe] One liner?

2008-10-02 Thread Ketil Malde
Paul Keir [EMAIL PROTECTED] writes: module Main where import System.Directory (getDirectoryContents) main = do dc - getDirectoryContents ./foo/ mapM_ putStrLn dc mapM_ putStrLn (getDirectoryContents ./foo/) Couldn't match expected type `[String]' mapM_ putStrLn needs a

Re: [Haskell-cafe] csv one-liner

2008-10-01 Thread Ketil Malde
Derek Elkins [EMAIL PROTECTED] writes: parseCSVFromFile in.csv = return . either (const error!) Whenever you see this = return . f pattern think liftM or fmap or $. ...and return . f = action is just action . f, no? -k -- If I haven't seen further, it is by standing in the footprints of

Re: [Haskell-cafe] Hmm, what license to use?

2008-09-30 Thread Ketil Malde
Don Stewart [EMAIL PROTECTED] writes: So if you use LGPL for your Haskell libraries, all of which are currently statically linked and non-replaceable at runtime, it is unlikely any commercial Haskell house can use the code. As already mentioned, you can ask the author nicely for a different

Re: [Haskell-cafe] System.Process

2008-09-30 Thread Ketil Malde
Svein Ove Aas [EMAIL PROTECTED] writes: All programs want argument arrays, not un-split lines, and if you don't have the shell split it you'll have to do it yourself. words works fine. ...as long as the words don't contain quotes, or wildcard/globbing characters, or $, ! and probably other

Re: [Haskell-cafe] Hmm, what license to use?

2008-09-30 Thread Ketil Malde
Jeremy O'Donoghue [EMAIL PROTECTED] writes: Therefore, I have to say that for at least some commercial users, LGPL will never be acceptable, and GPL is actually more acceptable because we know for sure what obligations it places on us. I don't see how this can be, since according to clause 2b

Re: [Haskell-cafe] System.Process

2008-09-30 Thread Ketil Malde
David Roundy [EMAIL PROTECTED] writes: Actually, it's no problem having any of those characters in your arguments, My point is that using 'words' on the argument sting to 'runProcess' and expecting the same result as 'runCommand' implies making those assumptions:: Prelude System.Process let

Re: [Haskell-cafe] Hmm, what license to use?

2008-09-29 Thread Ketil Malde
Bit Connor [EMAIL PROTECTED] writes: I believe that it's wrong to use a license to try to enforce such cooperation. Look what happened with KHTML when Apple started using it for their Safari web browser. I haven't followed this in detail, but I think that, even when a company is reluctant to

Re: [Haskell-cafe] Climbing up the shootout...

2008-09-25 Thread Ketil Malde
John Van Enk [EMAIL PROTECTED] writes: I'm going to have to agree with David... even if you ignore the multi-threaded projects, why couldn't the C programs just implement very specific version of the third party library inside their code? Or they could just FFI to the Haskell libraries :-)

Re: [Haskell-cafe] Line noise

2008-09-22 Thread Ketil Malde
Andrew Coppin [EMAIL PROTECTED] writes: Idiomatic Haskell seems to consist *only* of single-letter variable names. Good thing, too. Well, qsort (element : list) would be maximally intuitive, but who's going to implement it like that? ;-) Why not listElement : restOfList ? The rationale

Re: [Haskell-cafe] A round of golf

2008-09-19 Thread Ketil Malde
Don Stewart [EMAIL PROTECTED] writes: If I want to make my own efficient bytestring consumer, is that what I need to use in order to preserve the inherent laziness of the datastructure? you can get foldChunks from Data.ByteString.Lazy.Internal, or write your own chunk folder. IME you can

Re: [Haskell-cafe] A round of golf

2008-09-19 Thread Ketil Malde
Creighton Hogg [EMAIL PROTECTED] writes: To ask an overly general question, if lazy bytestring makes a nice provider for incremental processing are there reasons to _not_ reach for that as my default when processing large files? I think it is a nice default. I'd reach for strict

Re: [Haskell-cafe] Lazy vs correct IO

2008-09-19 Thread Ketil Malde
[EMAIL PROTECTED] writes: It is interesting to compare the above main function with the corresponding lazy IO: Minor point I know, but aren't you really comparing it with the corresponding *strict* IO? main'' = do names - getArgs files - mapM readFile names

Re: [Haskell-cafe] XML (HXML) parsing :: GHC 6.8.3 space leak from 2000

2008-09-18 Thread Ketil Malde
Lev Walkin [EMAIL PROTECTED] writes: Recently I had to process some multi-megabyte XML files. Join the club! FWIW, I ended up using tagsoup. -- %%% There is apparently a space leak here, but I can't find it. -- %%% Update 28 Feb 2000: There is a leak, but it's fixed -- %%% by a well-known

Re: [Haskell-cafe] message passing style in Monad

2008-09-14 Thread Ketil Malde
Simon Richard Clarkstone [EMAIL PROTECTED] writes: I can also do readFile readme.markdown . lines . length by making (.) = flip fmap ? -k -- If I haven't seen further, it is by standing in the footprints of giants ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Hackage policy question

2008-09-10 Thread Ketil Malde
Duncan Coutts [EMAIL PROTECTED] writes: So we should think about how to make it less confusing. Perhaps like distributors use an extra revision number we should do the same. I had hoped that would not be necessary but that's probably not realistic. If we go this route, it'd be nice to have a

Re: [Haskell-cafe] packages and QuickCheck

2008-09-09 Thread Ketil Malde
Conal Elliott [EMAIL PROTECTED] writes: Thanks a bunch for these tips. I haven't used the flags feature of cabal before, and i don't seem to be able to get it right. Another option might be to have the test command build via 'ghc --make' instead of Cabal - this way, you can avoid mentioning

Re: [Haskell-cafe] Re: Haskell stacktrace

2008-09-09 Thread Ketil Malde
Justin Bailey [EMAIL PROTECTED] writes: are using tail (or could be calling something that uses tail) and use the trace function to output logging info. Another cheap trick is to use CPP with something like: #define head (\xs - case xs of { (x:_) - x ; _ - error(head failed at

Re: [haskell-cafe] Monad and kinds

2008-09-05 Thread Ketil Malde
Jules Bean [EMAIL PROTECTED] writes: On Sep 4, 2008, at 10:19 AM, Tim Chevalier wrote: The master programmer does not add strictness annotations, for she has not yet run the profiler. The compiler will certainly be able to infer the strictness itself As far as I am aware this statement is

Re: [Haskell-cafe] Named field syntax

2008-08-29 Thread Ketil Malde
Maurí­cio [EMAIL PROTECTED] writes: However, this doesn't work: data Test = Test Integer {b::String} Is there some way to name only a single, or a few, of some data type fields? data Test = Test Integer String b :: Test - String b (Test i s) = s :-) -k -- If I haven't seen further, it

Re: [Haskell-cafe] Is there GHC 6.8.3 on Ubuntu?

2008-08-28 Thread Ketil Malde
Rafael Gustavo da Cunha Pereira Pinto [EMAIL PROTECTED] writes: Is there anyone packing GHC 6.8.3 for Ubuntu Hardy? The next Ubuntu release (8.10 Intrepid), seems to come with 6.8.2 as well. If you want to pack 6.8.3, go for it! If you just wanted to use it, I've had success using the

Re: [Haskell-cafe] Haskell Propeganda

2008-08-28 Thread Ketil Malde
Aaron Tomb [EMAIL PROTECTED] writes: Huh? Type safety buys [...] nothing about dereferencing null pointers, which are the moral equivalent of Nothing. What type safety buys you, in my mind, is that Nothing is only a valid value for explicit Maybe types. In cases where you don't use Maybe,

Re: [Haskell-cafe] Parsec and network data

2008-08-27 Thread Ketil Malde
Jeremy Shaw [EMAIL PROTECTED] writes: I probably shouldn't post when I don't quite understand the question, and I'm unsure whether this is about timeouts, lazy parsing of responses, or line endings? These seem like independent issues to me. Anyway: Polyparse has some lazy parsers: but Tomasz

Re: [Haskell-cafe] Cleaning up the Debian act (report from the trenches)

2008-08-27 Thread Ketil Malde
Jason Dagit [EMAIL PROTECTED] writes: 2) Compile GHC yourself. I find with Debian this is the way to go. Ouch. Okay, I've compiled GHC once. But I would like end-users to be able to use my software, and I simply cannot require them to go through this. Install your system and use Debian's

Re: [Haskell-cafe] Cleaning up the Debian act (report from the trenches)

2008-08-27 Thread Ketil Malde
David House [EMAIL PROTECTED] writes: 1. Etch comes with ghc-6.6, and that didn't work with my .cabal file. Is it not an option to make your software work with the not-quite-latest compiler? Yes it is, although I don't have the details either. Neither do I have an Etch system around, but

[Haskell-cafe] Cleaning up the Debian act (report from the trenches)

2008-08-25 Thread Ketil Malde
I've had an interested user, who tried to get one of my programs to run on a Debian machine - running Debian Etch, released a couple of months ago. Here are some of the hurdles stumbled upon in the process: 1. Etch comes with ghc-6.6, and that didn't work with my .cabal file. 2. ghc-6.8.3,

Re: [Haskell-cafe] PRE-ANNOUNCE: cabal-debian (automatically debianize cabal packages)

2008-08-22 Thread Ketil Malde
Christopher Lane Hinson [EMAIL PROTECTED] writes: Having a debianized cabal-install would be the biggest win in my book. If there were an unofficial debianized mirror of hackage, I probably wouldn't use it anyway. I might. I generally want to use newer versions of development stuff (i.e.

Re: [Haskell-cafe] ANN: wavconvert 0.1.1

2008-08-19 Thread Ketil Malde
Duncan Coutts [EMAIL PROTECTED] writes: The other distros are following a similar course though not yet quite as successfully as Don has demonstrated for Arch. There are similar translation tools for Gentoo, Debian and RPM-based distros What is the current recommended way to build debian

Re: [Haskell-cafe] whatever happened to sendFile?

2008-08-14 Thread Ketil Malde
Brandon S. Allbery KF8NH [EMAIL PROTECTED] writes: On 2008 Aug 13, at 18:25, Jason Dusek wrote: Can you say more about this? I assume that sending static images back and forth is a good fit for sendfile(). Your previously stated use case sounds like a good fit. I can easily imagine

Re: [Haskell-cafe] Re: Is www.haskell.org down?

2008-08-14 Thread Ketil Malde
Don Stewart [EMAIL PROTECTED] writes: By the way, for those wondering why Jon Harrop would say such an unusual thing on the Haskell list, have a look at his contributions over on the OCaml list, http://article.gmane.org/gmane.comp.lang.caml.general/43430 Well, to be perfectly honest: |

Re: [Haskell-cafe] Cabal has trouble with projects that have both src and lib directories?

2008-08-14 Thread Ketil Malde
Nicholas Andrews [EMAIL PROTECTED] writes: $ runhaskell blah.cabal configure blah.cabal isn't a Haskell file, you need a file Setup.hs that you can 'runhaskell'. Setup.hs need only contain the following three lines: #!/usr/bin/env runhaskell import Distribution.Simple main = defaultMain -k

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-13 Thread Ketil Malde
Don Stewart [EMAIL PROTECTED] writes: You really, really want to be using rnf for this job, instead of turning your brain into a pretzel shape. The Pretzel being one of the lesser-known lazy, cyclic, functional data structures. So pretzel-brain is actually a honorific, rather than

Re: [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-06 Thread Ketil Malde
Ben Franksen [EMAIL PROTECTED] writes: Can I convert my working repos to darcs-2? No. You cannot push or pull between darcs-2 format repos and darcs-1 or hashed format repos. This might not be optimal but is understandable, since the theory underlying the darcs-2 repository format is

Re: [Haskell-cafe] poll: how can we help you contribute to darcs?

2008-08-05 Thread Ketil Malde
Ketil Malde [EMAIL PROTECTED] writes: Duncan Coutts [EMAIL PROTECTED] writes: It would be useful if some darcs 2 hackers, contributors could help the ghc people evaluate if darcs 2 is still in the running. This looks like a very easy and low-investement way to get involved. ...and now I

Re: [Haskell-cafe] poll: how can we help you contribute to darcs?

2008-08-04 Thread Ketil Malde
Duncan Coutts [EMAIL PROTECTED] writes: It would be useful if some darcs 2 hackers, contributors could help the ghc people evaluate if darcs 2 is still in the running. This looks like a very easy and low-investement way to get involved. Expanding a bit on this: The page at

Re: [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread Ketil Malde
Brandon S. Allbery KF8NH [EMAIL PROTECTED] writes: Neil Mitchell [EMAIL PROTECTED] writes: The darcs 2.0 announcement read like an obituary I don't know why, but a lot of people I spoke to seemed to have that impression, and I essentially had to wave changelogs under their face to [...]

Re: [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread Ketil Malde
Gwern Branwen [EMAIL PROTECTED] writes: I just darcs get http://darcs.net, so I would guess it was either temporary or a problem on your end. Seems I needed a newer darcs - the one shipped with Ubuntu is 1.0.9, which appears to be too old, and it works when I build a new 2.0.2 from the

Re: [Haskell-cafe] carry state around ....

2008-07-29 Thread Ketil Malde
Galchin, Vasili [EMAIL PROTECTED] writes: ok guys .. what is this phantom type concept? Is it a type theory thing or just Haskell type concept? Here's another example. Say you want to use bytestrings with different encodings. You obviously don't want to concatenate a string representing

Re: [Haskell] Re: on starting Haskell-Edu, a new education-related Haskell-related mailing list

2008-07-15 Thread Ketil Malde
Peter Verswyvelen [EMAIL PROTECTED] writes: Well, if somebody can't spell beginners correctly, I highly doubt they will get alpha right... Certainly if they drive an Alfa Romeo car ;) For the beginning Haskell programmer owning an Italian sports car, I cannot resist suggesting [EMAIL

Re: [Haskell] Re: on starting Haskell-Edu, a new education-related Haskell-related mailing list

2008-07-15 Thread Ketil Malde
Benjamin L.Russell [EMAIL PROTECTED] writes: In that case, how about the following, more detailed charter: Beginner-level discussion about primarily non-research-oriented topics This part is good. Friendly and inviting - nothing scary here. serving the needs of non-computer-science

Re: [Haskell-cafe] memoization

2008-07-13 Thread Ketil Malde
Logesh Pillay [EMAIL PROTECTED] writes: Why? Its as if memoization is being ignored in the haskell version. How to fix? Shouldn't the definition of p' call (the memoized) p somewhere? In other words, I can't see any memoization, you seem to just map a normal, expensive, recursive function p'

Re: [Haskell-cafe] Is there a nicer way to do this?

2008-07-07 Thread Ketil Malde
Don Stewart [EMAIL PROTECTED] writes: splitAt n xs = (take n xs, drop n xs) Thanks. That is odd, though. It makes me wonder what to expect re optimization. Would the compiler/runtime know that splitAt could be done in a single pass? Not with that definition. It would require some

Reading A Monad Tutorial (Re: [Haskell-cafe] Ode from a Haskeller to a Schemer)

2008-07-07 Thread Ketil Malde
(With apologies to Queen.) Is this the RealWorld#? Is this I/O I see? Caught in a monad - No escape back to purity Open a file, it wipes out my smile to see I'm just a programmer, don't need a Ph.D I'm easy come, easy go Don't need this high brow weird monadic action, no real reaction for me,

Re: [Haskell] on starting Haskell-Edu, a new education-related Haskell-related mailing list

2008-07-04 Thread Ketil Malde
Simon Marlow [EMAIL PROTECTED] writes: My main concern here is that the remit for the new list is not clear enough. I can see a potential need for two lists: * a list for discussion related to teaching Haskell; * a list devoted to those learning Haskell, with a less research-

Re: [Haskell-cafe] A Monad for on-demand file generation?

2008-07-01 Thread Ketil Malde
Joachim Breitner [EMAIL PROTECTED] writes: 1) unsafeInterleaveIO seems like a big hammer to use for this problem, and there are a lot of gotchas involved that you may not have fully thought out. But you do meet the main criteria (file being read is assumed to be constant for a single run of

Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-19 Thread Ketil Malde
jinjing [EMAIL PROTECTED] writes: Any way here's the code: module Dot where import Prelude hiding ( (.) ) (.) :: a - (a - b) - b a . f = f a infixl 9 . Isn't this (roughly?) the same as flip ($)? As a side note, may I advise you to use another symbol, and leave the poor dot alone?

Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-19 Thread Ketil Malde
Albert Y. C. Lai [EMAIL PROTECTED] writes: While we are kind of on this topic, what makes the characters ħ þ prefix operator by default, while º and most other odd ones infix? alphanumeric vs non-alphanumeric Testing this, I find that isAlpha is True also for 'º', but as the OP claims,

Re: [Haskell-cafe] Fast sorting with Bytestring

2008-06-18 Thread Ketil Malde
Stefan O'Rear [EMAIL PROTECTED] writes: Ok, strane ... Well, let's test with some 'normal' text: time ./sort bible /dev/null # ~ 0.4 s time sort bible /dev/null # ~ 0.56 s Ok, not that different. But with Haskell you often expect to get very slow code compared to an

Re: [Haskell-cafe] How to do this in FP way?

2008-06-16 Thread Ketil Malde
Magicloud Magiclouds [EMAIL PROTECTED] writes: static int old; int diff (int now) { /* this would be called once a second */ int ret = now - old; old = now; return ret; } Because there is no variable in Haskell. So how to do this in a FP way? I would claim the FP way is like

Re: [Haskell-cafe] OT: Paper on increasing entropy in software systems

2008-06-15 Thread Ketil Malde
Magnus Therning [EMAIL PROTECTED] writes: I was just listening to Brooks' talk at OOPSLA 2007 and in the QA part at the end he mentions a paper on increasing entropy in software systems. He mentions the authors' names but I can't quite make it out and Google hasn't been very helpful either.

Re: [Haskell-cafe] Design your modules for qualified import

2008-06-09 Thread Ketil Malde
[EMAIL PROTECTED] writes: null filter map lookup On the contrary, these are terrible names _because_ they conflict with the Prelude. I agree. One solution would be to stuff these into Data.List. It's okay if you highly encourage or effectively mandate qualified import, like

Re: [Haskell-cafe] Re: Laziness leaks

2008-06-05 Thread Ketil Malde
Albert Y. C. Lai [EMAIL PROTECTED] writes: I haven't heard the terms laziness leak and strictness leak before Leak refers to a surprise. I the meaning of leak is in a bit of flux. Originally, I believe it refers to a memory leak, where the programmer forgot to call free() before losing the

Re: cabal and platform-independent haskell installation management (again) (Re: [Haskell-cafe] Re: Ubuntu and ghc)

2008-06-05 Thread Ketil Malde
Claus Reinke [EMAIL PROTECTED] writes: 1. there are no systems where packages just work! there are systems where a few people ensure that many people can live in such an illusion, though. Exactly. Integrating Cabal packages into the system package manager is still non-trivial, and a

Re: [Haskell-cafe] getting set up in ubuntu

2008-06-05 Thread Ketil Malde
Martin DeMello [EMAIL PROTECTED] writes: Any Ubuntu people care to share their experiences? Ask, and ye shall receive..at least some kind of answer. I'm especially looking for guidelines on what to install via apt-get and what to install independently. I'd get as much as possible via

Re: [Haskell-cafe] getting set up in ubuntu

2008-06-05 Thread Ketil Malde
Martin DeMello [EMAIL PROTECTED] writes: Thanks! Did you have any conflicts between manual and apt-got stuff? Not yet, but I haven't really hammered my system with packages yet. Is there any equivalent to gentoo's package.provided (which basically says 'I have installed this manually; please

Re: [Haskell-cafe] More on performance

2008-06-04 Thread Ketil Malde
Henning Thielemann [EMAIL PROTECTED] writes: Now the difficult question: How to write the 'mean' function in terms of 'sum' and 'length' while getting the same performance? Write a RULE pragma converting \xs - (foldl' f y0 xs,foldl' g z0 xs) into \xs - foldl' (\(y,z) x - (f y x,g z x))

Re: [Haskell-cafe] Re: Ubuntu and ghc

2008-06-04 Thread Ketil Malde
Achim Schneider [EMAIL PROTECTED] writes: Caveat: I have only a vague grasp on what exactly is being criticized here - using a modern Linux distribution, tons of packages are available, and almost all issues Claus point out seem to be taken care of - at least as far as I can see. Well, then

Re: [Haskell-cafe] [ANN] bloomfilter 1.0 - Fast immutable and mutable Bloom filters

2008-06-03 Thread Ketil Malde
Thomas Hartman [EMAIL PROTECTED] writes: What kind of speed do you get on your laptop for Data.Set? How much faster is the bloom filter? I tried to modify examples/Words.hs to use Data.Set insted. The results look like this (first Bloom, second Data.Set, both compiled with -O2):

Re: [Haskell-cafe] Copying Arrays

2008-05-30 Thread Ketil Malde
Duncan Coutts [EMAIL PROTECTED] writes: Because I'm writing the Unicode-friendly ByteString =p He's designing a proper Unicode type along the lines of ByteString. So - storing 22.5 bit code points instead of 8-bit quantities? Or storing whatever representation from the input, and providing a

Re: [Haskell-cafe] Copying Arrays

2008-05-30 Thread Ketil Malde
Johan Tibell [EMAIL PROTECTED] writes: I guess this is where I don't follow: why would you need more short strings for Unicode text than for ASCII or 8-bit latin text? But ByteStrings are neither ASCII nor 8-bit Latin text! [...] The intent of the not-yet-existing Unicode string is to

Re: [Haskell-cafe] Copying Arrays

2008-05-30 Thread Ketil Malde
Johan Tibell [EMAIL PROTECTED] writes: Lazy I/O comes with a penalty in terms of correctness! Is there a page describing this in more detail? I believe my programs to be correct, but would like to know if there are additional pitfalls, beyond hClosing a handle with outstanding (unevaluated)

Re: [Haskell-cafe] Type Coercion

2008-05-28 Thread Ketil Malde
PR Stanley [EMAIL PROTECTED] writes: (16 :: Float) is a perfectly legitimate statement although I'm surprised that it's allowed in a type strong language such as Haskell. It's a bit like casting in good old C. What's going on here? The literal 16 is really shorthand for fromIntegral

Re: [Haskell-cafe] Lazy lists simulated by unboxed mutable arrays

2008-05-28 Thread Ketil Malde
Bulat Ziganshin [EMAIL PROTECTED] writes: well, i don't understand difference between your idea and lazybs implementation HT said earlier that: This would still allow the nice tricks for recursive Fibonacci sequence definition. Which I guess refers to something like: fibs = 1 : 1 :

Re: [Haskell-cafe] Lazy lists simulated by unboxed mutable arrays

2008-05-28 Thread Ketil Malde
Ketil Malde [EMAIL PROTECTED] writes: You've lost me at least. ...but perhaps I can find my way back on my own? Today, you can choose between Array, with lazy elements, or UArray, with strict elements. Lazy arrays have the elements defined in advance, strict ones have them calculated

Re: [Haskell-cafe] Benchmarking Framework

2008-05-28 Thread Ketil Malde
Tom Harper [EMAIL PROTECTED] writes: I am in the process of writing a library for my MSc dissertation and would like to do some benchmarking. In doing so I need to compare the time and space of my library with some other code. Is there a framework for doing so in Haskell, aside from the

Re: [Haskell-cafe] Lazy lists simulated by unboxed mutable arrays

2008-05-28 Thread Ketil Malde
Henning Thielemann [EMAIL PROTECTED] writes: We could simulate a list with strict elements, i.e. data StrictList a = Elem !a (StrictList a) | End by an unboxed array with a cursor to the next element to be evaluated and a function that generates the next element. [...] looks like

Re: [Haskell-cafe] Lazy lists simulated by unboxed mutable arrays

2008-05-28 Thread Ketil Malde
Don Stewart [EMAIL PROTECTED] writes: http://code.haskell.org/~dons/uvector http://code.haskell.org/~dons/code/uvector (I presume? The other URL gives a 404) -k -- If I haven't seen further, it is by standing in the footprints of giants ___

Re: [Haskell-cafe] relational data representation in memory using haskell?

2008-05-22 Thread Ketil Malde
Salvatore Insalaco [EMAIL PROTECTED] writes: This doesn't look like a relational structure at all in Haskell. I believe you are abusing terminology here. 'Relation' refers to a table (since it represents a subset of AxBxC.., i.e. a relation), not to references between tables. Mutability and

[Haskell-cafe] Network.CGI and error handling

2008-05-22 Thread Ketil Malde
Hi, I'm trying to implement a CGI, but I have encountered some problems with handling program errors properly. I think it boils down to this: The first program from the documentation at http://hackage.haskell.org/packages/archive/cgi/3001.1.5.2/doc/html/Network-CGI.html import Network.CGI

[Haskell-cafe] Re: Network.CGI and error handling

2008-05-22 Thread Ketil Malde
Since Björn Bringert suggested (on IRC) the problem could be due to laziness, and that I should force the result string before giving it to output, I've been playing around a bit. (The program is somewhat more involved than the short test I provided earlier, but available on request). Without

[Haskell-cafe] Re: Network.CGI and error handling

2008-05-22 Thread Ketil Malde
Ketil Malde [EMAIL PROTECTED] writes: Since Björn Bringert suggested (on IRC) the problem could be due to laziness [..] Does anybody else have it working? I found that other person, and he is us. I played around some more, and thought -- just to not leave any stone unturned -- that I should

Re: [Haskell-cafe] Rotating backdrop (aka learning Haskell)

2008-05-20 Thread Ketil Malde
Yann Golanski [EMAIL PROTECTED] writes: 1- Get a list out of a file: I managed to do that using the following: parseImageFile :: FilePath - IO [String] parseImageFile file = do inpStr - readFile file return $ filter (/=) (breaks (=='\n') inpStr) Nice, simple and I

Re: [Haskell-cafe] [tagsoup] is it the expected behaviour ?

2008-05-19 Thread Ketil Malde
Fernand [EMAIL PROTECTED] writes: Experimenting with tagsoup (I'm using GHC 6.8.2 and tagsoup-0.6), I found something which appears to me as strange behaviour : when parsing tag's attributes that have spaces enclosing the = sign, tagsoup seems to interpret these as empty attributes' names

Re: [Haskell-cafe] Re: ByteString.pack behavior

2008-05-19 Thread Ketil Malde
Achim Schneider [EMAIL PROTECTED] writes: Nevertheless, a question comes to me - shouldn't compiler report a warning? While doing that is easy in this case, it becomes quite delicate in the general case. More precisely, it grows into the halting problem. I think it would be nice with a

Re: [Haskell-cafe] Re: Write Haskell as fast as C.

2008-05-18 Thread Ketil Malde
Ketil Malde [EMAIL PROTECTED] writes: data EvidenceCode = IAC | IUG | IFR | NAC | NR | ... deriving Show Could it be that this derived read instance is somehow very inefficient? To answer my own question: this is exactly it, ghc derives less than optimal code in this case. Rather than

Re: [Haskell-cafe] Performance: MD5

2008-05-18 Thread Ketil Malde
Peter Verswyvelen [EMAIL PROTECTED] writes: Is it possible to design hardware that is better suitable for functional languages? As I recall, Lisp machines went out of business when Lisp ran faster on industry standard, 68000-based Suns and Apollos, than on their custom hardware with tags and

Re: [Haskell-cafe] Re: Parsec3 performance issues (in relation to v2)

2008-05-18 Thread Ketil Malde
Antoine Latter [EMAIL PROTECTED] writes: When I specify the parsec-2.1.0.0 on the command-line, the Main.prof doesn't include any parsec CAFs. You need to add -auto-all to the build of Parsec as well. -k -- If I haven't seen further, it is by standing in the footprints of giants

Re: [Haskell-cafe] ByteString comparison question

2008-05-18 Thread Ketil Malde
Philip Müller [EMAIL PROTECTED] writes: import qualified Data.ByteString as B import qualified Data.ByteString.Char8 as C8 Note that these use the same underlying data structure, but Char8 interprets the contents as Char instead of Word8. So the B.heads and B.break should be CS8 - for

Re: [Haskell-cafe] Re: Write Haskell as fast as C.

2008-05-17 Thread Ketil Malde
Don Stewart [EMAIL PROTECTED] writes: mkAnn :: ByteString - Annotation mkAnn = pick . B.words where pick (_db:up:rest) = pick' up $ getGo rest pick' up' (go:_:ev:_) = Ann (B.copy up') (read $ B.unpack go) (read $ B.unpack ev) getGo = dropWhile (not . B.isPrefixOf

Re: [Haskell-cafe] How to use arrays efficiently?

2008-05-16 Thread Ketil Malde
Lauri Oksanen [EMAIL PROTECTED] writes: Thanks for help. I did some tests with UArray and it does the trick. The problem remaining is, how to implement UArray Int (Double, Double, Double)? As (UArray Int Double, UArray Int Double, UArray Int Double). Or as UArray Int Double, but with a

Re: [Haskell-cafe] Re: Write Haskell as fast as C.

2008-05-16 Thread Ketil Malde
Andrew Coppin [EMAIL PROTECTED] writes: I'm more worried about what happens in less trivial examples. [Let's face it, who wants to compute the sum of the numbers from 1 to N?] Inspired by Don's blog post, and coincidentally working on a program where profiling points to one particular, short

Re: [Haskell-cafe] Re: Write Haskell as fast as C.

2008-05-16 Thread Ketil Malde
Dan Weston [EMAIL PROTECTED] writes: mkAnn :: ByteString - Annotation mkAnn = pick . B.words where pick (_db:up:rest) = pick' up $ getGo rest pick' up' (go:_:ev:_) = Ann (B.copy up') (read $ B.unpack go) (read $ B.unpack ev) getGo = dropWhile (not . B.isPrefixOf

Re: [Haskell-cafe] Endianess

2008-05-13 Thread Ketil Malde
Aaron Denney [EMAIL PROTECTED] writes: I used to be a big-endian advocate, on the principle that it doesn't really matter, and it was standard network byte order. Now I'm convinced that little endian is the way to go I guess it depends a lot on what you grew up with. The names (little/big

Re: [Haskell-cafe] Parsec3 performance issues (in relation to v2)

2008-05-13 Thread Ketil Malde
Neil Mitchell [EMAIL PROTECTED] writes: I think it is known that Parsec 3 is slower than Parsec 2, as a result of the increased generality. I know that in the past someone was working on it, but I am not sure if they ever got anywhere. I got pretty good performance (IMHO - about 10MB/s, still

Re: [Haskell-cafe] Endianess

2008-05-13 Thread Ketil Malde
Jed Brown [EMAIL PROTECTED] writes: This, of course, is because `od -x' regards the input as 16-bit integers. We can get saner output if we regard it is 8-bit integers. Yes, of course. The point was that for big-endian, the word size won't matter. Little-endian words will be reversed with

Re: [Haskell-cafe] Maybe a, The Rationale

2008-05-11 Thread Ketil Malde
PR Stanley [EMAIL PROTECTED] writes: What is the underlying rationale for the Maybe data type? It is the equivalent of a database field that can be NULL. is it the safe style of programming it encourages/ Yes. Consider C, where this is typically done with a NULL pointer, or Lisp,

Re: [Haskell-cafe] runInteractiveProcess and hGetLine on Windows

2008-05-07 Thread Ketil Malde
Richard A. O'Keefe [EMAIL PROTECTED] writes: According to the ASCII standard, it was fully legitimate to use backspace and carriage return to get over-striking (which is why ASCII includes oddities such as ^ and ` : they really are for accents, and , did double duty as cedilla, ' as acute

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