Re: [Haskell-cafe] Slow documentation generation on Hackage

2009-06-08 Thread Ketil Malde
Niemeijer, R.A. r.a.niemei...@tue.nl writes: If that is the main concern, would the following not work? [...] Result: immediate documentation for every contributor with good intentions Or simply, on upload, generate the doc directory with a temporary page saying that documentation will

Re: [Haskell-cafe] Deprecated packages on Hackage?

2009-06-09 Thread Ketil Malde
Erik de Castro Lopo mle...@mega-nerd.com writes: Finally, if a package is deprecated it might be usefult to have a reason as well so the hackage entry might say: Deprecated : true (replaced by package XXX) or Deprecated : true (needs maintainer) Or just Deprecated: (reason)?.

Re: [Haskell-cafe] How To Make It Faster?

2009-06-10 Thread Ketil Malde
Diego Souza dso...@bitforest.org writes: I'd like to make it run faster, if possible. What should I do to identify the bottlenecks and once I find them, a few guidelines to actually fix them. The usual approach is to compile with profiling (ghc -prof -auto-all, don't forget to optimize!), and

Re: [Haskell-cafe] Debugging misbehaving multi-threaded programs

2009-06-11 Thread Ketil Malde
Evan Klitzke e...@eklitzke.org writes: [...] Unfortunately, this doesn't seem to work; whenever the program terminates due to running out of heap space, the generated .prof file is empty. Unless there's some specific problem with profiling in combination with threading, you can get heap

[Haskell-cafe] Software Transactional Memory and LWN

2009-06-11 Thread Ketil Malde
Hi, Browsing LWN, I ran across this comment: http://lwn.net/Articles/336039/ The author makes a bunch of unsubstantiated claims about STM, namely that all implementations use locking under the hood, and that STM can live- and deadlock. I've seen a lot of similar sentiments in other places as

Re: [Haskell-cafe] Software Transactional Memory and LWN

2009-06-11 Thread Ketil Malde
Neil Brown nc...@kent.ac.uk writes: I think there needs to be some differentiation here between the implementation of STM, and the programmer's use of STM. The implementation of STM does effectively use locks (from memory, it's this paper that explains it: Ignoring the paper in the interest

Re: [Haskell-cafe] Logo fun

2009-06-15 Thread Ketil Malde
Luke Palmer lrpal...@gmail.com writes: Nice work, I love this one. :-) Yes, very nice. I do find the lambda and too fat, but I presume that's the way the Haskell logo looks. Also, I think the right edges of the thick part of the batteries should be aligned, so that the little knob on the +

Re: [Haskell-cafe] slow code

2009-06-17 Thread Ketil Malde
brian bri...@aracnet.com writes: However, I would like to reiterate that it's the double - string which is really the time/memory sink. I verified this by printing a simple string based on the value (to make sure the value was evaluated) and it runs fast enough for me. Is there an

Re: [Haskell-cafe] Re: Unicode workaround for getDirectoryContents under Windows?

2009-06-17 Thread Ketil Malde
Simon Marlow marlo...@gmail.com writes: Why only on Windows? Just because it's a lot easier on Windows - all the OS APIs take Unicode file paths, so it's obvious what to do. In contrast on Unix I don't have a clear idea of how to proceed. On Unix, all file APIs take [Word8] rather than

Re: [Haskell-cafe] Optimizing spelling correction program

2009-06-22 Thread Ketil Malde
Kamil Dworakowski ka...@dworakowski.name writes: Right... Python uses hashtables while here I have a tree with log n access time. I did not want to use the Data.HashTable, it would pervade my program with IO. The alternative is an ideal hashmap that never gets changed. This program creates a

Re: [Haskell-cafe] Optimizing spelling correction program

2009-06-22 Thread Ketil Malde
Johan Tibell johan.tib...@gmail.com writes: Typo? Bloom filters have O(1) lookup and tries O(m) lookup where m is the number of characters in the string. Typically you need to examine the (whole) search string in order to compute the hash function, so I think it is fair to consider them both

Re: [Haskell-cafe] How to determine if a FilePath is a directory name or regular file?

2009-06-22 Thread Ketil Malde
Deniz Dogan deniz.a.m.do...@gmail.com writes: One explanation is that isBlah asks is this thing a blah, but we're not asking that because there is an indirection via the filepath. We're asking does this filepath refer to a directory not is this filename a directory. I think see what you

Re: [Haskell-cafe] Error in array index.

