Re: suggestion: add a .ehs file type

2007-11-22 Thread Ketil Malde
Wolfgang Jeltsch [EMAIL PROTECTED] writes: It made me discover that I use more language extensions than I thought I was using. I think, it’s a good thing if you have to be clear about what extensions you use and what you don’t use. What if someone wants to compile your code with a

6.8.0.x, 64 bits, and memory profiling

2007-11-05 Thread Ketil Malde
Hi, I'm using heap profiling on AMD64, and I am getting some slightly strange results. Running the profiling, 'top' shows about 600Mb in use, but the resulting profile shows ~80Mb. Rerunning with -M200M results in an out-of-memory error. Could it be that the profile is calculated incorrectly

Re: GHC benchmarks

2007-10-12 Thread Ketil Malde
Simon Marlow [EMAIL PROTECTED] writes: Not so much code size, but data size (heap size, to be more precise). Of course. There was some talk about storing tags in pointers for 6.8, I couldn't find the reference, but I wonder if that would help my situation? It would be interesting to know

Re: GHC benchmarks

2007-10-12 Thread Ketil Malde
Ketil Malde [EMAIL PROTECTED] writes: I've also added results from the 64 bit ghc-6.8.20071011 binary snapshot, which shows some nice improvements, with one benchmark improving by 30%(!). One difference between these runs is that the ByteString library, on which this particular benchmark

GHC benchmarks

2007-10-11 Thread Ketil Malde
Hi, I've recently implemented some benchmarks for my library, and while I expected a slowdown for 64-bit code, I'm a bit bit surprised by the results. In summary: with 64 bit ghc 6.6.1, my benchmark runs in ~160 seconds with 32 bit ghc 6.6, it runs in ~ 95 seconds Most of the

Re: ghc 6.6 Debian packages

2007-07-06 Thread Ketil Malde
On Thu, 2007-07-05 at 12:11 -0400, Matthew Danish wrote: On Thu, Jul 05, 2007 at 11:15:03AM +0200, Christian Maeder wrote: Is there no way to provide all the extra libs in one debian package for ghc? It may be possible to create a package which depends on all normal extras but that seems

Re: 2-days old in Haskell

2007-06-01 Thread Ketil Malde
On Fri, 2007-06-01 at 16:00 +0200, TOPE KAREM wrote: I opened a notepad and type this program: main = putStrLn Hello, Word! I saved this file as hello.hs in the same directory GHCi 6.6.1 was installed. You can store it anywhere, as long as GHC is in your search path. When I tried to

Re: isSpace is too slow

2007-05-21 Thread Ketil Malde
On Sun, 2007-05-20 at 16:59 +0100, Duncan Coutts wrote: isSpace c = c == ' ' || c == '\t'|| c == '\n'|| c == '\r'|| c == '\f'||

Re: Feature proposal: ghc --full-flag-help ?

2007-03-14 Thread Ketil Malde
Simon Peyton-Jones [EMAIL PROTECTED] writes: Suppose ghc --full-flag-help simply printed the URL http://www.haskell.org/ghc/docs/latest/html/users_guide/flag-reference.html Or suppose it did 'system(man ghc)'? -k -- If I haven't seen further, it is by standing in the footprints

