This seems doable and it might be quite easy! right now the precise mode don't really care about lhs of functions, but it would be possible to extend it so that the parameters are put into some data constructor.
After that has been done it would be easy to do the suggested changes in somekind of offline thing similar to dollarify //Anders K On Tue, Jun 30, 2009 at 3:15 PM, Deniz Dogan<deniz.a.m.do...@gmail.com> wrote: > > Found another interesting idea for the Haskell mode! Is this doable? > > ---------- Forwarded message ---------- > From: Loup Vaillant <loup.vaill...@gmail.com> > Date: 2009/6/30 > Subject: Re: [Haskell-cafe] coding standard question > To: Malcolm Wallace <malcolm.wall...@cs.york.ac.uk> > Kopia: haskell-c...@haskell.org > > > 2009/6/22 Malcolm Wallace <malcolm.wall...@cs.york.ac.uk>: >> Erik de Castro Lopo <mle...@mega-nerd.com> wrote: >> >>> Vasili I. Galchin wrote: >>> >>> > "where/let" functions use the >>> > same name for function parameters as the outer function and hence >>> > there is a "shadow" warning from the compiler. >>> >>> In Haskell there is an easy way around this. Variables can >>> be name a, a', a'' and so on. ... >>> ... its a good idea to fix these warnings. >> >> I would _strongly_ advise not to do that. By trying to silence the >> spurious warning about shadowing, there is enormous potential to >> introduce new bugs that were not there before. >> >> Example: >> >> f a b = g (a+b) (b-a) >> where g a c = a*c >> >> ghc warns that g's parameter a shadows the parameter to f. So we >> introduce a primed identifier to eliminate the warning: >> >> f a b = g (a+b) (b-a) >> where g a' c = a*c >> >> Now, no warnings! But, oops, this function does not do the same thing. >> We forgot to add a prime to all occurrences of a on the right-hand-side. >> >> Particularly in larger examples, it can be remarkably easy to miss an >> occurrence of the variable whose name you are refactoring. The key >> point is that in this situation, unlike most refactorings, the compiler >> _cannot_ help you find the mistake with useful error messages or >> warnings. > > What about an editor (or emacs mode or…) that support variable renaming? > Maybe there is already one? > > Loup > _______________________________________________ > Haskell-Cafe mailing list > haskell-c...@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > > -- > Deniz Dogan > > > > --~--~---------~--~----~------------~-------~--~----~ Yi development mailing list yi-devel@googlegroups.com http://groups.google.com/group/yi-devel -~----------~----~----~----~------~----~------~--~---