Re: idea: tool to suggest adding imports

2016-03-20 Thread Daniel Trstenjak
Hi John, for the Haskell source modification part I've written hsimport[1]. For finding a certain symbol in the moduls of the dependencies of a project, there's the 'findsymbol' command of a more recent hdevtools[2]. There's also vim-hsimport[3] combining the two. Greetings, Daniel [1]

Re: idea: tool to suggest adding imports

2016-03-20 Thread Alexander Berntsen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 19/03/16 20:08, Evan Laforge wrote: > The catch is that it uses qualified imports, which makes > everything easy. If you're still interested, it's fix-imports on > hackage. There are lots of others too, but I haven't tried them. Ah. I generally

Re: idea: tool to suggest adding imports

2016-03-20 Thread Erik Hesselink
I wrote halberd a while ago. It was mostly as an example of using the haskell-names and haskell-packages packges (combined with haskell-src-exts) that Roman Cheplyaka was working on at the time, combined with a useful tool that I wanted for myself. The downside is that haskell-packages doesn't use

Re: idea: tool to suggest adding imports

2016-03-19 Thread Evan Laforge
On Sat, Mar 19, 2016 at 8:12 AM, Alexander Berntsen wrote: > On 18/03/16 23:51, Evan Laforge wrote: >> I did this about 5 or 6 years ago for vim, and I'm so used to it I >> wouldn't want to live without it. > Is your plug-in free software? Do you have a link to it? It sounds

Re: idea: tool to suggest adding imports

2016-03-19 Thread Alexander Berntsen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 18/03/16 23:51, Evan Laforge wrote: > I did this about 5 or 6 years ago for vim, and I'm so used to it I > wouldn't want to live without it. Is your plug-in free software? Do you have a link to it? It sounds very useful to us vim users. - --

idea: tool to suggest adding imports

2016-03-19 Thread John Williams
I have an idea for a tool I'd like to implement, and I'm looking for advice on the best way to do it. Ideally, I want to write an Emacs extension where, if I'm editing Haskell code and I try to use a symbol that's not defined or imported, it will try to automatically add an appropriate import for

Re: idea: tool to suggest adding imports

2016-03-18 Thread Evan Laforge
I did this about 5 or 6 years ago for vim, and I'm so used to it I wouldn't want to live without it. So I definitely recommend just doing it. It was surprisingly easy to implement, it only took a few hours, and then a day or so to refine the details. I used haskell-src-exts for parsing and

Re: idea: tool to suggest adding imports

2016-03-18 Thread Harendra Kumar
That's cool, I'd love to have that feature in my editor. Have you seen this: https://hackage.haskell.org/package/halberd The readme says: ---cut--- Halberd is a tool to help you add missing imports to your Haskell source files. With it, you can write your source without imports, call Halberd,

Re: idea: tool to suggest adding imports

2016-03-18 Thread Edward Z. Yang
Hello John, In my opinion, the big question is whether or not your Emacs extension should know how to build your Haskell project. Without this knowledge, (1) and (3) are non-starters, since you have to pass the right set of -package flags to GHC to get the process started. If you do assume you