Re: [GHC] #820: problem compiling a file with top level Template Haskell splice

2006-07-20 Thread GHC
#820: problem compiling a file with top level Template Haskell splice ---+ Reporter: guest | Owner: Type: bug | Status: new Priority: normal

Re: [GHC] #826: Optimization breaks strictness with IO

2006-07-20 Thread GHC
#826: Optimization breaks strictness with IO -+-- Reporter: [EMAIL PROTECTED] | Owner: Type: bug | Status: closed Priority: normal | Milestone:

Re: [GHC] #457: Strictness problem

2006-07-20 Thread GHC
#457: Strictness problem -+-- Reporter: nilsanders | Owner: simonpj Type: bug | Status: new Priority: normal | Milestone: Component: Compiler|

[GHC] #830: Compiler performance bug: large do expression

2006-07-20 Thread GHC
#830: Compiler performance bug: large do expression -+-- Reporter: simonmar |Owner: Type: bug | Status: new Priority: normal|Milestone: Component:

Re: [GHC] #830: Compiler performance bug: large do expression

2006-07-20 Thread GHC
#830: Compiler performance bug: large do expression ---+ Reporter: simonmar | Owner: Type: bug | Status: new Priority: normal| Milestone: Component:

[GHC] #831: GHCi user interface bug

2006-07-20 Thread GHC
#831: GHCi user interface bug +--- Reporter: guest|Owner: Type: bug | Status: new Priority: low |Milestone: Component: GHCi | Version:

Re: [GHC] #831: GHCi user interface bug

2006-07-20 Thread GHC
#831: GHCi user interface bug --+- Reporter: guest| Owner: Type: bug | Status: new Priority: low | Milestone: Component: GHCi |Version:

[GHC] #832: fermat numbers make the baby jesus cry.

2006-07-20 Thread GHC
#832: fermat numbers make the baby jesus cry. ---+ Reporter: [EMAIL PROTECTED] |Owner: Type: bug | Status: new Priority: normal |

regression: RULES not matching

2006-07-20 Thread Duncan Coutts
Hi Simon, I think some recent patch has made some of my fusion rules stop matching. the test case is: foo = B.map (+1) . B.filter (/=0) with ghc 6.4.2 and with older versions of ghc-6.5 (May 26th): 5 RuleFired 2 int2Word# 2 narrow8Word# 1 strTransformerBi/strTransformerBi with

Re: regression: RULES not matching

2006-07-20 Thread Duncan Coutts
On Wed, 2006-07-19 at 20:24 +0100, Duncan Coutts wrote: with my recent ghc 6.5 (Jul 24th) that strTransformer rule no longer fires. Sorry, that should have read July the 4th, not 24th! Duncan ___ Glasgow-haskell-bugs mailing list

Bug in GHC 6.4.1 and 6.4.2

2006-07-20 Thread Fritz Henglein
According to a message from GHCi, version 6.4.1 (see below; bug also reproduceable with 6.4.2, though not shown here since it consistently resulted in a core dump without prior message) under Windows XP (fully updated per 2006-07-15), I am herewith reporting what appears to be a bug in GHC.

Bug in users manual, 6.4.2, section on pattern guards

2006-07-20 Thread Matthew Cox
One example given in this discussion is: clunky env var1 var1 = case lookup env var1 of Nothing - fail Just val1 - case lookup env var2 of Nothing - fail Just val2 - val1 + val2 where fail = val1 + val2 this needs to be fixed to: clunky env var1 var1 = case lookup env var1 of

compiler crash under MacOS X

2006-07-20 Thread Joerg van den Hoff
hi, my very first tries with ghc, using the 'program' module Fact where fact :: Integer - Integer fact n = product [1..n] gave the following compiler crash under MacOS X 10.4.7 (ghc installed from source via DarwinPorts): Compiling Fact ( fact.hs, interpreted ) ghc-6.4.2:

Re: compiler crash under MacOS X

2006-07-20 Thread Gregory Wright
Hi Joerg, This problem is almost certainly bug #751. This gives a compiler crash if the threaded run time system is used. The latest darwinports ghc (which I maintain) builds the run time without threads. What is the output of sudo port info ghc ? If you do not have revision 2 of the 6.4.2

Re: Text.Regex.Posix regcomp

2006-07-20 Thread Bulat Ziganshin
Hello Rich, Tuesday, July 18, 2006, 11:47:58 PM, you wrote: I have a server application that I am building using GHC 6.4 (yes, an update to 6.4.2 is on the horizon, but not in the immediate future - unless it fixes this problem :) ) under 6.4.2 (or better a current stable build) fixes a lot

