Re: GHC 6.8.1 RC debugger only breaking on first evaluation of a function
On Tue, Sep 18, 2007 at 02:26:38PM -0400, Olivier Boudry wrote: Hi all, I just tried the new GHCi debugger. A great new feature of GHCi 6.8.1. When debugging a function, as for example the qsort function given as an example in the 3.5 The GHCi Debugger documentation page, the debugger will only break on first function evaluation. As haskell is pure and lazy it's probably a normal behavior (reuse last result instead of recompute) but it's not very practical in a debugger. I tried to reload (:r) but it doesn't seems to help. Is there a way to force the function to be re-evalutated without quitting, starting, loading prog and setting breakpoints again, other than making the function part of the IO monad. ;-) If you don't find a better solution, then at least you can make it easier to perform the above sequence: $ cat ~/.ghci :def . readFile $ cat script :l Module :b 236 $ ghci GHCi, version 6.8.20070912: http://www.haskell.org/ghc/ :? for help Loading package base ... linking ... done. Prelude :. script [1 of 1] Compiling Module ( Module.hs, interpreted ) Ok, modules loaded: Module. Breakpoint 0 activated at Module.hs:236:20-45 *Module _ It should be quite easy to go a step further and generate breakpoint locations from markers in comments in the source file. Best regards Tomek ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: GHC 6.8.1 RC debugger only breaking on first evaluation of a function
Olivier Boudry wrote: On 9/18/07, *Stefan O'Rear* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: There is a flag to do this, and it's even In The Manual! http://haskell.org/ghc/dist/current/docs/users_guide/ghci-set.html#id313085 http://haskell.org/ghc/dist/current/docs/users_guide/ghci-set.html#id313085 3.8.1. GHCi options GHCi options may be set using :set and unset using :unset. The available GHCi options are: +r Thanks Stefan, I just tried the :set +r trick. It looked really promising but it doesn't seem to work as expected. Unfortunately not: http://hackage.haskell.org/trac/ghc/ticket/1400 Cheers, Simon ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: GHC 6.8.1 RC debugger only breaking on first evaluation of a function
On 19/09/2007, at 10:05, Tomasz Zielonka wrote: If you don't find a better solution, then at least you can make it easier to perform the above sequence: $ cat ~/.ghci :def . readFile $ cat script :l Module :b 236 $ ghci GHCi, version 6.8.20070912: http://www.haskell.org/ghc/ :? for help Loading package base ... linking ... done. Prelude :. script [1 of 1] Compiling Module ( Module.hs, interpreted ) Ok, modules loaded: Module. Breakpoint 0 activated at Module.hs:236:20-45 *Module _ You could also touch the module file to force a full reload: GHCi, version 6.7.20070907: http://www.haskell.org/ghc/ :? for help Loading package base ... linking ... done. [1 of 1] Compiling Main ( Qsort.hs, interpreted ) Ok, modules loaded: Main. *Main :! touch Qsort.hs *Main :r [1 of 1] Compiling Main ( Qsort.hs, interpreted ) Ok, modules loaded: Main. *Main Cheers pepe ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: ANNOUNCE: GHC 6.8.1 Release Candidate
Adrian Hey wrote: I get this error.. [29 of 53] Compiling Data.Tree.AVL.Join ( Data.Tree.AVL/Data/Tree/AVL/Join.hs, dist\build/Data/Tree/AVL/Join.o ) ghc.exe: panic! (the 'impossible' happened) (GHC version 6.8.20070912 for i386-unknown-mingw32): cgPanic a{v sMX} [lid] static binds for: collections-0.3:Data.Tree.AVL.Join.poly_go{v rse} [gid] collections-0.3:Data.Tree.AVL.Join.poly_$wlgo{v rsf} [gid] collections-0.3:Data.Tree.AVL.Join.flatConcat{v ryL} [gid] local binds for: SRT label collections-0.3:Data.Tree.AVL.Join.$LrMelvl{v rMe}_srt Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug I still get this error with 6.8.0.20070917 release, and the haddock problem with windows still seems to be there. Also, there doesn't seem to be a runHaskell command included (not sure if that's intentional). BTW, should I be reporting bugs with the release candidate on this list or via the usual trac? Regards -- Adrian Hey ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: unique id for data types
Ok, I'm stuck. The Oleg stuff is great, and it looks like he did everything I've done long ago, without needing type functions or associated types. But I can't use the TTypeable stuff directly because you can't convert the relational style of Oleg's work (using functional dependencies) to the functional style I'm using (using type families). Rewriting all the basics in my style is no problem (especially as I only need a limited part of it) EXCEPT Derive depends on (at least the types of) Template Haskell, and TH can't define type family or associated type instances. So I'm back where I started. Barney. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Unknown option -XPatternSig used in warning
Hello, $ ghc --version The Glorious Glasgow Haskell Compilation System, version 6.7.20070915 When loading the following incorrect program in ghci: foo (x :: a) = x ghci rightly complains: Illegal signature in pattern: a Use -XPatternSigs to permit it OK so I follow the advice and load: {-# OPTIONS_GHC -XPatternSigs #-} foo (x :: a) = x Now ghci complains: unknown flags in {-# OPTIONS #-} pragma: -XPatternSigs ??? The following works though: {-# OPTIONS_GHC -fglasgow-exts #-} foo (x :: a) = x results in: A pattern type signature cannot bind scoped type variables `a' unless the pattern has a rigid type context In the pattern: x :: a In the definition of `foo': foo (x :: a) = x Which I expect. Should I file a bug report, or is there an easy fix? regards, Bas van Dijk ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: Unknown option -XPatternSig used in warning
I believe this is a known problem with OPTIONS_GHC, and will work on the command line. I think Ian is working on it. Ian? Simon | -Original Message- | From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On | Behalf Of Bas van Dijk | Sent: 19 September 2007 13:20 | To: glasgow-haskell-users@haskell.org | Subject: Unknown option -XPatternSig used in warning | | Hello, | | $ ghc --version | The Glorious Glasgow Haskell Compilation System, version 6.7.20070915 | | | When loading the following incorrect program in ghci: | | foo (x :: a) = x | | ghci rightly complains: | | Illegal signature in pattern: a | Use -XPatternSigs to permit it | | OK so I follow the advice and load: | | {-# OPTIONS_GHC -XPatternSigs #-} | | foo (x :: a) = x | | Now ghci complains: | | unknown flags in {-# OPTIONS #-} pragma: -XPatternSigs ??? | | The following works though: | | {-# OPTIONS_GHC -fglasgow-exts #-} | | foo (x :: a) = x | | results in: | | A pattern type signature cannot bind scoped type variables `a' | unless the pattern has a rigid type context | In the pattern: x :: a | In the definition of `foo': foo (x :: a) = x | | Which I expect. | | Should I file a bug report, or is there an easy fix? | | regards, | | Bas van Dijk | ___ | Glasgow-haskell-users mailing list | Glasgow-haskell-users@haskell.org | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: ANNOUNCE: GHC 6.8.1 Release Candidate
| BTW, should I be reporting bugs with the release candidate on this | list or via the usual trac? Via Trac please. Can you give instructions to reproduce, please? Simon | -Original Message- | From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On | Behalf Of Adrian Hey | Sent: 19 September 2007 12:00 | To: glasgow-haskell-users@haskell.org | Subject: Re: ANNOUNCE: GHC 6.8.1 Release Candidate | | Adrian Hey wrote: | I get this error.. | | [29 of 53] Compiling Data.Tree.AVL.Join ( | Data.Tree.AVL/Data/Tree/AVL/Join.hs, dist\build/Data/Tree/AVL/Join.o ) | ghc.exe: panic! (the 'impossible' happened) |(GHC version 6.8.20070912 for i386-unknown-mingw32): | cgPanic | a{v sMX} [lid] | static binds for: | collections-0.3:Data.Tree.AVL.Join.poly_go{v rse} [gid] | collections-0.3:Data.Tree.AVL.Join.poly_$wlgo{v rsf} [gid] | collections-0.3:Data.Tree.AVL.Join.flatConcat{v ryL} [gid] | local binds for: | SRT label collections-0.3:Data.Tree.AVL.Join.$LrMelvl{v rMe}_srt | | Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug | | I still get this error with 6.8.0.20070917 release, and the haddock | problem with windows still seems to be there. Also, there doesn't | seem to be a runHaskell command included (not sure if that's | intentional). | | BTW, should I be reporting bugs with the release candidate on this | list or via the usual trac? | | Regards | -- | Adrian Hey | | | ___ | Glasgow-haskell-users mailing list | Glasgow-haskell-users@haskell.org | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Unknown option -XPatternSig used in warning
On 9/19/07, Simon Peyton-Jones [EMAIL PROTECTED] wrote: I believe this is a known problem with OPTIONS_GHC, and will work on the command line. I think Ian is working on it. Ian? Via the command line I get the same problem: $ ghci -XPatternSigs PatternSig.hs GHCi, version 6.7.20070915: http://www.haskell.org/ghc/ :? for help ghc-6.7.20070915: unrecognised flags: -XPatternSigs Usage: For basic information, try the `--help' option. Bas ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Unknown option -XPatternSig used in warning
| Illegal signature in pattern: a | Use -XPatternSigs to permit it | I am very happy to see that it doesn't recommend -fglasgow-exts anymore! However, I still would prefer Use LANGUAGE pragma with extension ``PatternSigs'' to permit it since it points out even more things that many may not have known before... By the way, some of my LANGUAGE pragmas are getting quite long, and last time I tried I was not allowed to have a line break in there. Are there any plans to allow line breaks, or multiple LANGUAGE pragmas? Wolfram ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Unknown option -XPatternSig used in warning
Via the command line I get the same problem: $ ghci -XPatternSigs PatternSig.hs GHCi, version 6.7.20070915: http://www.haskell.org/ghc/ :? for help ghc-6.7.20070915: unrecognised flags: -XPatternSigs Usage: For basic information, try the `--help' option. $ /cygdrive/c/fptools/ghc/compiler/stage2/ghc-inplace --supported-languages | grep Pat PatternGuards PatternSignatures BangPatterns MonoPatBinds could it be that the error message is incorrect, pointing to an abbreviated form? Illegal signature in pattern: a Use -XPatternSigs to permit it claus ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Unknown option -XPatternSig used in warning
On 9/19/07, Simon Peyton-Jones [EMAIL PROTECTED] wrote: ...I'll push a fix. Thanks! It works now: $ ghci -XPatternSignatures PatternSig.hs GHCi, version 6.9.20070919: http://www.haskell.org/ghc/ :? for help Loading package base ... linking ... done. [1 of 1] Compiling Main ( PatternSig.hs, interpreted ) PatternSig.hs:2:10: Not in scope: type variable `a' Failed, modules loaded: none. Bas ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Unknown option -XPatternSig used in warning
On 9/19/07, Wolfgang Jeltsch [EMAIL PROTECTED] wrote: You should use {-# LANGUAGE PatternSigs #-} That should be: {-# LANGUAGE PatternSignatures #-} It would indeed be better if GHC could print Use LANGUAGE pragma with extension... like Wolfram mentioned. Bas ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: STG to JavaScript translation
I still have some questions regarding the GHC internals. There is a description of STG language in the Making a Fast Curry: Push/Enter vs. Eval/Apply for Higher-oder Languages (2004) by Simon Marlow and Simon Peyton Jones paper. In this description the constructor application (CONS closure) can only appear on the right hand side of the bindings. This is totally reasonable if let is the only construct that allocates objects. But in the GHC's StgSyn.hs any expression can be constructor application. How does constructor applications are compiled? Are they implicitly transformed to let? For example: f = let g = (THUNK h x) in (CONS g y) Is this exactly the same as (right variant following the paper) f = let g = (THUNK h x) in let freshvar = (CONS g y) in freshvar ? And the second question is how does constructor tag is passed to case when non-vector return is used? In register? In constructor closure? Are there any cases when closure is not build for constructor application? What the case binder is bound to if there is no closure for constructor application? -- vir http://vir.comtv.ru/ ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Unknown option -XPatternSig used in warning
Hi Wolfram, On Wed, Sep 19, 2007 at 01:45:00PM -, [EMAIL PROTECTED] wrote: By the way, some of my LANGUAGE pragmas are getting quite long, and last time I tried I was not allowed to have a line break in there. What version of GHC are you using? This works in 6.6: {-# LANGUAGE MultiParamTypeClasses, OverlappingInstances #-} module Q where class Foo a b where foo :: a - b instance Foo Int Bool instance Foo Int a x :: Int - Bool x = foo Are there any plans to allow line breaks, or multiple LANGUAGE pragmas? This also works: {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverlappingInstances #-} module Q where class Foo a b where foo :: a - b instance Foo Int Bool instance Foo Int a x :: Int - Bool x = foo Thanks Ian ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
STG to JavaScript translation
I still have some questions regarding the GHC internals. There is a description of STG language in the Making a Fast Curry: Push/Enter vs. Eval/Apply for Higher-oder Languages (2004) by Simon Marlow and Simon Peyton Jones paper. In this description the constructor application (CONS closure) can only appear on the right hand side of the bindings. This is totally reasonable if let is the only construct that allocates objects. But in the GHC's StgSyn.hs any expression can be constructor application. How does constructor applications are compiled? Are they implicitly transformed to let? For example: f = let g = (THUNK h x) in (CONS g y) Is this exactly the same as (right variant following the paper) f = let g = (THUNK h x) in let freshvar = (CONS g y) in freshvar ? And the second question is how does constructor tag is passed to case when non-vector return is used? In register? In constructor closure? Are there any cases when closure is not build for constructor application? What the case binder is bound to if there is no closure for constructor application? -- vir http://vir.comtv.ru/ ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users