Re: Cabals' Paths_pkg and GHCi

2006-11-14 Thread Simon Marlow
Vyacheslav Akhmechet wrote: Hi, I took advantage of Cabal's data-files feature to allow me to portably store and access data files. Cabal generated a Paths_pkg module that I imported. From Cabal's point of view everything works: I can configure, build, install, and run. However, I can no longer

Re: -xc

2006-11-14 Thread Simon Marlow
Serge D. Mechveliani wrote: Simon P. Jones wrote today about the -xc option to help with finding who called fromJust Noting. Now, I see in the GHC Guide: -- -xs (Only available when the program is compiled for profiling.)

GHC submission guidelines

2006-11-14 Thread Simon Marlow
Dear GHC folks, We (well, mostly SimonPJ) have written down a set of guidelines for contributing to GHC on the wiki: http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions If you're interested in contributing, please take a look. The requirements are mostly common sense and not too

Re: RTS -I switch

2006-11-14 Thread Simon Marlow
Bulat Ziganshin wrote: Hello glasgow-haskell-users, i still forget to ask: if my program is idle during long time, is GC will occur each 0.3 seconds or GHC is smart enough to check that no much memory was allocated after last GC? You'll only get one GC. Or at least that's the theory: I

Re: fromJust Nothing problem

2006-11-14 Thread Jon Fairbairn
On 2006-11-14 at 13:57+0300 Serge D. Mechveliani wrote: Thanks to people who discussed the question of who said `fromJust Nothing' and -xc option. My last impression is that instead of using -xc it is better to write programs in a debug-friendly style. For example, let g x must

fromJust Nothing problem

2006-11-14 Thread Serge D. Mechveliani
Thanks to people who discussed the question of who said `fromJust Nothing' and -xc option. My last impression is that instead of using -xc it is better to write programs in a debug-friendly style. For example, let g x must return (Just _), but the programmer is not 100% sure that g x

Re: Cabals' Paths_pkg and GHCi

2006-11-14 Thread Claus Reinke
The Paths_foo.hs file is generated in a separate directory, something like dist/autogen/ (I can't remember exactly, you should be able to find it). To get GHCi to find it, you'll need to pass an appropriate -i dir flag. a general question about cabal and ghci: if I have successfully loaded

locating fromJust Nothing

2006-11-14 Thread Serge D. Mechveliani
More about finding the source of fromJust Nothing. For g n = fromJust $ f n, ghc-6.6 often looses the reference to f in its run-time error report -- when f returns Nothing. And this is difficult to locate the source. But one could write g n = let

Re: fromJust Nothing problem

2006-11-14 Thread Serge D. Mechveliani
On Tue, Nov 14, 2006 at 12:08:07PM +, Jon Fairbairn wrote: [..] My last impression is that instead of using -xc it is better to write programs in a debug-friendly style. For example, let g x must return (Just _), but the programmer is not 100% sure that g x is free of bugs.

Re: fromJust Nothing problem

2006-11-14 Thread Neil Mitchell
Hi My last impression is that instead of using -xc it is better to write programs in a debug-friendly style. For example, let g x must return (Just _), but the programmer is not 100% sure that g x is free of bugs. Then, instead of f x = h $ fromJust $ g x one

RE: fromJust Nothing problem

2006-11-14 Thread Simon Peyton-Jones
Both of these messages (from Neil and Serge) suggest use debugging ideas. Would anyone like to add them to http://haskell.org/haskellwiki/Debugging Simon | Use a safe module: | http://neilmitchell.blogspot.com/2006/11/library-idea-safe-library.html | - always works, a little bit of

RE: Cabals' Paths_pkg and GHCi

2006-11-14 Thread Simon Marlow
Claus Reinke wrote: The Paths_foo.hs file is generated in a separate directory, something like dist/autogen/ (I can't remember exactly, you should be able to find it). To get GHCi to find it, you'll need to pass an appropriate -i dir flag. a general question about cabal and ghci: if I

Re: ghc-testsuite-6.6 on Macs

2006-11-14 Thread Thorkil Naur
Hello, On Tuesday 14 November 2006 11:34, Simon Marlow wrote: Thorkil Naur wrote: ... I have produced an experimental darcs patch that solves some problems, while possibly introducing others: http://thorkilnaur.dk/~tn/GHC/testsuite/patch/barton_mangler_bug_patch_1.patch .

Re: fromJust Nothing problem

2006-11-14 Thread Donald Bruce Stewart
ndmitchell: Hi My last impression is that instead of using -xc it is better to write programs in a debug-friendly style. For example, let g x must return (Just _), but the programmer is not 100% sure that g x is free of bugs. Then, instead of f x = h $

Debugging partial functions by the rules

2006-11-14 Thread Donald Bruce Stewart
So all this talk of locating head [] and fromJust failures got me thinking: Couldn't we just use rewrite rules to rewrite *transparently* all uses of fromJust to safeFromJust, tagging the call site with a location? To work this requires a few things to go right: * a rewrite rule