Re: Recompiling the darcs tree after a pull

2006-07-20 Thread Simon Marlow
Joel Reymont wrote: What I usually do is build GHC from darcs and make-install it. I then do a darcs pull and use the previously built compiler to bootstrap. I guess this is not optimal and I should just use the last stable GHC to recompile the darcs tree. Yes, that isn't a supported

Re: Recompiling the darcs tree after a pull

2006-07-20 Thread Simon Marlow
Joel Reymont wrote: I get a lot of errors like this: utils/Panic.lhs:27:0: Failed to load interface for `Config': Bad interface file: stage1/main/Config.hi mismatched interface file versions: expected 6050, found 390518464 Do you guys always clean after a pull or is

Re: Possible memory leak?

2006-07-20 Thread Simon Marlow
Chris Kuklewicz wrote: I was working on pulling library calling code from JRegex into Text.Regex.Lazy and I am wondering if this code for compiling regex.h regular expressions is a potential memory leak: regcomp pattern flags = do regex_fptr - mallocForeignPtrBytes (#const sizeof(regex_t))

loop problems

2006-07-20 Thread Chad Scherrer
Hi, I have some code that just says loop when it's run. I found a FAQ that says something about finalizers, but I'm not using those (at least not consciously). Here is my main: import qualified Data.ByteString.Lazy.Char8 as L main = do ls - liftM L.lines $ L.readFile output.txt mapM_

Re: loop problems

2006-07-20 Thread Neil Mitchell
Hi, I have some code that just says loop This behaviour is also caused by black holes, for example: main = let x = x + 5 in print x gives this same error. Note that the value of x depends on the value of x. Hence you get a circular problem, which would non-terminate, but the compiler can

Re: loop problems

2006-07-20 Thread Chad Scherrer
Yep, it was buried in the matrix inversion. Thanks! On 7/20/06, Neil Mitchell [EMAIL PROTECTED] wrote: Hi, I have some code that just says loop This behaviour is also caused by black holes, for example: main = let x = x + 5 in print x gives this same error. Note that the value of x

Heap Profiling Question

2006-07-20 Thread Rich Fought
I'm trying to use heap profiling with +RTS -hc -i1 options and running my program for about 30 seconds. However, I only get around 7 samples with seemingly bogus timetags (i.e. 0.00, 3.69, 3.73, 3.10, 4.05, 4.12). What's going on? I'm running GHC 6.4.2 on Windows (MSYS/MinGW). Thanks, Rich

Re: Text.Regex.Posix regcomp

2006-07-20 Thread Rich Fought
Thanks, upgrading to 6.4.2 seems to have done the trick. I've obviously put it off too long! Rich ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

[Haskell] CFP: IEEE/WIC/ACM WI-IAT'06 Workshops

2006-07-20 Thread Jia Hu
[Apologies if you receive this more than once] == Call for Workshop Papers 2006 IEEE/WIC/ACM International Joint Conference on Web Intelligence and Intelligent Agent Technology (WI-IAT'06) Hong Kong Convention and Exhibition Centre,

[Haskell] CFP: IEEE ICDM'06 Workshops

2006-07-20 Thread Jia Hu
[Apologies if you receive this more than once] == Call for Workshop Papers ICDM'06: The 6th IEEE International Conference on Data Mining Hong Kong Convention and Exhibition Centre, Hong Kong, China, 18-22 December 2006 Sponsored

Re: [Haskell] semantice of seq

2006-07-20 Thread roconnor
On Tue, 18 Jul 2006, Duncan Coutts wrote: On Tue, 2006-07-18 at 09:44 -0400, [EMAIL PROTECTED] wrote: Would the problematic semantics of seq be resolved if seq did nothing on function types? That is to say seq (\x - undefined `asTypeOf` x) y reduced to y and seq (undefined `asTypeOf` id) y

Re: [Haskell] semantice of seq

2006-07-20 Thread Duncan Coutts
On Wed, 2006-07-19 at 08:09 -0400, [EMAIL PROTECTED] wrote: On Tue, 18 Jul 2006, Duncan Coutts wrote: On Tue, 2006-07-18 at 09:44 -0400, [EMAIL PROTECTED] wrote: Would the problematic semantics of seq be resolved if seq did nothing on function types? That is to say seq (\x -

Re: [Haskell] semantice of seq

2006-07-20 Thread roconnor
On Wed, 19 Jul 2006, Duncan Coutts wrote: Ah ok, I misunderstood. Well that'd be a bit odd too. No other function behaves differently on different types except by use of type classes. I agree it is quite odd, but the seq we have is already quite odd. Furthermore, the fact is that seq on

Re: [Haskell] semantice of seq

2006-07-20 Thread voigt . 16734551
--- [EMAIL PROTECTED] wrote: Do you have an example of use of seq on a function type? (Of course I don't want to ban it, just change its behaviour.) I don't have any wisdom to offer on how we would want to ban or change the behavior of seq on a function type without using type classes. Nor

[Haskell] using the ffi with callbacks

2006-07-20 Thread Evan Martin
Suppose I have a C function like this: void register_callback( void (*callback_fcn)(void *data), void *callback_data, void (*free_fcn)(void *data)); I think this is pretty common in C libraries. The idea is that you can register a callback along with a pointer to some data to pass to

[Haskell] Re: using the ffi with callbacks

2006-07-20 Thread Simon Marlow
Evan Martin wrote: Suppose I have a C function like this: void register_callback( void (*callback_fcn)(void *data), void *callback_data, void (*free_fcn)(void *data)); I think this is pretty common in C libraries. The idea is that you can register a callback along with a pointer to

[Haskell] rigid variables

2006-07-20 Thread Rodney D Price
I've gotten this sort of error several times, which mysteriously disappears when I add more functions to the code: storeError.hs:13:38: Couldn't match expected type `a' (a rigid variable) against inferred type `String' `a' is bound by the type signature for `throwError'