2009-06-24 Thread Ketil Malde
Bulat Ziganshin bulat.zigans...@gmail.com writes: array ((0,0),(65535,65535)) [((0,0),*** Exception: Error in array index i think that it may be a bit too large for internal Int indicies: Aren't you asking for a 4G element array here, so with a 32bit wraparound the array will be some

Re: [Haskell-cafe] Using unsafePerformIO safely

2009-06-25 Thread Ketil Malde
Luke Palmer lrpal...@gmail.com writes: mult2 x = unsafePerformIO $ do { print x; return (2*x) } main = do let answer = mult2 21 print answer print answer [this] would print 21,42,42. Thus our *correct* transformation of programs changed behavior. Just to expand a bit on

[Haskell-cafe] XMonad and NetworkManager?

2009-06-29 Thread Ketil Malde
Hi, A bit off-topic, but this is the café, after all... Like many here, I run XMonad as my window manager on top of Linux. On - at least my brand of - Linux, networking is generally handled by NetworkManager, which really needs its associated applet (nm-applet) to work properly. While I

Re: [Haskell-cafe] List spine traversal

2009-06-29 Thread Ketil Malde
Deniz Dogan deniz.a.m.do...@gmail.com writes: What is the spine of a list? Google seems to fail me on this one. A (single-linked) list can be seen as a set of cons cells, where each cell contains two pointers, one to the next cons cell, and one to the cell's data contents ('car' and 'cdr' in

Re: [Haskell-cafe] Making a strict (non-lazy) GCL Interpreter

2009-06-30 Thread Ketil Malde
Hector Guilarte hector...@gmail.com writes: I need to randomly select ONE of the valid conditions and execute it's instruction. I know there is a Random Monad, but it returns an IO Int, No, this is not right. Values in the Random monad are computations that rely on randomness, but they can

Re: [Haskell-cafe] ORM for haskell?

2009-07-01 Thread Ketil Malde
Mads Lindstrøm mads_lindstr...@yahoo.dk writes: I do not get this explanation, could you expand? I would have thought it should be: difference? Because SQLAlchemy knows about the relationships (not relations, but relation_ships_), it do not have to explicitly join on foreign keys.. I think

Re: [Haskell-cafe] Monoid wants a (++) equivalent

2009-07-01 Thread Ketil Malde
You know, this might be the right time to start expanding our vocabulary beyond seven bits. Since we're likely to keep mappend around as an alias for some time, people would have a grace period to adjust. How about U+2295 (circle with plus inside it)? Or, if we would like to stick to the

Re: [Haskell-cafe] Monoid wants a (++) equivalent

2009-07-06 Thread Ketil Malde
Mattias Bengtsson moonl...@dtek.chalmers.se writes: (?) is also undefined in Prelude. Which i think is a good thing. I think it's quite nice to use (?) as an operator in higher order functions. Also, it clashes with the implicit parameters extension, and combining the extension with a

Re: [Haskell-cafe] Implementing Las Vegas algorithms in Haskell

2009-07-07 Thread Ketil Malde
Matthias Görgens matthias.goerg...@googlemail.com writes: Yes, I thought of a similar scheme. Say we want to implemented randomized quicksort. Passing a list of random numbers would destroy laziness and linearise the algorithm --- because the right recursion branch would need to know at

Re: [Haskell-cafe] Implementing Las Vegas algorithms in Haskell

2009-07-07 Thread Ketil Malde
Luke Palmer lrpal...@gmail.com writes: Random monad is a very natural choice for random cloud computations. Don't think of it as a state monad -- that's an implementation detail. You can think of a value of type Random a as a probability distribution of a's; and there are natural

Re: [Haskell-cafe] Implementing Las Vegas algorithms in Haskell

2009-07-07 Thread Ketil Malde
Ketil Malde ke...@malde.org writes: data Distribution = Uniform low high | Normal mu sigma | StudentT ... Of course, now that it occurs to me to check this, I notice Data.Random.Distribution does the same thing, only more generally, supporting more distributions, and no doubt with more

Re: [Haskell-cafe] Implementing Las Vegas algorithms in Haskell

2009-07-07 Thread Ketil Malde
Ketil Malde ke...@malde.org writes: sample :: Distribution - Random Double Sorry, that's not entirely accurate. Rather: sample :: RandomGen g = Distribution - Rand g Double -k -- If I haven't seen further, it is by standing in the footprints of giants

Re: [Haskell-cafe] Re: Haskell Platform on Ubuntu

2009-07-08 Thread Ketil Malde
George Pollard por...@porg.es writes: 2009/7/7 Matthias Görgens matthias.goerg...@googlemail.com: Karmic (9.10) will have GHC 6.10.3, possibly 6.10.4. It currently spots 6.10.3, in the alpha release I run here. A major problem is that the libraries are still for 6.8.2, so you cannot

Re: [Haskell-cafe] Re: Haskell Platform on Ubuntu

2009-07-08 Thread Ketil Malde
Matthias Görgens matthias.goerg...@googlemail.com writes: One problem I see is the binary-only distribution of packages. This makes cabal-install incompatible with most distributions except, maybe, gentoo. The automation process would have to run through hackageDB tracking dependencies and

Re: [Haskell-cafe] Why this cannot be compiled?

2009-07-13 Thread Ketil Malde
Magicloud Magiclouds magicloud.magiclo...@gmail.com writes: 43 instance Read Attribute where 44 readsPrec _ str = [ (mkAttr attr_ color, rest) | (attr_, rest1) - lex str 45 , (color, rest) - case reads rest1 of 46

[Haskell-cafe] Re: [Haskell] Re: 20 years ago

2009-07-14 Thread Ketil Malde
[redirected from hask...@] Benjamin L.Russell dekudekup...@yahoo.com writes: One often amusing outgrowth of this is that FP (OOP) fanatics anthropomorphize their functions (objects). Well, I don't think we do. Functions are just mappings of values to values, they may be opaque, but

Re: [Haskell-cafe] Proposal: TypeDirectedNameResolution

2009-07-30 Thread Ketil Malde
Cale Gibbard cgibb...@gmail.com writes: There was a great related idea on #haskell the other day: Make explicit qualification unnecessary whenever there is a *unique* choice of module qualifications from those imported which would make the expression typecheck. [...] This would mean that

[Haskell-cafe] Strange memory usage problem

2009-07-31 Thread Ketil Malde
Run for instance this command line: fselect And (Func GT len 100) (Func GT k2 0.5) test.sff This should now run in constant space. To observe the linear growth space, unpull the last patch from biolib, i.e. this one: Fri Jul 31 00:14:09 CEST 2009 Ketil Malde ke...@malde.org * comment

[Haskell-cafe] Re: Strange memory usage problem

2009-08-01 Thread Ketil Malde
John Lato jwl...@gmail.com writes: I can confirm this behavior on GHC 6.10.4 on OSX 10.5.7. Great, thanks! Try adding {-# INLINE getRB #-} above the getRB definition. That fixes it for me. And I especially appreciate this, of course. It appears to do the trick here, too. I think that

Re: [Haskell-cafe] Efficient functional idiom for histogram

2009-08-01 Thread Ketil Malde
Paul Moore p.f.mo...@gmail.com writes: What am I doing wrong here? I'd have expected compiled Haskell to be faster than interpreted Python, so obviously my approach is wrong. Two things from my experience: Python associative arrays are fast, and Haskell random numbers are slow. So by building

Re: [Haskell-cafe] Announce: EnumMap-0.0.1

2009-08-10 Thread Ketil Malde
John Van Enk vane...@gmail.com writes: EnumMap is a generalization of IntMap that constrains the key to Enum rather than forcing it to be Int. I have no idea what impact this has on performance, Will it have an impact on correctness? There are some funky Enum instances around: Prelude map

Re: [Haskell-cafe] Announce: EnumMap-0.0.1

2009-08-12 Thread Ketil Malde
Felipe Lessa felipe.le...@gmail.com writes: There are some funky Enum instances around: IMO it's implicit that keys overwrite eachother whenever their 'fromEnum' is equal, however that may be spoken in the docs. I couldn't find anything explicit in the documentation. I'd suggest a clear

Re: [Haskell-cafe] Announce: EnumMap-0.0.1

2009-08-13 Thread Ketil Malde
David Menendez d...@zednenem.com writes: That depends on what outside the Enum range means. You'll get an exception if you somehow get an Int key in the map which doesn't correspond to any value in the enum, but you don't get an exception if you try to pass in, say, a large Integer. Prelude

Re: [Haskell-cafe] gbp sign showing as unknown character by GHC

2009-08-20 Thread Ketil Malde
Stuart Cook sco...@gmail.com writes: GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help Loading package base ... linking ... done. Prelude map Data.Char.ord 饁 [39233]== 0x9941 Prelude putStrLn 饁 A == 0x41 It seems that GHCi is clever enough to

Re: [Haskell-cafe] Re: Where do I put the seq?

2009-08-20 Thread Ketil Malde
David Leimbach leim...@gmail.com writes: I'm pretty certain that forcing a pattern match via case is what disallows the laziness to get out of hand. The case statement, when evaluated, must choose a matched pattern branch, even if it's the only possibility, which ends up boiling down to seq

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

2009-08-25 Thread Ketil Malde
Steve stevech1...@yahoo.com.au writes: Also, I had a problem using floating point in Python where round(697.04157958254996, 10) gave 697.04157958259998 Its been fixed in the latest versions of Python: round(697.04157958254996, 10) 697.0415795825 ghci roundN 697.04157958254996 10

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

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

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

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

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

2009-08-30 Thread Ketil Malde
Günther Schmidt gue.schm...@web.de writes: So I could insert all the keys in the table into a suitable bloom filter instead and the just query the bloom filter instead of the database. Somewhat dependent on your need (i.e. Bloom filters may give false positives), this could be what you

Re: [Haskell-cafe] ∀ lexing in ghc and ghci

2009-09-18 Thread Ketil Malde
Daniel Fischer daniel.is.fisc...@web.de writes: In ghci I can do ∀ :: Var - Base - Formula - Formula ∀ = All fine. But then ghc complains. What's going on here? Maybe your encodings aren't UTF8? Or rather, one of them is UTF-8, and the other isn't. So that in one case, you get the

Re: [Haskell-cafe] Re: [Haskell-beginners] map question

2009-09-18 Thread Ketil Malde
Gregory Propf gregorypr...@yahoo.com writes: Heh, perhaps we should petition to have a new computer key and symbol added to the world's way of writing maths, something like maybe a downward angled slash to mean prefix (-) Or just use 'negate' and 'subtract'? -k -- If I haven't seen

Re: [Haskell-cafe] unicode text libraries

2009-09-29 Thread Ketil Malde
Johan Tibell johan.tib...@gmail.com writes: I agree with Don. Also, I don't think that a Unicode type should mention what encoding it uses as it's an implementation detail. Right. I see from the documentation that it uses Word16s (and presumably the utf-16 encoding). Out of curiosity, why

Re: [Haskell-cafe] Market Place for Haskell development teams?

2009-09-30 Thread Ketil Malde
Curt Sampson c...@starling-software.com writes: Java is part of the Java platform, that brought OS independence and interoperability at the right time. .Download-execution on the client was also a reason for the initial success of Java in the Internet era. This may be somewhat anecdotal

Re: [Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.

2009-10-01 Thread Ketil Malde
namekuseijin namekusei...@gmail.com writes: Point is: = . $ : ! `` and meaningful whitespace are all nice shortcuts, but also hairy confusing... As somebody pointed out, these are rather idiomatic, and only confusing to beginners. (I'm not sure what you refer to with whitespace, some think

Re: [Haskell-cafe] I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-10-01 Thread Ketil Malde
Andrew Coppin andrewcop...@btinternet.com writes: Peter Verswyvelen wrote: I really doubt people tend to think in either way. It's not even sure our thinking can be modeled with computing no? Well, try this: Go ask a random person how you add up a list of numbers. Although the question of

Re: [Haskell-cafe] error on --++ bla bla bla

2009-10-01 Thread Ketil Malde
Hong Yang hyang...@gmail.com writes: But in my program, I did not define --++. And that's what the error tells you, no? Defining operators (or not) doesn't change the syntax. Since the lexeme --++ is syntactially a valid operator, it will be parsed as such, regardless of whether it is defined

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-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] 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] 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] 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] 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] 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] 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] 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.

[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] 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

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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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-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] 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] 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] 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] 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] What *not* to use Haskell for

2008-11-12 Thread Ketil Malde
Don Stewart [EMAIL PROTECTED] writes: Data.ByteString is full of mutation-heavy inner loops. I suspect you are missing Kyle's point, which I interpret to be more like what Paul Graham talks about in ANSI Common Lisp: [OO] provides a structured way to write spaghetti code. [...] For

Re: [Haskell-cafe] ByteString/parsec

2008-11-12 Thread Ketil Malde
Pieter Laeremans [EMAIL PROTECTED] writes: Are there any good examples of open source projects which parse ByteString data ? Don't know about good, but here are some working examples that may or may not be useful to you. Pointers are inside the darcs repo, you can of course 'darcs get

Re: [Haskell-cafe] Proof of a multi-threaded application

2008-11-17 Thread Ketil Malde
Luke Palmer [EMAIL PROTECTED] writes: STM My apologies for side-tracking, but does anybody have performance numbers for STM? I have an application waiting to be written using STM, boldly parallelizing where no man has parallelized before, but if it doesn't make it faster, the whole excercise

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