Re: [Haskell-cafe] Refactoring status

2008-01-07 Thread Emil Axelsson
One approach to programming in Haskell, which I use all the time, is to write the type signature before the function body. This means that if I'm trying to do something strange, I will often be warned by the type checker even before I've written the strange code. But I've also been bitten by

RE: [Haskell-cafe] Refactoring status

2008-01-04 Thread Henning Thielemann
On Thu, 3 Jan 2008, Peter Verswyvelen wrote: I believe type signatures are the very essence of Haskell documentation! I'd much rather see a program with type signatures for functions and little (or no) comments over programs with no type signatures and ambigious comments (if any comments

RE: [Haskell-cafe] Refactoring status

2008-01-04 Thread Peter Verswyvelen
Types cannot always be derived automatically, especially when coming to Haskell extensions. Sometimes you also want to restrict the type. E.g. for asTypeOf _ y = y you explicitly want the type asTypeOf :: a - a - a not the automatically derived one: asTypeOf :: b - a - a Yes, sometimes it

RE: Re[2]: [Haskell-cafe] Refactoring status

2008-01-04 Thread Peter Verswyvelen
the same is possible for Haskell - it's possible to add to code type signatures deduced by the compiler Ha! Yes, HaRe also has the facility to do this have I plugged it enough yet? :-) Sounds great! But could you add support for arrows so I can use it for my Yampa experiments? Please? :)

Re: [Haskell-cafe] Refactoring status

2008-01-04 Thread Felipe Lessa
On Jan 4, 2008 4:19 PM, Peter Verswyvelen [EMAIL PROTECTED] wrote: Yes, but it would be nice to attach some parameter-comment to the types no? Now a lot of documentation is written in the style the 7th parameter is Not very user friendly :) Haddock allows you to put documentation inside

RE: [Haskell-cafe] Refactoring status

2008-01-04 Thread Henning Thielemann
On Fri, 4 Jan 2008, Peter Verswyvelen wrote: Yes, sometimes it is neccerary to give an explicit type. But in so many cases, type inference works fine no? What I usually do, is use the GHCi t: command, copy/paste that in my code, and then make the type signature more specific if it has to be.

RE: [Haskell-cafe] Refactoring status

2008-01-04 Thread Peter Verswyvelen
It's already possible to write asTypeOf :: a {- ^ the input value to be passed through -} - a {- ^ the value is ignored, but the type is unified with the first parameter -} - a {- ^ the value of the first parameter -} Nice. Still using first parameter though ;-)

Re: [Haskell-cafe] Refactoring status

2008-01-04 Thread Felipe Lessa
On Jan 4, 2008 5:52 PM, Peter Verswyvelen [EMAIL PROTECTED] wrote: It's already possible to write asTypeOf :: a {- ^ the input value to be passed through -} - a {- ^ the value is ignored, but the type is unified with the first parameter -} - a {- ^ the value of the first

RE: [Haskell-cafe] Refactoring status

2008-01-04 Thread Henning Thielemann
On Fri, 4 Jan 2008, Peter Verswyvelen wrote: It's already possible to write asTypeOf :: a {- ^ the input value to be passed through -} - a {- ^ the value is ignored, but the type is unified with the first parameter -} - a {- ^ the value of the first parameter -} Nice.

RE: [Haskell-cafe] Refactoring status

2008-01-04 Thread Peter Verswyvelen
Nice. Still using first parameter though ;-) This was the problem I mentioned earlier. I tend to write comments like {- | @asTypeOf x y@ returns the value of @x@, while the types of @x@ and @y@ are unified -} asTypeOf :: a - a - a This way I can introduce parameter names for the reader.

[Haskell-cafe] Refactoring status

2008-01-03 Thread Peter Verswyvelen
Hi all, Is any work being done on Haskell refactoring support, like HaRe or others? Is anyone actively using refactoring? When using C#, I used Resharper a lot, and ever since, I'm really hooked to refactoring, so I miss it a lot when doing Haskelling. (I never seem to get a function name

Re: [Haskell-cafe] Refactoring status

2008-01-03 Thread C.M.Brown
Hi Peter, Is any work being done on Haskell refactoring support, like HaRe or others? HaRe is still very active and is due for a new release very soon. There are probably in excess of 40 refactorings for HaRe in total now, and I intend to add more! Sadly, I am currently the only maintainer left

Re: [Haskell-cafe] Refactoring status

2008-01-03 Thread Neil Mitchell
Hi PS: IMHO I don't think text should be the source format of our files… I think we should use a standarized decorated AST as the source, from which we can derive a textual (but also graphical) view and editor… Any comments on that? J Yes - I think you're wrong. I've seen non-textual editors

RE: [Haskell-cafe] Refactoring status

2008-01-03 Thread Peter Verswyvelen
HaRe works with both Emacs and VIM; you can also use it from a command prompt meaning that it can be integrated into any tool that you require. Indeed, there was even some investigation of porting it to Sub Etha Edit with great success! Cool! I'll check it out. However, I'm using some GHC

RE: [Haskell-cafe] Refactoring status

