The typeof package

[Tags: bsd3, program]

A script to infer and insert type declarations in Haskell source, callable from your editor. Bindings exist to emacs and vim.


[Skip to ReadMe]

Properties

Versions0.1, 0.1.1, 0.1.2
Change logNone available
Dependenciesbase (<5), process [details]
LicenseBSD3
AuthorDon Stewart
MaintainerDon Stewart, Kangyuan Niu
CategoryDevelopment
Executablestypeof
UploadedWed May 4 23:27:17 UTC 2011 by KangyuanNiu
DistributionsNixOS:0.1.2
Downloads506 total (26 in last 30 days)
Votes
0 []
StatusDocs not available [build log]
Successful builds reported [all 2 reports]

Flags

NameDescriptionDefault
small_baseChoose the new smaller, split-up base package.Enabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for typeof-0.1.2

typeof: a script for inserting Haskell types in source code

== Building ==

    runhaskell Setup.lhs configure
    runhaskell Setup.lhs build
    runhaskell Setup.lhs install

== Use ==

The script accepts two inputs:
        
   command line argument 1: the file name to look in.
   stdin:                   the line containing the top level type
                                    declaration who's type you

the output is the type declaration for the value you requested, which
can be spliced back in to your source file.

VIM:

You can run the script from vim directly by adding the following to your
.vimrc file:
   
    :map ty yy:.!typeof -fbang-patterns %^Mp

Now, when you position your cursor over a top level declaration,
hitting:

    :ty

will insert the type declaration on the line above the one the cursor is
on.

EMACS:

In emacs add the following to your .emacs.el file:

(global-set-key (kbd "C-c t")
    (lambda () (interactive)
        (progn
            (save-buffer)
            (move-beginning-of-line nil)
            (call-process-region
                (line-beginning-position)
                (line-end-position)
                "typeof"
                nil
                t
                nil
                (buffer-file-name)))))

Then you can use C-c t to run insert the type declaration.

== Author ==

Don Stewart
http://www.cse.unsw.edu.au/~dons
Fri Dec 15 18:02:39 EST 2006