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] [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] [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: Proposal for stand-alone deriving declarations?

2006-10-06 Thread Ketil Malde
Iavor Diatchki [EMAIL PROTECTED] writes: A question about the syntax: would there be a problem if we made the 'deriving' declaration look like an instance? And you might as well keep the 'instance' keyword when instantiating, even if the instance is derived? Seems more consistent to me

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] 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] 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] 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] 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: Packages in GHC 6.6

2006-08-23 Thread Ketil Malde
Bulat Ziganshin [EMAIL PROTECTED] writes: 1. Simon suggests that there is a core GHC distribution. it should be GHC _compiler_ itself and contains only libraries whose implementation are closely tied to compiler version [...] 2. For windows-like OSes where users prefer to see larger

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: Why is there no splitBy in the list module?

2006-07-10 Thread Ketil Malde
Marc Weber [EMAIL PROTECTED] writes: There is already lines. Why not generalise it to take an additional parameter '\n' and call it split or splitBy? There are some cases where you want to split a list not on '\n'. Indeed, and in e.g. ByteString and MissingH, there are more functions of

Re: package lang

2006-07-08 Thread Ketil Malde
Doaitse Swierstra [EMAIL PROTECTED] writes: but when i try to compile lhs2TeX I get the following error message: /usr/local/bin/ghc -O -package lang --make -o lhs2TeX Main.lhs [..] Did you try without the '-package lang'? I think 'ghc --make' is rather effective at automatically determining

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

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

Re: [Haskell] Speed of ByteString.Lazy

2006-06-29 Thread Ketil Malde
Robby Findler [EMAIL PROTECTED] writes: Just out of curiosity, did you try wc -l? import qualified Data.ByteString.Lazy.Char8 as L main = L.getContents = print . L.count '\n' ..or import Data.ByteString (hGetLines) main = hGetLines IO.stdin = print . List.length ? -k -- If I

