Re: hsman

2006-11-07 Thread Neil Mitchell

Hi


Anyway, you say you are working on a command line interface - OK, but
I think the current situation is just a bit embarrassing, and I have
something that works now. I can access all Perl documentation with
'man', and that is very convenient. It is just two words, e.g.:


Fair enough, you are certainly welcome to "compete" with Hoogle :) It
might even persuade me to get the Hoogle thing done faster (although I
did go and release a command line version today)


- be usable from the command line, and with tab completion (i.e. users
shouldn't have to enter an interactive loop like ghci)


I think it should do both.


- be able to show the haddock documentation for a given function (the
most common usage) in one step (i.e. not 2 steps as with the hoogle
web interface).


Hoogle 4 does this to some degree. I can certainly add a flag that
makes it more encouraged to show some documentation even when there
are multiple matches.

Thanks

Neil
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: hsman

2006-11-07 Thread Frederik Eaton
> Yes, I know command line completion works - but only for files, not
> for anything else, and there is no way to make it work for other
> things. However, I know that zsh can do funky things like
> autocompleting ssh paths etc - and I think I remember seeing that
> there was some way a program could tell zsh what it could autocomplete
> to - but that is a hazy memory from a while ago.

What I did, to make things more modular, was add an option to my
program to list the completions of a given set of arguments. So
prepending "--completions" to the argument list and running the
program just prints out a list of completions for the last argument. 
It's not really correct, since the user might have backed up to e.g. 
the second-to-last argument and pressed TAB there, but I'm not sure
how to fix it. It's probably a simple modification, that a real zsh
person could figure out in a second. I have a file containing the
following in my fpath:


#!/bin/zsh

_haskell-man () {
L=($($words[0] --completions $words))
compadd -a -- L
}

compdef _haskell-man hsman


Anyway, you say you are working on a command line interface - OK, but
I think the current situation is just a bit embarrassing, and I have
something that works now. I can access all Perl documentation with
'man', and that is very convenient. It is just two words, e.g.:

$ man CGI

I think it is reasonable to expect any other kind of documentation to
be just as easy to look up. I think a satisfactory system for Haskell
should:

- be usable from the command line, and with tab completion (i.e. users
shouldn't have to enter an interactive loop like ghci)

- be able to show the haddock documentation for a given function (the
most common usage) in one step (i.e. not 2 steps as with the hoogle
web interface). when there is more than one match, my program chooses
a default; the user can ask to see all matches with a separate option. 
this is usually preferable, because many functions, for instance
foldl1, are defined in multiple places with exactly the same
documentation (Prelude, Data.List, Data.Foldable), and the user
doesn't care which one pops up.

Best,

Frederik

-- 
http://ofb.net/~frederik/
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: hsman

2006-11-07 Thread Lennart Kolmodin
> Hi
>
>> How would it work on Unix? I assume that the command-line program just
>> takes it's input "from the command line", so it doesn't get invoked
>> until after you've finished typing the command...

Not necessarily true if completion is involved ... see below.

> However, I know that zsh can do funky things like
> autocompleting ssh paths etc - and I think I remember seeing that
> there was some way a program could tell zsh what it could autocomplete
> to - but that is a hazy memory from a while ago.

Have a look at the (unreleased) bash completion for ghc-pkg:

http://www.haskell.org/~kolmodin/code/ghc-bash-completion/ghc-pkg

source it in bash to get it started.
As you can see that ghc-pkg doesn't have special support for
autocompletion, but it's possible anyway.

To make it a bit simpler to write the completion, it's nice if the
application in question has support for it. A nice example of this is
darcs[1] which implements the command '--commands' and the flag
'--list-option'.

Cheers,
  Lennart Kolmodin

[1] http://www.abridgegame.org/repos/darcs-unstable/darcs_completion

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: hsman

2006-11-07 Thread Neil Mitchell

Hi


How would it work on Unix? I assume that the command-line program just
takes it's input "from the command line", so it doesn't get invoked
until after you've finished typing the command...

Unless this is a proposal to create a console version of hoogle, a bit
like ghci, which could take advantage of System.Console.Readline.


I do have something like that in the works (hoogli), but its not ready
for the world quite yet.


BTW, on Windows XP command line filename completion is enabled - just
use the Tab key. On NT4 and W2K you have to tweak the registry to switch
it on (and you can choose which key to use, if you don't like Tab).


Yes, I know command line completion works - but only for files, not
for anything else, and there is no way to make it work for other
things. However, I know that zsh can do funky things like
autocompleting ssh paths etc - and I think I remember seeing that
there was some way a program could tell zsh what it could autocomplete
to - but that is a hazy memory from a while ago.

Thanks

Neil
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


RE: hsman

2006-11-07 Thread Bayley, Alistair
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf 
> Of Neil Mitchell
> 
> > - command-line autocompletion
> 
> No, how do I add it? I use Windows which doesn't support this, but if
> someone gives me the technical details of how to do it, I'm sure I can
> add it.

How would it work on Unix? I assume that the command-line program just
takes it's input "from the command line", so it doesn't get invoked
until after you've finished typing the command...

Unless this is a proposal to create a console version of hoogle, a bit
like ghci, which could take advantage of System.Console.Readline.

BTW, on Windows XP command line filename completion is enabled - just
use the Tab key. On NT4 and W2K you have to tweak the registry to switch
it on (and you can choose which key to use, if you don't like Tab).

Alistair
*
Confidentiality Note: The information contained in this message,
and any attachments, may contain confidential and/or privileged
material. It is intended solely for the person(s) or entity to
which it is addressed. Any review, retransmission, dissemination,
or taking of any action in reliance upon this information by
persons or entities other than the intended recipient(s) is
prohibited. If you received this in error, please contact the
sender and delete the material from any computer.
*
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: hsman

2006-11-07 Thread Neil Mitchell

Hi


- ability to index any library


Yes, runhaskell Setup haddock -hoogle will generate a hoogle database
for any library. Hoogle 4 (currently in development) will make
searching multiple libraries much much easier.


- ability to use from the console


Yes, although may currently be a bit broken (I'll make a command line
release today hopefully which guarantees to work)


- command-line autocompletion


No, how do I add it? I use Windows which doesn't support this, but if
someone gives me the technical details of how to do it, I'm sure I can
add it.

Thanks

Neil
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: hsman

2006-11-07 Thread Frederik Eaton
Hi Neil,

I've seen hoogle and I like it. Does Hoogle have the following
features?

- ability to index any library
- ability to use from the console
- command-line autocompletion

Of course, there are many features that Hoogle has, which my program
is missing.

Frederik

On Tue, Nov 07, 2006 at 12:57:58AM +, Neil Mitchell wrote:
> Hi Fredrick,
> 
> >I have a perl script which I call 'hsman', which indexes
> >Haddock-generated HTML files, and allows users to search for functions
> >and also GHC manual topics.
> 
> Have you seen hoogle? http://haskell.org/hoogle - what features does
> your program offer over hoogle, and would you be interested in putting
> them into hoogle so everyone gets it.
> 
> Thanks
> 
> Neil
> 

-- 
http://ofb.net/~frederik/
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: hsman

2006-11-07 Thread Malcolm Wallace
Seth Kurtzberg <[EMAIL PROTECTED]> writes:

> > how about searching code that's outside of the standard library?  Hoogle
> > doesn't seem to know about HaXml, or haskelldb for example (maybe I am
> > missing something obvious)
> 
> You want to distinguish between capabilities, and the fact that the
> database for hoogle may not include all the data that is available.
> If the issue is only the availability of the data, perhaps the best
> option is to add the data to hoogle.

Don't forget that, as well as a web engine, Hoogle is also a
command-line tool.  You can download it, and populate its database with
all (and exactly) the libraries you have installed.

Regards,
Malcolm
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: hsman

2006-11-06 Thread Seth Kurtzberg
On Mon, 6 Nov 2006 21:32:39 -0600
"Quan Ta" <[EMAIL PROTECTED]> wrote:

> how about searching code that's outside of the standard library?  Hoogle
> doesn't seem to know about HaXml, or haskelldb for example (maybe I am
> missing something obvious)

You want to distinguish between capabilities, and the fact that the database 
for hoogle may not include all the data that is available.

If the issue is only the availability of the data, perhaps the best option is 
to add the data to hoogle.

> 
> Quan
> 
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: hsman

2006-11-06 Thread Quan Ta
how about searching code that's outside of the standard library?  Hoogle doesn't seem to know about HaXml, or haskelldb for example (maybe I am missing something obvious)Quan
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: hsman

2006-11-06 Thread Neil Mitchell

Hi Fredrick,


I have a perl script which I call 'hsman', which indexes
Haddock-generated HTML files, and allows users to search for functions
and also GHC manual topics.


Have you seen hoogle? http://haskell.org/hoogle - what features does
your program offer over hoogle, and would you be interested in putting
them into hoogle so everyone gets it.

Thanks

Neil
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users