Re: Call to arms: lambda-case is stuck and needs your help

2012-07-07 Thread Jonas Almström Duregård
Couldn't we use \\ for multi-case lambdas with layout? If not, these are my preferences in order (all are single argument versions): 1: Omission: "case of". There seems to be some support for this but it was not included in the summary. 2: Omission with clarification: "\case of" 3: "\of" - but I

Re: [GHC Users] Dictionary sharing

2012-06-29 Thread Jonas Almström Duregård
Thank you for your response Edward, You write that it is usually only evaluated once, do you know the circumstances under which it is evaluated more than once? I have some examples of this but they are all very large. The real issue I was having was actually not with a list but with a memoised fu

[GHC Users] Dictionary sharing

2012-06-29 Thread Jonas Almström Duregård
Hi, Is there a way to ensure that functions in a class instance are treated as top level definitions and not re-evaluated? For instance if I have this: >>> class C a where list :: [a] instance List a => List [a] where list = permutations list <<< How can I ensure that list :: [[X]] is evalua

Re: Superclass defaults

2011-09-05 Thread Jonas Almström Duregård
C enables SilentDefaultSuperInstances by default, > as a pragmatic choice to avoid legacy issues, but not DefaultSuperInstances. > If (only) SilentDefaultSuperInstances is enabled, I propose that Option 2 is > used. It makes perfect sense to warn if you override a default instance, >

Re: Superclass defaults

2011-09-02 Thread Jonas Almström Duregård
can turn it off, and it's not fatal. > > Does anyone advocate something else? > > Simon > > | -Original Message- > | From: glasgow-haskell-users-boun...@haskell.org > [mailto:glasgow-haskell-users- > | boun...@haskell.org] On Behalf Of Jonas Almström Dure

Re: Superclass defaults

2011-09-02 Thread Jonas Almström Duregård
> The question then comes down to whether that warning should ever be > strengthened to an error. Indeed. > I agree that such a scenario is possible. The present situation gives > no choice but to do things badly, but things often get done badly the > first time around anyway. Perhaps I'm just gr

Re: Superclass defaults

2011-09-02 Thread Jonas Almström Duregård
Hi, On 31 August 2011 12:22, Conor McBride wrote: > I become perplexed very easily. I think we should warn whenever silent > pre-emption (rather than explicit) hiding is used to suppress a default > instance, because it is bad --- it makes the meaning of an instance > declaration rather more cont

Re: Superclass defaults

2011-08-31 Thread Jonas Almström Duregård
| > There seems to be a lot of support for Option 3... but what about Option 2 (ie pre-empt but give a warning)? I think option 2 sounds very good. Possibly with the exception of only warning when the manual instance is in another module, since you will never experience the "perplexity" described

Re: Superclass defaults

2011-08-29 Thread Jonas Almström Duregård
Hi, First of all, I love the idea of default superclass instances! About the opt-out feature, the problem with option 3 is only present if the superclass instance is defined in another module (you won't see unexpected behavior from your own instances). One solution is to use option 3 if the offen

Re: Quoting a quasi-quote

2011-07-27 Thread Jonas Almström Duregård
Hi, I have an alternative suggestion, please let me know what you think. We introduce an alternative start tag i.e. a quote can start with [q| or [q\| (or something similar). If [q| is used then the quoted text is used verbatim and if the alternative start-tag is used then the escape sequences su

Reloading and templates

2011-07-04 Thread Jonas Almström Duregård
Hi, In ghci, if you change a module that exports a TH template it will not recompile modules that use the template. Example: -- In A.hs {-#LANGUAGE TemplateHaskell#-} module A where import Language.Haskell.TH a = [d|x = 5|] -- in B.hs {-#LANGUAGE TemplateHaskell#-} import A a -- As expected in

Template Haskell and linking

2010-09-17 Thread Jonas Almström Duregård
Hi GHC users! Does anyone know if an import that is only used by Template Haskell (i.e. not in "actual" code) is reflected in the produced executable? Example: import LargeModule(thFunction) $thfunction ... Is LargeModule linked in the executable file? (Assume thFunction is not referenced by