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

2005-11-08 Thread Bulat Ziganshin
Hello Rene, Sunday, November 06, 2005, 10:35:48 PM, you wrote: RdV I suggest that the code in GHC.Arr be changed from RdV error Error in array index RdV to RdV error Error in array index ++ show b ++ show i one time i complained the close problem SPJ answered me: | also it will be cool to

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

2005-11-08 Thread John Meacham
jhc has a SRCLOC_ANNOTATE pragma to solve just this problem here is the relevant part of the docs: * SRCLOC_ANNOTATE pragma. This is a generalization of GHCs assert magic. A function which is given an SRCLOC_ANNOTATE pragma will be replaced with an alternate version that takes the

Proposal: Improved error message of Error in array index

2005-11-08 Thread Rene de Visser
One idea that occurred to us recently is this: GHCi could provide a simplified version of the cost-centre-stack machinery *all the time*, Simon This still doesn't explain to me why C:\Haskell\devmain +RTS -xc gave GHC.Arr.CAFmain: Error in array index (This is with full profiling

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

2005-11-08 Thread Simon Marlow
On 08 November 2005 12:09, Rene de Visser wrote: One idea that occurred to us recently is this: GHCi could provide a simplified version of the cost-centre-stack machinery *all the time*, Simon This still doesn't explain to me why C:\Haskell\devmain +RTS -xc gave GHC.Arr.CAFmain:

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

2005-11-08 Thread Tomasz Zielonka
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 trick I saw in darcs' code to make

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

2005-11-08 Thread John Meacham
On Tue, Nov 08, 2005 at 11:12:09AM -, Simon Marlow wrote: Nice - though it would be even better to provide the required functionality automatically. I am not sure that is the case. I think library authors would be better suited to provide meaningful error messages and decide when

[Haskell] Haskell Weekly News: November 8, 2005

2005-11-08 Thread John Goerzen
Haskell Weekly News: November 8, 2005 Greetings, and thanks for reading the 14th issue of HWN, a weekly newsletter for the Haskell community. Each Tuesday, new editions will be posted (as text) to [1]the Haskell mailing list and (as HTML) to [2]The Haskell

Re: [Haskell-cafe] \Parsec\Token.hs

2005-11-08 Thread Bernard Pope
On Mon, 2005-11-07 at 21:32 -0500, Sara Kenedy wrote: Dear all, I run file Token.hs in hugs98\libraries\Text\ParserCombinator\Parsec\Token.hs, but it displays this error ERROR : 64 - Syntax error in data type definition (unexpected '.') Anyone know how to fix this? Thanks. The problem

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

2005-11-08 Thread Jan-Willem Maessen
On Nov 7, 2005, at 9:02 AM, Bulat Ziganshin wrote: ...Simon, can you please write some docs about all these foreign stuff and their interaction with pure Haskell code? i see some bits of this information in these newsgroups regularly (for example, are you remember discussion about using lots of

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

2005-11-08 Thread Sebastian Sylvan
On 11/8/05, Jan-Willem Maessen [EMAIL PROTECTED] wrote: On Nov 7, 2005, at 9:02 AM, Bulat Ziganshin wrote: ...Simon, can you please write some docs about all these foreign stuff and their interaction with pure Haskell code? i see some bits of this information in these newsgroups regularly

[Haskell-cafe] Inferred type less polymorphic than expected

2005-11-08 Thread Joel Reymont
Folks, How do I fix this? data Prop = forall a b.(Eq a, Show a) = Attr a := a data Attr a = Attr String (a - Dynamic, Dynamic - Maybe a) (PU a) type Props = M.Map String (Int, Prop) instance Ord (Int, Prop) where compare (a, _) (b, _) | a == b = EQ | a b = GT

Re: [Haskell-cafe] Inferred type less polymorphic than expected

2005-11-08 Thread Joel Reymont
This gets me pretty close. I now have to figure out how to return a PU Props instead of a PU [Prop] which is what it's returning. Still, it's a huge step forward. props :: Props - PU Props props m = props' $ sort $ M.toList m where props' [] = lift [] props' ((_, (_, x)):xs) =

Re: [Haskell-cafe] Inferred type less polymorphic than expected

2005-11-08 Thread Udo Stenzel
Joel Reymont wrote: Folks, How do I fix this? data Prop = forall a b.(Eq a, Show a) = Attr a := a data Attr a = Attr String (a - Dynamic, Dynamic - Maybe a) (PU a) type Props = M.Map String (Int, Prop) instance Ord (Int, Prop) where compare (a, _) (b, _) | a

Re: [Haskell-cafe] Inferred type less polymorphic than expected

2005-11-08 Thread Joel Reymont
The road to hell is paved with good intentions. I sold this to the client as a simple scripting language and I have to deliver now, lest I loose my credibility. This were working quite well ... except the program is spending 50% of the time collecting garbage and is shuffling a few Gb of

[Haskell-cafe] Request for subject suggestions for a series of informal top 10 Haskell articles

2005-11-08 Thread Kenneth Hoste
Greetings, As you all might know, the Haskell community has it's own informal magazine, The Monad.Reader (http://haskell.org/tmrwiki). I'm planning to write (with some support from the frequent users of #haskell @ irc.freenode.net) a series of articles for TMR, which describe some aspect of

[Haskell-cafe] Parameterizing on type

2005-11-08 Thread Joel Reymont
Folks, How can I create a generic pickler that's parameterized on type and constructor? I define types like this: newtype AvgPot = AvgPot Word64 deriving (Show, Typeable) newtype NumberOfPlayers = NumberOfPlayers Word16 deriving (Show, Typeable) and then have a lot of boiler-plate code