Re: find module of `fromJust Nothing'

2006-11-13 Thread Ketil Malde
Serge D. Mechveliani wrote: On Mon, Nov 13, 2006 at 12:17:07PM +, Simon Peyton-Jones wrote: The Maybe.fromJust: Nothing comes from the library code itself. The Nat1 part is simply the name of the binary. It give no clue to who called fromJust. I do not understand the whole

Re: Benchmarking GHC

2006-10-19 Thread Ketil Malde
Neil Mitchell [EMAIL PROTECTED] writes: I want to benchmark GHC vs some other Haskell compilers, what flags should I use? [...] I guess the answer is -O2 -fvia-C? I tend to use -O2, but haven't really tested it against plain -O. From what I've seen -fvia-C is sometimes faster, sometimes

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

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

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: 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: 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: (no subject)

2005-06-17 Thread Ketil Malde
Amit rohatgi [EMAIL PROTECTED] writes: I want to install DARSC and for that i need GHC .. What architecture? Isn't there a pre-packaged binary version available that you can use? I dont have any old version of Ghc already on the comp so i need the *.hc files from any version 6-?-? to

Re: HOME: getEnv: does not exist

2005-04-18 Thread Ketil Malde
Malcolm Wallace [EMAIL PROTECTED] writes: I think runghc is acting like GHCi, and trying to read the file $HOME/.ghci on startup. I toyed with this, and it seems like runghc is forking off a ghc process, which then tries to read .ghci (and possibly .inputrc) from the $HOME directory.

seeking array advice

2005-03-02 Thread Ketil Malde
Hi, I'm about to rework an old program, and I am pondering what data structure to use. Basically, I want to store an index of fixed-length words (q-grams) with positions, i.e. given a word, I can quickly find its position in the data. The data set may be large (gigabytes would be nice), and I

Re: RFC: hyperlinks in Haddock docs

2005-02-01 Thread Ketil Malde
Simon Marlow [EMAIL PROTECTED] writes: There are some problems with the existing approach. It doesn't cope well with instances: instances might refer to types/classes not below the current module in the hierarchy. Also you might import an entity from a hidden module, but actually want to

Re: RFC: hyperlinks in Haddock docs

2005-02-01 Thread Ketil Malde
Simon Marlow [EMAIL PROTECTED] writes: Hmm, I'm not sure that would be practical. Lots of entities are exported from more than one place, especially Prelude entities. You'd have a table on almost every single page listing Bool, Maybe, Int, etc. But surely in many cases, it would be possible

Re: Problem with DB and Char size

2005-01-27 Thread Ketil Malde
Santoemma Enrico [EMAIL PROTECTED] writes: The problem is: Oracle ODBC driver expects, at least under Windows, UCS-2 strings. Then, if the DB is set to UTF-8, it converts the string into UTF-8. I'm using HSQL to access ODBC. Isn't UCS-2 the old 16-bit Unicode representation? So that

Re: [ ghc-Feature Requests-1104381 ] Add wxHaskell link to homepage

2005-01-19 Thread Ketil Malde
Simon Marlow [EMAIL PROTECTED] writes: It's intentional, but it can be easily turned off. Do people want to see feature-requests, task-list entries and so forth on this mailing list, or should they be confined to, say, [EMAIL PROTECTED] I would vote to put them in a separate list. At least

Re: [ ghc-Feature Requests-1104381 ] Add wxHaskell link to homepage

2005-01-18 Thread Ketil Malde
I seem to be getting messages from Sourceforge from this mailing list. Is that an intended use for ghc-users? -kzm -- If I haven't seen further, it is by standing in the footprints of giants ___ Glasgow-haskell-users mailing list

Re: posting

2004-12-15 Thread Ketil Malde
Kenny Chamber [EMAIL PROTECTED] writes: How long after posting should it take for a message to appear on the list? It should be pretty fast, but some lists moderate posts by non-subscribers. Could this be your problem? For timing, we could look at your headers: Date: Thu, 16 Dec

Re: Double - CDouble, realToFrac doesn't work

2004-11-05 Thread Ketil Malde
With GHCi, I get: Prelude Ratio toRational (1.0/0) :: Ratio Integer

Re: constant space `minimum'

2004-09-10 Thread Ketil Malde
Serge D. Mechveliani [EMAIL PROTECTED] writes: The library functions like minimum, maximum, should perform in a constant space: probably, it is easy to write them his way. I haven't given it much thought, but it seems that the rather obvious: Prelude minimum [1..10^6] *** Exception:

GHC and MPTCs

2004-08-25 Thread Ketil Malde
Hi, I recently tried to do the following code: class VertexState s v where new_point :: s - v - v - v next_state :: s - s -- interleave :: (VertexState s a) = s - [a] - [a] - [a] interleave s (t:ts) (b:bs) = new_point s t b : interleave (next_state s) bs (t:ts)

Re: GHC and MPTCs