Re: [Haskell] rigid variables

2006-07-20 Thread David Roundy
On Thu, Jul 20, 2006 at 10:48:02AM -0600, Rodney D Price wrote: I've gotten this sort of error several times, which mysteriously disappears when I add more functions to the code: storeError.hs:13:38: Couldn't match expected type `a' (a rigid variable) against inferred

Re: [Haskell] using the ffi with callbacks

2006-07-20 Thread Taral
On 7/20/06, Evan Martin [EMAIL PROTECTED] wrote: The tricky part is that to pass in Haskell functions, I need to use the FFI wrapper import, which means I need to later free them. But the only place I can free them is within the free callback, and I've just discovered this isn't allowed!

Re: [Haskell] using the ffi with callbacks

2006-07-20 Thread Anatoly Zaretsky
On 7/20/06, Evan Martin [EMAIL PROTECTED] wrote: To elaborate, the code setting this up looks something like this: callback_fcn - ... -- get a FunPtr using wrapper from the ffi free_fcn - ... -- as above -- the callback data is just stuff that needs freeing callback_data - newStablePtr

Re: [Haskell] using the ffi with callbacks

2006-07-20 Thread Evan Martin
On 7/21/06, Taral [EMAIL PROTECTED] wrote: On 7/20/06, Evan Martin [EMAIL PROTECTED] wrote: The tricky part is that to pass in Haskell functions, I need to use the FFI wrapper import, which means I need to later free them. But the only place I can free them is within the free callback, and

[Haskell-cafe] Type level logic programming terminology

2006-07-20 Thread oleg
Most systems of (first-order) logic differentiate between function letters (aka, symbols) and predicate letters (symbols). The former are used to build terms; the latter build atomic formulas (which can later be combined in more complex formulas using negation, conjunction, disjunction, and

Re: [Haskell-cafe] RE: ANN: System.FilePath 0.9

2006-07-20 Thread Neil Mitchell
Hi I want to make sure a filename is valid. For example, prn and con This is another rat's nest, so I suggest that it be dealt with separately from the basic filepath module. The notion of valid is squishy: It depends entirely on what you intend to do with the path. Its a rats nest to do

Re[2]: [Haskell-cafe] Re: Type-Level Naturals Like Prolog?

2006-07-20 Thread Bulat Ziganshin
Hello Jared, Tuesday, July 18, 2006, 11:12:09 PM, you wrote: % defining natural numbers natural(zero). natural(s(X)) :- natural(X). % translate to integers toInt(zero, 0). toInt(s(X), N) :- toInt(X, Y), N is Y + 1. Thank you. I can now more precisely state that what I'm trying

Re: [Haskell-cafe] Re: Type-Level Naturals Like Prolog?

2006-07-20 Thread Tom Schrijvers
On Tue, 18 Jul 2006, Jared Warren wrote: % defining natural numbers natural(zero). natural(s(X)) :- natural(X). % translate to integers toInt(zero, 0). toInt(s(X), N) :- toInt(X, Y), N is Y + 1. Thank you. I can now more precisely state that what I'm trying to figure out is: what is

[Haskell-cafe] irc channel stats

2006-07-20 Thread Donald Bruce Stewart
While we're in a period of reflection, pondering the history of haskell, I've prepared some graphs of activity on the IRC channel. Summary: its growing much as the mailing lists are, with more than 5000 users over the past 5 years. Full details here, http://www.cse.unsw.edu.au/~dons/irc/

[Haskell-cafe] Re: Compiling ghc for using STM

2006-07-20 Thread Simon Marlow
Duncan Coutts wrote: I believe that the smp flavour of the RTS is now built by default and so all you need to do is use it when linking a program: ghc-6.5 -smp Foo.hs -o foo Yes, although -smp is now the same as -threaded, so for simplicity we'll stop referring to -smp and just use

Re: [Haskell-cafe] RE: ANN: System.FilePath 0.9

2006-07-20 Thread Neil Mitchell
Hi, In this library proposal, there are a bunch of xxxDrive functions .. [remove them] I strongly agree about this. I have decided you are right, on Windows getDrive x can be written simply as: getDrive x | isRelative x = | otherwise = head (getDirectories x) And given that

[Haskell-cafe] trace function

2006-07-20 Thread Alexander Vodomerov
Hello! The function trace is supposed to write debug messages to console. However, when I trying to run the following program import Debug.Trace main = do putStrLn xxx return (trace yyy ()) putStrLn zzz only xxx and zzz is displayed. yyy is missing. Why trace is not working? PS.

[Haskell-cafe] Opening a file that another process is writing

2006-07-20 Thread Maurício
Hi, I want to open for reading a log file that another process is locking for write. I know it's possible, since 'cat' and 'vim' can read that file (but not edit it, of course). How can I do that in Haskell? 'openFile' says permission denied. Thanks, Maurício

[Haskell-cafe] trace function

2006-07-20 Thread tpledger
Alexander Vodomerov wrote: import Debug.Trace main = do putStrLn xxx return (trace yyy ()) putStrLn zzz only xxx and zzz is displayed. yyy is missing. Why trace is not working? Nothing uses the value of (trace yyy ()), so it is never evaluated. Try this instead, which uses the

[Haskell-cafe] REALLY simple STRef examples

2006-07-20 Thread Chad Scherrer
I've looked around at the various STRef examples out there, but still nothing I write myself using this will work. I'm trying to figure out how the s is escaping in really simple examples like x = runST $ return 1 y = runST $ do {r - newSTRef 1; readSTRef r} Neither of these works in ghci -

[Haskell-cafe] REALLY simple STRef examples

2006-07-20 Thread tpledger
Chad Scherrer wrote: x = runST $ return 1 y = runST $ do {r - newSTRef 1; readSTRef r} Neither of these works in ghci x = runST (return 1) y = runST (do {r - newSTRef 1; readSTRef r}) The escaping s is something to do with rank 2 polymorphism. (Search for rank in the ghc user guide, for

[Haskell-cafe] problems with receiving mail lists

2006-07-20 Thread Bulat Ziganshin
Hello Simon, Simon, you are administrator of many haskell mail lists, so i wrote to you. last day i don't receive messages in these mail lists. investigating the problem, i found on haskell-cafe subscription page that there are some problems in mail delivery to my address. i'm not 100% sure but i

Re: [Haskell-cafe] The History of Haskell

2006-07-20 Thread Maarten Hazewinkel
Simon and partners, Thank you for this paper. As a relative newcomer to Haskell, quite few topics on the mailing lists went right past me. Now that I've read this paper a can at least understand generally what most topics are about. I'd definitely recommend this as reading material to anyone

[Haskell-cafe] test message

2006-07-20 Thread Simon Marlow
Trying to diagnose problems with mailing lists... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] RE: problems with receiving mail lists

2006-07-20 Thread Simon Marlow
Apparently Mailman was stuck, I've restarted it and it seems to be working again. Noone's account has been disabled, as far as I can tell. Cheers, Simon On 20 July 2006 06:18, Bulat Ziganshin wrote: Hello Simon, Simon, you are administrator of many haskell mail lists, so i wrote to

Re: [Haskell-cafe] Opening a file that another process is writing

2006-07-20 Thread Bulat Ziganshin
Hello Maurício, Thursday, July 20, 2006, 1:22:01 AM, you wrote: I want to open for reading a log file that another process is locking for write. I know it's possible, since 'cat' and 'vim' can read that file (but not edit it, of course). How can I do that in Haskell? 'openFile' says

Re: [Haskell-cafe] trace function

2006-07-20 Thread Neil Mitchell
Hi, Either one of these will work: main = do putStrLn xxx x - return (trace yyy ()) x `seq` putStrLn zzz main = do putStrLn xxx trace yyy (return ()) putStrLn zzz This works fine, the problem is that trace is defined to output the first parameter before returning the second. In the case of

Re: [Haskell-cafe] trace function

2006-07-20 Thread Malcolm Wallace
Alexander Vodomerov [EMAIL PROTECTED] wrote: main = do putStrLn xxx return (trace yyy ()) putStrLn zzz only xxx and zzz is displayed. yyy is missing. This is because you never demanded the value of (trace yyy ()), so it was never computed. The joys of laziness! To force its

Re: [Haskell-cafe] REALLY simple STRef examples

2006-07-20 Thread Chad Scherrer
Whoa. That changes everything I thought I knew about ($). Come to think of it, one of the examples that does work it written main = print $ runST f where f is defined separtely. So that's consistent. I'll take a look at the references. Thanks! Indeed. The short answer: use runST (long

Re: [Haskell-cafe] Re: Why is there no splitBy in the list module?

2006-07-20 Thread Jon Fairbairn
On 2006-07-13 at 10:16BST I wrote: Hooray! I've been waiting to ask Why aren't we asking what laws hold for these operations? Having thought about this for a bit, I've come up with the below. This is intended to give the general idea -- it's not polished code, and I'm not at all wedded to the

Re: [Haskell-cafe] REALLY simple STRef examples

2006-07-20 Thread Chad Scherrer
Hi, The short answer: use runST (long expression) rather than runST $ long expression when it comes to higher-ranked functions such as runST. I suppose the same holds for runSTUArray, right? But this still gives me that same error, about being less polymorphic than expected.

Re[2]: [Haskell-cafe] REALLY simple STRef examples

2006-07-20 Thread Bulat Ziganshin
Hello Chad, Thursday, July 20, 2006, 9:38:43 PM, you wrote: I suppose the same holds for runSTUArray, right? But this still gives me that same error, about being less polymorphic than expected. there is well-known problem with that _unboxed_ arrays aren't polymorphic. Oleg Kiselyov proposed

Re: Re[2]: [Haskell-cafe] REALLY simple STRef examples

2006-07-20 Thread Chad Scherrer
Ok, I see now why the return is necessary. For now I'll switch to boxed arrays until I get the rest of this down better. But why should this... sumArrays [] = error Can't apply sumArrays to an empty list sumArrays (x:xs) = runSTArray (result x) where result x = do x0 - thaw x

Re: [Haskell-cafe] doubt on gui

2006-07-20 Thread Duncan Coutts
On Thu, 2006-07-20 at 18:09 +0300, Alvaro Galan wrote: Hi, im almost new in haskell world, but im trying to do a simple graphical interface for a small program, i developed the program under winhugs, and now i want to develop the gui also with it, but all the libraries and kits that i download

Re: Re[2]: [Haskell-cafe] REALLY simple STRef examples

2006-07-20 Thread Udo Stenzel
Chad Scherrer wrote: But why should this... sumArrays [] = error Can't apply sumArrays to an empty list sumArrays (x:xs) = runSTArray (result x) where result x = do x0 - thaw x mapM_ (x0 +=) xs return x0 work differently than this...

RE: Re[2]: [Haskell-cafe] REALLY simple STRef examples

2006-07-20 Thread Simon Peyton-Jones
| ps: you successfully going through all the standard Haskell troubles in | this area :) seems that making FAQ about using ST monad will be a | good idea :) Indeed. If someone would like to start one, a good place for it would be GHC's collaborative-documentation Wiki

Re[4]: [Haskell-cafe] REALLY simple STRef examples

2006-07-20 Thread Bulat Ziganshin
Hello Simon, Friday, July 21, 2006, 7:46:15 AM, you wrote: | ps: you successfully going through all the standard Haskell troubles in | this area :) seems that making FAQ about using ST monad will be a | good idea :) Indeed. If someone would like to start one, a good place for it would be