Re: [GHC] #927: Type checker infers () instead of a

2006-10-09 Thread GHC
#927: Type checker infers () instead of a ---+ Reporter: guest | Owner: Type: bug | Status: new Priority: normal| Milestone: Component: Compiler |

Re: [GHC] #927: Type checker infers () instead of a

2006-10-09 Thread GHC
#927: Type checker infers () instead of a ---+ Reporter: guest | Owner: Type: bug | Status: closed Priority: normal| Milestone: Component: Compiler |

Re: [GHC] #921: Floating point with -O and -fasm is broken

2006-10-09 Thread GHC
#921: Floating point with -O and -fasm is broken -+-- Reporter: guest | Owner: igloo Type: bug | Status: new Priority: normal |

Re: [GHC] #925: Access to old variable via Template Haskell blows up ghci

2006-10-09 Thread GHC
#925: Access to old variable via Template Haskell blows up ghci ---+ Reporter: guest | Owner: Type: bug | Status: new Priority: low |

RE: [Haskell] Expecting more inlining for bit shifting

2006-10-09 Thread Simon Peyton-Jones
[Redirecting to GHC users.] Turns out that 'shift' is just too big to be inlined. (It's only called once, but you have exported it too.) You can see GHC's inlining decisions by saying -ddump-inlinings. To make GHC keener to inline, use an INLINE pragma, or increase the inlining size threshold

Re: UTF-8 decoding error

2006-10-09 Thread Christian Maeder
Duncan Coutts schrieb: On Fri, 2006-09-22 at 17:19 +0200, Christian Maeder wrote: A simple script for the pgmF command The only disadvantage is that the filename in error and warning messages is quite useless: I think you can fix this by pre-pending a {-# LINE #-} pragma in your script.

Keyword foreign

2006-10-09 Thread Christian Maeder
Could some add to the user guide at: http://www.haskell.org/ghc/docs/latest/html/users_guide/ghc-language-features.html#options-language that -ffi and -fffi is (currently) implied by -fglasgow-exts? (as stated in the flag reference) in the same way as it is stated under -fimplicit-params or -fth

RE: [Haskell] Expecting more inlining for bit shifting

2006-10-09 Thread roconnor
On Mon, 9 Oct 2006, Simon Peyton-Jones wrote: Turns out that 'shift' is just too big to be inlined. (It's only called once, but you have exported it too.) You can see GHC's inlining decisions by saying -ddump-inlinings. To make GHC keener to inline, use an INLINE pragma, or increase the

Re: Keyword foreign

2006-10-09 Thread Neil Mitchell
Hi Therefore the keyword foreign gets into scope by -fglasgow-exts. And maybe this word and others should be added to http://haskell.org/haskellwiki/Keywords, because forall is listed and only available with -fglasgow-exts? It's a wiki, so feel free. I set up the original version using the

Re: [Haskell] Expecting more inlining for bit shifting

2006-10-09 Thread Ian Lynagh
On Mon, Oct 09, 2006 at 10:33:47AM -0400, [EMAIL PROTECTED] wrote: On Mon, 9 Oct 2006, Simon Peyton-Jones wrote: Turns out that 'shift' is just too big to be inlined. (It's only called once, but you have exported it too.) You can see GHC's inlining decisions by saying -ddump-inlinings.

RE: [Haskell] Expecting more inlining for bit shifting

2006-10-09 Thread Simon Peyton-Jones
For small functions, GHC inlines them rather readily. For big functions GHC doesn't inline them. For medium-sized functions, GHC looks at the arguments; if they look interesting (e.g. are a constant) then it inlines the function. So the behaviour you want will happen for certain settings of

Re: UTF-8 decoding error

2006-10-09 Thread Duncan Coutts
On Mon, 2006-10-09 at 13:55 +0200, Christian Maeder wrote: Duncan Coutts schrieb: On Fri, 2006-09-22 at 17:19 +0200, Christian Maeder wrote: A simple script for the pgmF command The only disadvantage is that the filename in error and warning messages is quite useless: I think you

Re: [Haskell] Expecting more inlining for bit shifting

2006-10-09 Thread roconnor
Okay, when I force inlining for shift, (and I even need to do it for shiftR!) then the code is inlined in C. However this isn't the behaviour I want. Ideally the inlining should only happen when/because the second argument of shift is constant and the system knows that it can evaluate the case

Problem with ghc-6.5.20061008 on Mac OS X Intel

2006-10-09 Thread Deborah Goldsmith
Hi, I was able to build this release using the 20060915 Intel build that's available, on 10.4.8. ghci seems to work OK (except for Readline), but an attempt to compile gives: $ ghc example25.hs /usr/bin/ld: Undefined symbols: _mtlzm1zi0_ControlziMonadziState_evalStateT_closure

Re: Problem with ghc-6.5.20061008 on Mac OS X Intel

2006-10-09 Thread Deborah Goldsmith
Thanks, Spencer Janssen already set me straight. It was indeed the lack of --package mtl. I'm pretty sure I didn't have that before, but my memory could be faulty. Thanks again, Deborah On Oct 9, 2006, at 5:57 PM, Ian Lynagh wrote: On Mon, Oct 09, 2006 at 05:42:14PM -0700, Deborah

Re: Problem with ghc-6.5.20061008 on Mac OS X Intel

2006-10-09 Thread Aaron Tomb
Hi Deborah, The first thing that springs to mind is that the mtl library (which contains Control.Monad.State, the source of the link errors below) isn't included in the 20060915 binary distribution, though it should be easy to check it out and compile it separately. So, the question is,

Re: Problem with ghc-6.5.20061008 on Mac OS X Intel

2006-10-09 Thread Aaron Tomb
Strange. Should it really get to link time before it notices that you haven't used the necessary --package flags? I would have expected an error earlier on. Aaron On Oct 9, 2006, at 6:03 PM, Deborah Goldsmith wrote: Thanks, Spencer Janssen already set me straight. It was indeed the lack

[Haskell] BCS FACS Christmas Meeting, Teaching Formal Methods, 15 December 2006; papers deadline 20 October 2006

2006-10-09 Thread Clare Martin
REMINDER: deadline for submissions 20 October 2006 Proceedings will be published in BCS Electronic Workshops in Computing (eWiC) series -- Call for Contributions and Participation

[Haskell] Classes with no data type

2006-10-09 Thread Thomas Davie
Hi, I've met an interesting problem in terms of how to type a data structure and the functions that operate upon it. The problem centres around a single data type. This data type can be constructed in multiple ways using different functions, depending on the options the user specifies.

Re: [Haskell] Classes with no data type

2006-10-09 Thread Cale Gibbard
Use case to pattern match against the constructors of the datatype? This is assuming that you've made them explicit. If not, you'll at least want to extend your datatype with some information that allows you to determine what should be done with the values later. On 09/10/06, Thomas Davie [EMAIL

[Haskell] Haskell Weekly News: October 10, 2006

2006-10-09 Thread Donald Bruce Stewart
--- Haskell Weekly News http://haskell.org/haskellwiki/HWN Issue 44 - October 10, 2006 --- Welcome to issue 44 of HWN, a weekly newsletter covering

[Haskell-cafe] Bizarre garbage collection behaviour

2006-10-09 Thread Guillaume Theoret
I'm using Hugs98 for .NET and I'm running into some bizarre garbage collection issues. I hope I'm posting at the right spot. I didn't want to post this in Hugs bugs since I'm pretty new to Haskell and it's entirely possible I'm doing something a way I shouldn't. Back to the problem at hand. My

Re: [Haskell-cafe] Haskell performance (again)!

2006-10-09 Thread Yang
On 10/8/06, Udo Stenzel u.stenzel-at-web.de |haskell-cafe| ... wrote: Yang wrote: type Poly = [(Int,Int)] addPoly1 :: Poly - Poly - Poly addPoly1 p1@(p1h@(p1c,p1d):p1t) p2@(p2h@(p2c,p2d):p2t) | p1d == p2d = (p1c + p2c, p1d) : addPoly1 p1t p2t | p1d p2d = p1h : addPoly1 p1t p2 |

Re: [Haskell-cafe] Announce: Monad Transformer Tutorial

2006-10-09 Thread Tomasz Zielonka
On Fri, Oct 06, 2006 at 11:40:46AM +0200, Martin Grabmueller wrote: I hereby announce a small tutorial on using monad transformers. In contrast to others found on the web, it concentrates on using them, not on their implementation. I'd like to hear comments, suggestions, etc. about it! I

Re: [Haskell-cafe] Announce: Monad Transformer Tutorial

2006-10-09 Thread Tomasz Zielonka
An errata for my email: On Mon, Oct 09, 2006 at 09:44:47AM +0200, Tomasz Zielonka wrote: No let's get to nitpicking ;-) should be Now let's get to nitpicking ;-) * page 8, at about 85%: you say The state maintained in our example is a simple integer value, but it *can* be any data type

[Haskell-cafe] casting

2006-10-09 Thread Thomas Conway
Hi All I'm having some difficulty with typeclasses. What I'm trying to do should be obvious, but it's still giving me trouble. I want to take a packaged item, and strengthen the constraints on its type. Rather than being just any type that is an instance of A, I want to do a runtime check and

[Haskell-cafe] Re: casting

2006-10-09 Thread Thomas Conway
On 10/9/06, I wrote: So, can anyone suggest how I can achieve my goal? And how many milliolegs of type hackery will it take? ;-) Tom ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] casting

2006-10-09 Thread Misha Aizatulin
Thomas Conway wrote: I'm having some difficulty with typeclasses. What I'm trying to do should be obvious, but it's still giving me trouble. I want to take a packaged item, and strengthen the constraints on its type. Rather than being just any type that is an instance of A, I want to do a

[Haskell-cafe] Vertical tabs in source code and other obscure chars

2006-10-09 Thread Brian Hulley
Hi, In the Haskell98 report at http://haskell.org/onlinereport/lexemes.html section 2.2 has the rule: whitechar - newline | vertab | space | tab | uniWhite Does anyone know what a vertical tab is supposed to do? Is there any reason to allow them as whitespace? (Does anyone in the universe

Re: [Haskell-cafe] Re: Haskell performance (again)!

2006-10-09 Thread Cale Gibbard
On 09/10/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Cale Gibbard wrote: I might also like to point out that by small and large, we're actually referring to the number of ways in which components of the datastructure can be computed separately, which tends to correspond nicely to how one

Re: [Haskell-cafe] casting

2006-10-09 Thread Thomas Conway
Thanks Misha Matthias. I now get what's going on. The mention of the word dictionary revealed it all. I've spent the last 7 years programming in C++, and had dynamic_cast firmly fixed in my head. I totally forgot that Fergus Henderson and I independently reinvented dictionary passing for the

Re: [Haskell-cafe] Vertical tabs in source code and other obscure chars

2006-10-09 Thread Thomas Conway
Mostly hysterical raisins, I think. T. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Strictness, order of IO operations: NewCGI HDBC

2006-10-09 Thread Tim Smith
Hello, Haskell Cafe. I posted a question a while ago about this, but didn't receive any responses. I'd like to try again. I've got a test case which uses John Goerzen's HDBC.ODBC. The problem I have is that it appears too lazy - using the results of a query after disconnecting causes an

[Haskell-cafe] Re: Strictness, order of IO operations: NewCGI HDBC

2006-10-09 Thread John Goerzen
On Mon, Oct 09, 2006 at 04:01:02PM -0600, Tim Smith wrote: main = do dbh - connectODBC DSN=test res - DB.getTables dbh -- print (show ((concat . intersperse , ) res)) DB.disconnect dbh print (show ((concat . intersperse , ) res)) Am I just expecting the wrong thing from

Re: [Haskell-cafe] Haskell performance (again)!

2006-10-09 Thread Lennart Augustsson
I think your first try looks good. The only thing to worry about would be the + being too lazy. But that's easy to fix at the same time as improving your code in another respect. It's usually good to use real types instead of synonyms, so let's do that. data Nom = Nom Int Int type

[Haskell-cafe] a monad for secret information

2006-10-09 Thread Seth Gordon
I finally (think I) understand monads well enough to make one up: module Secret (Secret, classify, declassify) where data Secret a = Secret a classify :: a - Secret a classify x = Secret x declassify :: Secret a - String - Maybe a declassify (Secret x) xyzzy = Just x declassify (Secret x) _

[Haskell-cafe] Re: How would you replace a field in a CSV file?

2006-10-09 Thread John Goerzen
On 2006-10-01, Pete Kazmier [EMAIL PROTECTED] wrote: For those that know python, here is a very simple implementation that happens to be very fast compared to my Haskell version and very short: for line in sys.stdin: fields = line.split(',') Of course, this doesn't handle quoted

Re: [Haskell-cafe] a monad for secret information

2006-10-09 Thread Cale Gibbard
On 09/10/06, Seth Gordon [EMAIL PROTECTED] wrote: I finally (think I) understand monads well enough to make one up: module Secret (Secret, classify, declassify) where data Secret a = Secret a classify :: a - Secret a classify x = Secret x declassify :: Secret a - String - Maybe a

Re: [Haskell-cafe] Haskell performance (again)!

2006-10-09 Thread Brian Hulley
Lennart Augustsson wrote: I think your first try looks good. [snip] ... addPoly1 p1@(p1h@(Nom p1c p1d):p1t) p2@(p2h@(Nom p2c p2d):p2t) | p1d == p2d = Nom (p1c + p2c) p1d : addPoly1 p1t p2t | p1d p2d = p1h : addPoly1 p1t p2 | p1d p2d = p2h : addPoly1 p1 p2t ... The last comparison