[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

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

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

[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

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

Re: [GHC] #710: library reorganisation

2006-04-28 Thread Ketil Malde
Bulat Ziganshin [EMAIL PROTECTED] writes: sorry for repetition, but ByteString library in its current state still don't replaces PackedString in functionality, because it don't support full Unicode range of chars What would be required for it to replace PackedString? (If that is a goal?) If

Re: [GHC] #710: library reorganisation

2006-04-28 Thread Ketil Malde
Bulat Ziganshin [EMAIL PROTECTED] writes: IMHO, because PackedString is anyway abstract and DON'T support any way to see it's internal representation, any implementation that supports full unicode range, would be enough. Perhaps I'm misrepresenting FPS here, but from my POV, the

Re: getrlimit -M

2006-04-19 Thread Ketil Malde
Simon Marlow [EMAIL PROTECTED] writes: John Meacham wrote: perhaps if -M is not otherwise set, 'getrlimit(RLIMIT_AS,..)' could be called and the maximum heap size set to just under that Of course, it is commonly set to 'unlimited' anyway. Perhaps I should limit it; OTOH, the value must be

Re: ghc releasing memory during compilation

2006-04-06 Thread Ketil Malde
Simon Marlow [EMAIL PROTECTED] writes: So it used more than double the amount of memory. Is it reproducible? I expect that the -M value might be exceeeded by a small amount sometimes, but double is surprising. Yes. That is, I was running multiple instances on different CentOS computers,

Re: ghc releasing memory during compilation

2006-04-05 Thread Ketil Malde
I think I complained earlier about '+RTS -MxxxM' not being respected, but was unable to reproduce the issue. I just saw this again, my process was, I thought, limited to 800M heap, but, just before I gave up and killed the process, 'top' told me: 18580 ketil 18 0 1762m 945m 256 D 3.0

Re: ghc releasing memory during compilation

2006-04-05 Thread Ketil Malde
Ketil Malde [EMAIL PROTECTED] writes: 18580 ketil 18 0 1762m 945m 256 D 3.0 93.5 33:52.81 rbr So it used more than double the amount of memory. I can provide the source, but perhaps I should mention that the program basically just builds a large Map Int Int. No tricky FFI, arrays

Re: [Haskell-cafe] Lists of Lists

2006-03-08 Thread Ketil Malde
zell_ffhut [EMAIL PROTECTED] writes: Just wondering if anyone can help me with a Haskell problem im having. How would I get the value of, lets say, the 9th object in [4179355, 567412] ? You mean the ninth character in the concatenation of the list of strings? Concatenate the strings, and

Re: [Haskell-cafe] library sort

2006-03-08 Thread Ketil Malde
Neil Mitchell [EMAIL PROTECTED] writes: And a related question is: Which packages are searchable by Hoogle? The best answer to that is some. I intentionally excluded OpenGL and other graphics ones because they have a large interface and yet are not used by most people using Haskell. I'm not

Re: [Haskell-cafe] Re: haskell programming guidelines

2006-03-01 Thread Ketil Malde
Christian Maeder [EMAIL PROTECTED] writes: That should correspond to your taste as well, although someone (ie. S.M.) proposed to disallow the dot as operator in haskell'. From http://hackage.haskell.org/trac/haskell-prime/wiki/CompositionAsDot: | We lose . as composition. Mostly this doesn't

Re: [Haskell-cafe] Layout rule

2006-02-28 Thread Ketil Malde
Brian Hulley [EMAIL PROTECTED] writes: You can't be serious. This would cause far more problems than the current rule. Why? Surely typing one tab is better than having to hit the spacebar 4 (or 8) times? What you type depends on your editor. I hit tab, and the editor inserts an appropriate

Re: Export lists in modules

2006-02-24 Thread Ketil Malde
Malcolm Wallace [EMAIL PROTECTED] writes: One of the problems with the current mechanism for overriding Prelude definitions, is that every module that /uses/ such an entity must also explicitly hide the original Prelude: I guess I don't quite understand what you are trying to achieve. Case

Re: Export lists in modules

2006-02-24 Thread Ketil Malde
Benjamin Franksen [EMAIL PROTECTED] writes: If this means that you must import Data.List almost everywhere, this won't change anything - only add yet another import to every file. But you could import something different instead! Yes. You can do that as it is, of course (well, more or less,

Re: Export lists in modules

2006-02-23 Thread Ketil Malde
Malcolm Wallace [EMAIL PROTECTED] writes: you would simply replace the implicit import Prelude with an explicit import Prelude.Standard (or use a build flag like -fimplicit-prelude, or +98). Why not keep it implicit? If you want the alternative behavior, you know where to get it (import

Re: [Haskell-cafe] Re: Hashtable woes

2006-02-22 Thread Ketil Malde
Sebastian Sylvan [EMAIL PROTECTED] writes: I think you need to run the Fasta benchmark with N=25 to generate the input file for this benchmark... I made the file available at http://www.ii.uib.no/~ketil/knuc.input -k -- If I haven't seen further, it is by standing in the footprints of

Re: [Haskell-cafe] Code completion? (IDE)?

2006-02-17 Thread Ketil Malde
Marc Weber [EMAIL PROTECTED] writes: I tried downloading, eclipse and the latest EcplipseFP zip file. I couldn't use the standard installer (Help- Add Features ..) because it didn't find anything.. Strange, that worked for me. From my quick look, Eclipse looks like a workable candidate.

Re: [Haskell-cafe] (Newbie Question) How to get the value of an IO String Monad?

2006-02-17 Thread Ketil Malde
Peter [EMAIL PROTECTED] writes: So, How am I supposed to get the value of an IO Monad, such as IO String, without returning an IO Monad? Short answer: you don't. IO is a one way street. Build your application top down in the IO monad (starting with 'main'), and bottom up with pure code,

Re: [Haskell-cafe] haskell question

2006-02-17 Thread Ketil Malde
IBRAHIM MOSHAYA [EMAIL PROTECTED] writes: I need to write a function to return a given number Homework assignment? Perhaps if you get stuck, you can post your best current effort, and people will be able to nudge you in the right direction? -k -- If I haven't seen further, it is by standing

Re: [Haskell-cafe] Small syntax question

2006-02-13 Thread Ketil Malde
Maurício [EMAIL PROTECTED] writes: Why isn't this one [valid code]? module Main where main = do { let a = 3; return (); }; My guess is that the compiler is confused about whether you mean do let a = 3 return () or (your intended): do let a = 3

Re: [Haskell-cafe] Re: Hashtable woes

2006-02-10 Thread Ketil Malde
indicates that it triggers a bug in 6.4.1 Ah, I missed that. For my word counting indexes, I've settled on Data.Map, calculating an Int or Integer hash for each word (depending on word length, which is fixed). I haven't given it nearly the effort the shootout programs have seen, though, so

Re: [Haskell-cafe] Haskell not usally faster

2006-02-10 Thread Ketil Malde
Chris Kuklewicz [EMAIL PROTECTED] writes: Comparing Haskell to OCaml, Haskell is almost always slower. ...but generally not by much. And for another perspective on speed: Haskell loses tremendously in the knucleotide benchmark. As I mentioned previously, even TCL beats us by a margin of two,

Re: [Haskell-cafe] Shootout rankings

2006-01-15 Thread Ketil Malde
[EMAIL PROTECTED] (Donald Bruce Stewart) writes: :D Haskell now ranked 2nd overall, only a point or so behind C: http://shootout.alioth.debian.org/gp4/benchmark.php?test=alllang=all Very impressive! And note that if you put zero weight on memory use, GHC wins by a large margin. (OTOH,

Re: [Haskell] Re: haskell.org Public Domain

2006-01-11 Thread Ketil Malde
Wolfgang Jeltsch [EMAIL PROTECTED] writes: Thinking about the subject matter is hard enough, thinking about creating licensing pitfalls is best left to lawyers and other parasi^W specialists. The problem is that lawyers are thinking about pitfalls for you to fall into. Discussing licensing

Re: [Haskell] Re: License for haskell.org content

2006-01-09 Thread Ketil Malde
Simon Marlow [EMAIL PROTECTED] writes: Thus defaulting the FDL for all wiki content, including code, is a very bad idea. I agree - can we please use BSD or public domain? Another option is the Open Publication License, which requires acknowledgement (but little else). Anyway, I think a

Re: [Haskell-cafe] Project postmortem II /Haskell vs. Erlang/

2006-01-04 Thread Ketil Malde
Dylan Thurston [EMAIL PROTECTED] writes: http://wagerlabs.com/articles/2006/01/01/haskell-vs-erlang-reloaded | Compare Erlang | | -record(pot, { | profit = 0, | amounts = [] |}). [...] complain about having to explain to the customer how xyFoo is really different from

Re: [Haskell-cafe] data vs type

2006-01-04 Thread Ketil Malde
Daniel Carrera [EMAIL PROTECTED] writes: I'm trying to figure out how 'data' and 'type'. How data and type...what? :-) Generally, 'type' introduces type synonyms, i.e. just gives a new name to an existing type, while 'data' defines new (algebraic) types. So you can use type Name = String

Re: [Haskell-cafe] Re: When to teach IO

2005-12-22 Thread Ketil Malde
Bayley, Alistair [EMAIL PROTECTED] writes: Hear, hear. Compilers, and computationally complex programs in general, are atypical. IMO, a lot of programming these days is integration work i.e. shuffling and transforming data from one system to another, or transforming data for reports, etc. Not

Re: [Haskell-cafe] Re: Tutorial uploaded

2005-12-21 Thread Ketil Malde
Neil Mitchell [EMAIL PROTECTED] writes: I would have actually said Hugs, and especially the Windows front end WinHugs was a lot more suitable for beginners than GHC, but the wiki page very much gives the other impression. Which page are you referring to? I went to look, but couldn't find any

Re: [Haskell-cafe] Tutorial uploaded

2005-12-21 Thread Ketil Malde
Paul Moore [EMAIL PROTECTED] writes: One thing I'd consider adding is something along the lines of a section: == So how do I write Hello, world? == I've gone and done it. I've perhaps been heavy handed on the original page, so feel free to complain and/or fix it. -k -- If I haven't seen

Re: [Haskell] Making Haskell more open

2005-12-20 Thread Ketil Malde
Simon Peyton-Jones [EMAIL PROTECTED] writes: * Gour suggested using a Content Management System (e.g. Drupal http://drupal.org/) for haskell.org's front page. I'm not familiar with Drupal, but at least EZ publish allows users to convert pages to PDF - could be quite useful for documentation

Re: [Haskell-cafe] +RTS -M800M

2005-12-17 Thread Ketil Malde
Simon Marlow [EMAIL PROTECTED] writes: On 16 December 2005 10:05, Joel Reymont wrote: I'm trying to restrict GHC to 800Mb of heap at runtime by passing in +RTS -M800M, the machine has 1Gb of memory and top shows free physical memory dropping below 175Mb. -M800m should do more or less the

Re: [Haskell-cafe] module names

2005-12-15 Thread Ketil Malde
Scherrer, Chad [EMAIL PROTECTED] writes: module Main where module A where module B where in a single file. This example is straight from chapter 5 of the Report, and no mention is made (that I could find) about modules needing to be in separate files. But this won't load in ghci!

Re: [Haskell-cafe] Optimizing a high-traffic network architecture

2005-12-15 Thread Ketil Malde
Einar Karttunen ekarttun@cs.helsinki.fi writes: To matters nontrivial all the *nix variants use a different more efficient replacement for poll. Solaris has /dev/poll *BSD (and OS X) has kqueue Linux has epoll Since this is 'cafe, here's a page has some performance testing of epoll:

Re: [Haskell-cafe] Learning Haskell

2005-12-07 Thread Ketil Malde
Jimmie Houchin [EMAIL PROTECTED] writes: I have been perusing the haskell.org site and reading some of the tutorials. I just didn't want to expend lots of time just to find out that my math skills were woefully inadequate. I am grateful to learn that I can continue pursuing Haskell. Lots of

Re: [Haskell-cafe] returning lists

2005-12-01 Thread Ketil Malde
raptor [EMAIL PROTECTED] writes: split _ [] = [] split char (x:xs) | x /= char = x : split char xs | otherwise = [] *Main split 'x' str testing I want : [testing,split,...] How do i do this. Collect the read chars in a temp, when the separator is detected, return the

[Haskell] Re: Records

2005-11-28 Thread Ketil Malde
Johannes Waldmann [EMAIL PROTECTED] writes: Again, the concrete syntax problem is whether to hide the argument. Perhaps data Foo = Foo { foo :: Int, bar :: Int ; bar = 2 * foo self } with a reserved word self is better. - Are there semantic problems? Can't you solve this by writing a

Re: [Haskell-cafe] Records

2005-11-22 Thread Ketil Malde
Cale Gibbard [EMAIL PROTECTED] writes: This really isn't so bad in practice though. I've certainly never been confused by it. Well, what can I say? Good for you? You'd have to go out of your way to construct a situation in which it's potentially confusing No. There are much more

Re: [Haskell-cafe] Records

2005-11-21 Thread Ketil Malde
Simon Marlow [EMAIL PROTECTED] writes: I'm assuming you don't consider the distinction between '::' and ': :' to be a problem - the justification for this is simple and logical: a double colon '::' is a reserved symbol, in the same way that 'then' is a reserved identifier. Intuitively a

Re: [Haskell-cafe] Records

2005-11-19 Thread Ketil Malde
Antti-Juhani Kaijanaho wrote: Ketil Malde wrote: [about A.b and A . b potentially meaning different things:] Syntax that changes depending on spacing is my number one gripe with the Haskell syntax I've generally considered that one of the good ideas in most current languages (it's

Re: [Haskell-cafe] Records

2005-11-18 Thread Ketil Malde
Fraser Wilson [EMAIL PROTECTED] writes: Isn't there a potential for confusion with function composition (f . g)? Perhaps, but I always have spaces on either side when it's function composition. Good for you. Syntax that changes depending on spacing is my number one

Re: [Haskell] Improvements to GHC

2005-11-17 Thread Ketil Malde
John Lask wrote: I would like to sound out the Haskell community on what the feeling are most desirable to improve the commerciality (i.e. its general use) of ghc and Haskell in general (as distinct from feature set) I think more standardization on an extended feature set would be nice. It

Re: [Haskell-cafe] Re: layout problem

2005-11-17 Thread Ketil Malde
Benjamin Franksen wrote: If your editor is a little smarter still, it can do the Haskell layout without braces automatically too. The emacs mode helps with this. Yi/hIDE should be able to do it perfectly once it's in a generally usable state. :) Hmm, how would your super intelligent text

Re: [Haskell-cafe] doc/html - wiki - xml

2005-11-16 Thread Ketil Malde
Wolfgang Jeltsch wrote: Oh no! Converting LaTeX to HTML is terrible, in my opinion. One reason for this is that LaTeX isn't a markup language and provides a mixture of logical and visual macros. Conversely, I've occasionally tried to convert stuff - I think a TMR issue was one example,

Re: [Haskell-cafe] Re: [Haskell] Making Haskell more open

2005-11-14 Thread Ketil Malde
Gour wrote: Nobody said that DocBook does not work fine. However let me quote SPJ's message: quote However, I still wonder if there are things we could do that would make it easier for people to contribute. Here are two concrete suggestions: ^^^ - Make it possible for people to add

Re: [Haskell-cafe] Re: [Haskell] Making Haskell more open

2005-11-14 Thread Ketil Malde
Wolfgang Jeltsch wrote: Hmm, MediaWiki already supports the concept of discussion pages. Yes, I know. Perhaps I was less than lucid, so to clarify: But I doubt that it's a good thing to maintain DocBook sources via a wiki. I think it would be best to keep the documentation in DocBook

Re: [Haskell] Making Haskell more open

2005-11-13 Thread Ketil Malde
Wolfgang Jeltsch wrote: The potential of newsgroup was also mentioned - creating of compl.lang.haskell, but I won't comment of it considering that the newsgroup cannot be one all solution, and, otoh, does not, imho, provide any substantial advantage over the other three forms (we already have

Re: [Haskell-cafe] Re: FPS: Finalizers not running (was Memoryusageoutside of the Haskell heap)

2005-11-12 Thread Ketil Malde
Jan-Willem Maessen wrote: I think that if I can get unsafeFreeze/unsafeThaw to work reliably, it'll finally outperform Data.Map on your example. I haven't yet played with the hash function, which looks kind of bad; there may be hope for improvement there as well. Great! User-level Thaw

Re: [Haskell-cafe] Re: FPS: Finalizers not running (was Memoryusageoutside of the Haskell heap)

2005-11-10 Thread Ketil Malde
Sebastian Sylvan wrote: On 11/8/05, Jan-Willem Maessen [EMAIL PROTECTED] wrote: Just wanted to let people know that I've been working on improving Data.HashTable, with the help of Ketil Malde's badly performing code Always happy to help, of course - bad performance R us:-) Request:

Re: Proposal: Improved error message of Error in array index

2005-11-09 Thread Ketil Malde
Tomasz Zielonka wrote: On Tue, Nov 08, 2005 at 02:43:47PM +, Malcolm Wallace wrote: Of course, there is the old stand-by C pre-processor trick: #define superError(s) error (s++\nin file ++__FILE__ \ ++ at line ++__LINE__) There is a nice

Re: Proposal: Improved error message of Error in array index

2005-11-09 Thread Ketil Malde
Simon Marlow wrote: Hmm yes, this is indeed rather unhelpful. I can explain why it happens, though. The compiler has lifted out the error case into a top-level binding: x = error Error in array index Would the compiler be less agressive with this if I turn off optimization? I usually

Re: [Haskell] Writing large n-dim un-boxed array of Int32 quickly?

2005-10-31 Thread Ketil Malde
Rene de Visser wrote: I want to write a multi-dimensional unboxed arrary of Int32 to a file. (And also read it back later). hGetArray/hPutArray? -k ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell

[Haskell] [Fwd: Bug in Data.IntSet?]

2005-10-28 Thread Ketil Malde
:Bug in Data.IntSet? Date: Thu, 27 Oct 2005 15:25:30 +0200 From: Ketil Malde [EMAIL PROTECTED] To: glasgow-haskell-users glasgow-haskell-users@haskell.org AFAICT, there is a bug in Data.IntSet.split Here's an excerpt from GHCi: *Main let m=482 in Data.IntSet.split (16*m

Re: [Haskell-cafe] Nice way to calculate character frequency in a string

2005-10-27 Thread Ketil Malde
Udo Stenzel wrote: That raises the question: Should combining functions on containers be provided in a strict variant? Should strict application be the default? With the exception of lists, I generally tend to want strict behavior for collections. Combined with the principle of least

Re: [Haskell-cafe] Nice way to calculate character frequency in a string

2005-10-27 Thread Ketil Malde
Scherrer, Chad wrote: Sorry to drag this thread out, but here's one more thing you might try... (This is the café, isn't it? :-) Another option is perhaps to pack both char and count in one Int and use some kind of Set. This should save some space, and possibly time as well (presuming

Re: Profiling and Data.HashTable

2005-10-17 Thread Ketil Malde
Jan-Willem Maessen [EMAIL PROTECTED] writes: The practical upshot is that, for a hash table with (say) 24 entries, the GC must scan an additional 1000 pointers and discover that each one is []. Would a smaller default size help? In my case, I just wanted HTs for very sparse tables.

Re: [Haskell-cafe] Re: Interest in helping w/ Haskell standard

2005-10-15 Thread Ketil Malde
David Roundy [EMAIL PROTECTED] writes: Bah, simple libraries. They don't have to be part of the Standard Prelude. I completely agree. I'd rather decrease the number of libraries defined in the language itself and decouple library standardization from the definition of the language

Re: [Haskell-cafe] Emptying a list

2005-10-15 Thread Ketil Malde
[EMAIL PROTECTED] writes: Hi there, I'm just wondering if there is a command for emptying a list? Not really. If you want an empty list, you can use []. Also, is there any way to incorporate list operations (concatenation in particular) in a do-statement on lists? Every time I try it gives

Profiling and Data.HashTable

2005-10-14 Thread Ketil Malde
Hi all, I have a program that uses hash tables to store word counts. It can use few, large hash tables, or many small ones. The problem is that it uses an inordinate amount of time in the latter case, and profiling/-sstderr shows it is GC that is causing it (accounting for up to 99% of the

Re: [Haskell-cafe] Examples of using STUArray + help with converting code

2005-10-14 Thread Ketil Malde
Joel Reymont [EMAIL PROTECTED] writes: If I don't cast then how do I convert this code? Uh, what is wrong with divMod? *Main Data.Word (100::Word64) `divMod` (2^32) (2,1410065408) doubleToInts d = runST ( [...] This will only give you a headache. :-) -k -- If I haven't seen

Re: [Haskell-cafe] Examples of using STUArray + help with converting code

2005-10-14 Thread Ketil Malde
Joel Reymont [EMAIL PROTECTED] writes: I must be missing something because I don't think the code below converts a double. Yes, sorry, my bad. I was (and is) confused about what you wanted to do. -k -- If I haven't seen further, it is by standing in the footprints of giants

Re: How to make Data.Set.Set a Functor

2005-10-12 Thread Ketil Malde
Lajos Nagy [EMAIL PROTECTED] writes: On the other hand, it seems intuitively natural to make Set an instance of fmap. Indeed. While I generally like the overloaded, qualified names, I find it annoying when, like 'map', they clash with Prelude imports. Which means that, in a module using

Re: How to use Data.Set.Set

2005-10-12 Thread Ketil Malde
Christian Maeder [EMAIL PROTECTED] writes: I think, you should import qualified Data.Set as Set only and use Set.map rather than the deprecated mapSet (most other names from Data.Set make more sense with the Set. prefix) I can do this of course, but I think it would be nice to be able

Re: Default name of target executable

2005-10-11 Thread Ketil Malde
Simon Marlow [EMAIL PROTECTED] writes: I'm slightly inclined not to make this change, but I could be swayed if there was enough interest in it. What I'm seeing so far is not overwhelming support for the change. Simon PJ is in favour, though. a.out is tradition, of course, but OTOH, I don't

Re: Default name of target executable

2005-10-10 Thread Ketil Malde
Tomasz Zielonka [EMAIL PROTECTED] writes: Because of this long syntax and comand-line completion I've even once lost the source code. I forgot to remove the .hs at the end of line: $ ghc --make Prog -o Prog.hs If you want, I can tell you about this great version control system I'm using :-)

Re: [Haskell] Re: IO functions reference?

2005-09-27 Thread Ketil Malde
Creighton Hogg [EMAIL PROTECTED] writes: So I looked to see if there were any standard functions for taking an input line and turning it into a list, and I couldn't find any. How would one do this in Haskell? I just want to parse the line into a list of strings, and from there recover

Re: [Haskell-cafe] mistake in Gentle Introduction

2005-09-22 Thread Ketil Malde
Michael Vanier [EMAIL PROTECTED] writes: import Prelude hiding length whereas the correct syntax is import Prelude hiding (length) I spent nearly an hour beating my head against this. Can someone fix this in the documentation? Or, alternatively, fix the Haskell syntax? It would be

Re: [Haskell-cafe] Trapped by the Monads

2005-09-21 Thread Ketil Malde
Bill Wood [EMAIL PROTECTED] writes: The variable mem is a so-called hybrid variable; it crunches together 2 different concepts: a boolean value (could I allocate memory?) and an address value (what is the address where I can find my allocated memory). IMO, Maybe is exactly the oppsite, it

Re: [Haskell-cafe] Basic type classing question.

2005-09-21 Thread Ketil Malde
Karl Grapone [EMAIL PROTECTED] writes: I've just started learning Haskell, and I must admit I'm finding it a bit hard to get my head around the typing system... Okay. What I want to be able to do is add and remove fields while the system is running, While I'm sure you'll get some advanced

Re: [Haskell-cafe] Basic Haskell Types Question

2005-09-16 Thread Ketil Malde
Adam Wyner [EMAIL PROTECTED] writes: I really want to get the following sort of report for the type: negationAtomicProps atomicProps1 :: PropList GHCi seems to get this right. Is that an option for you? -k -- If I haven't seen further, it is by standing in the footprints of giants

Re: Profiling and analysing space usage

2005-09-02 Thread Ketil Malde
Alistair Bayley [EMAIL PROTECTED] writes: I'm no expert, but since nobody else seems to have answered: - is my analysis of the space usage correct i.e. allocation in the loop function is very short-lived and nothing to worry about? IME, that would be the typical case. - is there anything

Re: [Haskell-cafe] Re: [Haskell] pros and cons of static typing and side effects ?

2005-08-29 Thread Ketil Malde
Martin Vlk [EMAIL PROTECTED] writes: http://www-i2.informatik.rwth-aachen.de/Staff/Current/michaelw/sttt-ml-haskell.pdf Interesting to see others' experiences, even if they are slightly negative. It contains descriptions of lots of real-world problems and how They are only implementing

Re: [Haskell-cafe] How to use STArray?

2005-08-26 Thread Ketil Malde
Greg Buchholz [EMAIL PROTECTED] writes: Diff arrays have an immutable interface, but rely on internal updates in place to provide fast functional update operator //. While a cool concept, ISTR that somebody benchmarked these some time ago, and found the performance to be fairly poor in

Re: [Haskell] reading call graphs

2005-08-24 Thread Ketil Malde
Scherrer, Chad [EMAIL PROTECTED] writes: I'm trying to understand the entries column. I thought this was the number of times a given function is called. But main is nonrecursive, I thought so, too. My guess would be that your program doesn't do quite what you think it does, or that our

[Haskell-cafe] static typing and interactivity

2005-08-18 Thread Ketil Malde
Hi, One slight annoyance using Haskell is the inability to load modules with type problems in the interactive environment (i.e. GHCi). When I have a type error, it would be nice to have an interactive way to explore what the compiler thinks about the types involved -- as it is, I have to resort

Re: [Haskell] pros and cons of static typing and side effects ?

2005-08-11 Thread Ketil Malde
mt [EMAIL PROTECTED] writes: http://paulgraham.com/lispfaq1.html [Most hackers I know have been disappointed by the ML family. Languages with static typing would be more suitable if programs were something you thought of in advance, and then merely translated into code. But

<    4   5   6   7   8   9   10   11   12   >