2008-01-03 Thread C.M.Brown
Cool! I'll check it out. However, I'm using some GHC extensions, so that is indeed a show stopper :) Which extensions are you using that are not Haskell 98? I would be very interested to know what users would generally require from a refactorer. You mean a syntax-directed editor, right?

Re[2]: [Haskell-cafe] Refactoring status

2008-01-03 Thread Bulat Ziganshin
Hello Neil, Thursday, January 3, 2008, 9:57:10 PM, you wrote: Yes - I think you're wrong. I've seen non-textual editors for programming languages, and they are severely unpleasant for all but the most new beginners and restricted tasks. what sort of code you are tried to develop? visual

RE: [Haskell-cafe] Refactoring status

2008-01-03 Thread Peter Verswyvelen
Yes - I think you're wrong. I've seen non-textual editors for programming languages, and they are severely unpleasant for all but the most new beginners and restricted tasks. For programmers and mathematicians, you are absolutely right. For beginners and people who have highly developed visual

RE: [Haskell-cafe] Refactoring status

2008-01-03 Thread Peter Verswyvelen
I agree with Neil, AST editors are generally ugly and hard to use. There is also the problem of laying out Haskell code. Everyone uses their own layout style and pretty printing ASTs is generally a bad thing to do in this context. I actually meant something more like

Re: [Haskell-cafe] Refactoring status

2008-01-03 Thread Bulat Ziganshin
Hello Peter, Thursday, January 3, 2008, 9:13:27 PM, you wrote: well, i use refactoring without help of any tool. according to my own experience, it's much easier in Haskell than in other languages i know - basically, you just cut-n-paste your code around. i don't use type signatures at all -

Re: [Haskell-cafe] Refactoring status

2008-01-03 Thread C.M.Brown
Hi Bulat, i don't use type signatures at all - this creates some problems when i wrote large portion of code and try to make it compile, but nothing more I believe type signatures are the very essence of Haskell documentation! I'd much rather see a program with type signatures for functions

RE: [Haskell-cafe] Refactoring status

2008-01-03 Thread C.M.Brown
Currently, I'm trying to learn arrows and Yampa (mainly to see how well it compares to my own dataflow/reactive stuff that was written in C#, C++ and assembler) Arrows won't work with HaRe at the moment, therefore Yampa won't either; which is a shame. First of all, let's see if I get the

RE: [Haskell-cafe] Refactoring status

2008-01-03 Thread C.M.Brown
Furthermore, IMHO, type signatures alone are not enough, a good parameter name says at least as much as the type. Yes! A very good point! :) E.g. what does a function Int - Int - Bool do? I have no idea. A good function name helps, e.g. isDivisible:: Int - Int - Bool. But then I still

RE: [Haskell-cafe] Refactoring status

2008-01-03 Thread Peter Verswyvelen
I believe type signatures are the very essence of Haskell documentation! I'd much rather see a program with type signatures for functions and little (or no) comments over programs with no type signatures and ambigious comments (if any comments at all!). Okay, but when using a syntax directed

RE: [Haskell-cafe] Refactoring status

2008-01-03 Thread Peter Verswyvelen
Furthermore, when I need to perform refactoring, a rename is just *one* change to the entire system, no matter how many other files use the name; no more merging for stupid renames. I'm a little confused as to what you mean here. A renaming renames all (and only those) uses of an identifier

Re[2]: [Haskell-cafe] Refactoring status

2008-01-03 Thread Bulat Ziganshin
Hello C.M.Brown, Thursday, January 3, 2008, 10:46:54 PM, you wrote: i don't use type signatures at all - this creates some problems when i wrote large portion of code and try to make it compile, but nothing more I believe type signatures are the very essence of Haskell documentation! I'd

Re: [Haskell-cafe] Refactoring status

2008-01-03 Thread hjgtuyl
On Thu, 03 Jan 2008 19:48:05 +0100, C.M.Brown [EMAIL PROTECTED] wrote: HaRe is still very active and is due for a new release very soon. There are probably in excess of 40 refactorings for HaRe in total now, and I intend to add more! Sadly, I am currently the only maintainer left on the

RE: [Haskell-cafe] Refactoring status

2008-01-03 Thread ajb
G'day all. Quoting Peter Verswyvelen [EMAIL PROTECTED]: I actually meant something more like http://en.wikipedia.org/wiki/Intentional_programming I'm pretty sure that Intentional programming is Hungarian for I want to sell you another IDE. Cheers, Andrew Bromage

Re: [Haskell-cafe] Refactoring status

2008-01-03 Thread C.M.Brown
Hi, A possible first goal would be, to add extensions that are definitely in Haskell prime, see: http://hackage.haskell.org/trac/haskell-prime/wiki/Status'#definitely-inProposalStatus Oh great! Thanks for the link, I think the main issue is moving over to a platform that is heavily

Re[2]: [Haskell-cafe] Refactoring status

2008-01-03 Thread C.M.Brown
On Fri, 4 Jan 2008, Bulat Ziganshin wrote: Hello Peter, Thursday, January 3, 2008, 11:03:58 PM, you wrote: Okay, but when using a syntax directed editor, type signatures can be automatically provided because the types are known. the same is possible for Haskell - it's possible to add to