2004-08-25 Thread Ketil Malde
MR K P SCHUPKE [EMAIL PROTECTED] writes: Try type annotations: [slightly edited to keep the different s's differentiated] new_point (s0::s) t b : interleave (next_state s0::s) bs (t:ts) Hmm...I get: Inferred type is less polymorphic than expected Quantified type variable `s'

Re: Parallel

2004-06-14 Thread Ketil Malde
Simon Marlow [EMAIL PROTECTED] writes: For the GPH project, go here: http://www.macs.hw.ac.uk/~dsg/gph/ There's also a bit of information in: http://www.haskell.org/communities/05-2004/html/report.html#gph -kzm -- If I haven't seen further, it is by standing in the footprints of giants

Compiling data

2004-05-27 Thread Ketil Malde
Hi, I've recently tried to compile some data into my program, and suddenly I realize why people tend to complain about the speed of GHC. For a benchmark, I'd like to include a bit of data in the form of a list of integer matrices (i.e. [[[Int]]]). While I have about 1 of them, sized about

Re: Compiling data

2004-05-27 Thread Ketil Malde
Christian Maeder [EMAIL PROTECTED] writes: We have put a large list in double quotes and used read to convert the large literal string (too big for hugs, though) into the needed list. This reduced compile time drastically, but I don't know how the runtime changed. (Also errors can only occur

Re: checking for a working System.Console.Readline

2004-05-13 Thread Ketil Malde
| readline Since you mention readline - I have a rather tiny nit to pick: ghci happily completes filenames starting with ~ (indicating home directory), but file operations typically don't grok it. As I said, hardly an earth shattering show stopper, but a small wart that might be easy to remove?

Re: sizeFM type

2004-04-26 Thread Ketil Malde
David Roundy [EMAIL PROTECTED] writes: I'd say that rather than returning an Integer, we'd be better off just using a 64 bit Int on 64 platforms. | 7.19.2. GHC's interpretation of undefined behaviour in Haskell 98 | | This section documents GHC's take on various issues that are left |

Re: turn off let floating

2004-04-20 Thread Ketil Malde
Bernard James POPE [EMAIL PROTECTED] writes: Note each program was compiled with ghc 6.2 with -O2 on debian linux. : main = print $ loop 1 0 Isn't this going to be optimized away to a constant with -O2? -kzm -- If I haven't seen further, it is by standing in the

Haskell profiling and performance

2004-04-07 Thread Ketil Malde
Hi, Am I doing something wrong, or did profiling performance drop an order of magnitude with GHC 6.2? When I compile my program with '-prof -auto-all', it takes about ten times as long to run as it does without. I use -O2 in both cases, and run without any run-time profiling options switched

Re: Haskell performance

2004-03-18 Thread Ketil Malde
Sébastien Pierre [EMAIL PROTECTED] writes: I am currently evaluating different languages for implementing an application which will have to manipulate large graphs representing the structure of programs and their evolution. Speed is in fact a crucial criterium for the language choice. In my

Re: Haskell performance

2004-03-18 Thread Ketil Malde
MR K P SCHUPKE [EMAIL PROTECTED] writes: To do the equivalent of the C you could use: http://www.haskell.org/~simonmar/io/System.IO.html Is this documented anywhere? How do I use this? The Haddoc documentation is a bit sparse. This seems quite different from the System.IO module installed

Re: Haskell performance

2004-03-18 Thread Ketil Malde
Simon Marlow [EMAIL PROTECTED] writes: http://www.haskell.org/~simonmar/io/System.IO.html The difference is that the System.IO that comes with GHC is actually implemented, rather than just documented :-) Ah. Drat. You know, it really looks good, and I really could use efficient file

Re: Stack space overflow after optimization

2004-03-17 Thread Ketil Malde
Christian Maeder [EMAIL PROTECTED] writes: Stack space overflow: current size 1048576 bytes. Use `+RTS -Ksize' to increase it. only when translated with -O. Is it possible that the next release of ghc uses a higher stack size at least when the -O flag is set? (Only to reduce the

Re: optimization question

2004-02-22 Thread Ketil Malde
John Meacham [EMAIL PROTECTED] writes: The reason I ask is I am writing someting which will generate large case statements [over strings] and want to know if I should bother pre-optimizing it to [search tries]¹ I've no idea what compilers do, but one quick-and-dirty way to optimize this could

Re: How to write this correct...

2004-02-22 Thread Ketil Malde
[EMAIL PROTECTED] (Hans Nikolaus Beck) writes: type GLVertex = (GLfloat,GLfloat,GLfloat) toVertex :: GLVertex - Vertex3 GLfloat toVertex :: (a,a,a) - Vertex3 a Yes this works (the first variant). Thanks ! But I must say that I have problems to understand The problem is that you tried

Re: detecting memory size?

2004-01-30 Thread Ketil Malde
Joachim Durchholz [EMAIL PROTECTED] writes: What I really want is the amount of memory my application can allocate and excercise lively without causing thrashing. On my Linux computer, that amounts more or less to the installed, physical RAM, minus a bit, so I'll settle for that. :-) An

detecting memory size?

2004-01-29 Thread Ketil Malde
Hi, Is it possible to detect memory (i.e. RAM, not virtual memory) size from inside a Haskell program (so that I can keep my program from growing too large with consequent thrashing)? And if so, to what degree of portability? -kzm -- If I haven't seen further, it is by standing in the

Re: detecting memory size?

2004-01-29 Thread Ketil Malde
Glynn Clements [EMAIL PROTECTED] writes: What do you mean by memory size? How much RAM is installed in the system? The amount which the process is currently using? The amount which the OS might be willing to allocate to your process at any given point in time? Something else? My aplogies for

Re: detecting memory size?

2004-01-29 Thread Ketil Malde
Glynn Clements [EMAIL PROTECTED] writes: IIRC, getrlimit(RLIMIT_DATA) doesn't mean much on Linux, as it doesn't include memory which is added using mmap(..., MAP_ANON), which is used by glibc's malloc(). Also, getrlimit(RLIMIT_RSS) is probably more relevant for your purposes. I also got a

Re: Talking with the compiler

2004-01-18 Thread Ketil Malde
[EMAIL PROTECTED] (Hans Nikolaus Beck) writes: in order to build a programming environement, it would be nice to ask the GHC about symbols etc found in a given Haskell program. I suppose a programming environment could talk to GHCi (which provides commands like :type, :info, :browse to explore

Re: Working character by character in Haskell

2001-10-19 Thread Ketil Malde
Simon Marlow [EMAIL PROTECTED] writes: Well, in Haskell each character of the string takes 20 bytes: 12 bytes for the list cell, and 8 bytes for the character itself Why does a list cell consume as much as 12 bytes? Two pointers (data and next) and a 32-bit tag field, perhaps? And a 64-bit

Re: UniCode

2001-10-08 Thread Ketil Malde
Dylan Thurston [EMAIL PROTECTED] writes: Right. In Unicode, the concept of a character is not really so useful; After reading a bit about it, I'm certainly confused. Unicode/ISO-10646 contains a lot of things that aren'r really one character, e.g. ligatures. most functions that

Re: UniCode

2001-10-05 Thread Ketil Malde
Marcin 'Qrczak' Kowalczyk [EMAIL PROTECTED] writes: Fri, 5 Oct 2001 02:29:51 -0700 (PDT), Krasimir Angelov [EMAIL PROTECTED] pisze: Why Char is 32 bit. UniCode characters is 16 bit. No, Unicode characters have 21 bits (range U+..10). We've been through all this, of course, but

Re: enormous executable

2001-10-01 Thread Ketil Malde
Julian Seward (Intl Vendor) [EMAIL PROTECTED] writes: On Linux and probably most Unixes, the text and data segments of the executable are loaded page-by-page into memory on demand. So having a lot of unused junk in the executable doesn't necessarily increase the memory used, either real

Re: GC options. Reply

2001-08-07 Thread Ketil Malde
Simon Marlow [EMAIL PROTECTED] writes: Ok, I've done the following: - disabled the maximum heap - RTS options are taken from the GHCRTS environment variable in addition to the command line (the command line has precedence). (I haven't followed this debate closely, so I may be

Run time error message

2000-09-13 Thread Ketil Malde
Hi I've compiled a program with GHC, but when I run it, it runs to partial completion (i.e. I get some correct-looking output) and terminates with: Fail: Prelude.(!!): index too large Great. Is there any way I can work out where, exactly, the !! failed? I only use it with constants