RE: Haskell Programming Environment

I would like to be able to inspect the type of things easily by hovering my mouse over an expression. As a beginner, I find it hard sometimes to get types correct in Haskell since often variables are not declared as a specific type.
-----Original Message----- From: Jan Skibinski [mailto:jans@numeric-quest.com] Sent: Wednesday, October 25, 2000 1:28 AM To: Pawel Kot Cc: haskell-cafe@haskell.org Subject: Re: Haskell Programming Environment
On Wed, 25 Oct 2000, =?ISO-8859-2?Q? Pawe=B3?= Kot wrote:
Hello,
I'm writing my master thesis. Its subject is 'Haskell Programming Environment'. It is (or rather will be) an extended text editor working in graphical (XFree86) environment designed for Haskell programmers. It will be implemented using Fudgets library. I'm wondering what features would you like to find in such environment. What should be neccessary, what would help, what would make writing programs easier, etc. I have some concepts, but I would like to hear some suggestions from you.
A module/class/instance/library browser perhaps? Acquiring its information from standard libraries and other user defined directories? Extracting comments, module comments, class comments, and implementation details to present them in some consistent way? Supporting incremental compilation, a'la hmake? With intelligent use of colorization, or other useful hints for programmers, for a start? Intelligent inspectors?
In short - something that exists for ages in Smalltalk, or in Eiffel development environment, but with Haskell's extra capabilities, limitations and goals in view?
I once did something of this sort for Java: + Java browser for Xcoral editor - in C + Bongo based class hierarchy browser - in Java You can find more about it on our web pages.
Jan
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Wed, Oct 25, 2000 at 09:03:43AM -0700, Doug Ransom wrote:
I would like to be able to inspect the type of things easily by hovering my mouse over an expression. As a beginner, I find it hard sometimes to get types correct in Haskell since often variables are not declared as a specific type.
Since you are typically dealing with incomplete programs in an editor this is really tough. The PSG system was able to generate such editors and I once saw it for the purely functional language Sample in action: you could mark any term with the mouse cursor and ask for its type. -- Christian @Article{Bahlke:1986:PSG, author = "Rolf Bahlke and Gregor Snelting", title = "The {PSG} System: From Formal Language Definitions to Interactive Programming Environments", journal = "ACM Transactions on Programming Languages and Systems", volume = "8", number = "4", pages = "547--576", month = oct, year = "1986", coden = "ATPSDT", ISSN = "0164-0925", bibdate = "Sat Jan 06 09:41:04 1996", url = "http://www.acm.org/pubs/toc/Abstracts/0164-0925/20890.html", abstract = "The PSG programming system generator developed at the Technical University of Darmstadt produces interactive, language-specific programming environments from formal language definitions. All language-dependent parts of the environment are generated from an entirely nonprocedural specification of the language's syntax, context conditions, and dynamic semantics. The generated environment consists of a language-based editor, supporting systematic program development by named program fragments, an interpreter, and a fragment library system. The major component of the environment is a full-screen editor, which allows both structure and text editing. In structure mode the editor guarantees prevention of both syntactic and semantic errors, whereas in textual semantic analysis which is based on unification. The algorithm will immediately detect semantic errors even in incomplete program fragments. The dynamic semantics of the language are defined in denotational style using a functional language based on the lambda calculus. Program fragments are compiled to terms of the functional language which are executed by an interpreter. The PSG generator has been used to produce environments for Pascal, ALGOL 60, MODULA-2, and the formal language definition language itself.", acknowledgement = ack-pb # " and " # ack-nhfb, keywords = "algorithms; design; documentation; languages; theory; theory and verification and Hybrid editor and unification-based incremental semantic analysis; verification", owner = "manning", review = "ACM CR 8711-0926", subject = "{\bf D.3.4}: Software, PROGRAMMING LANGUAGES, Processors, Compilers. {\bf D.2.3}: Software, SOFTWARE ENGINEERING, Coding, Program editors. {\bf D.2.6}: Software, SOFTWARE ENGINEERING, Programming Environments. {\bf D.3.1}: Software, PROGRAMMING LANGUAGES, Formal Definitions and Theory, Semantics. {\bf D.3.1}: Software, PROGRAMMING LANGUAGES, Formal Definitions and Theory, Syntax. {\bf D.2.3}: Software, SOFTWARE ENGINEERING, Coding, Pretty printers. {\bf F.3.2}: Theory of Computation, LOGICS AND MEANINGS OF PROGRAMS, Semantics of Programming Languages. {\bf F.4.2}: Theory of Computation, MATHEMATICAL LOGIC AND FORMAL LANGUAGES, Grammars and Other Rewriting Systems, Grammar types. {\bf F.4.2}: Theory of Computation, MATHEMATICAL LOGIC AND FORMAL LANGUAGES, Grammars and Other Rewriting Systems, Parsing. {\bf I.2.3}: Computing Methodologies, ARTIFICIAL INTELLIGENCE, Deduction and Theorem Proving, Deduction.", } -- Christian Lindig Harvard University - DEAS lindig@eecs.harvard.edu 33 Oxford St, MD 242, Cambridge MA 02138 phone: +1 (617) 496-7157 http://www.eecs.harvard.edu/~lindig/

On Wed, Oct 25, 2000 at 09:03:43AM -0700, Doug Ransom wrote:
I would like to be able to inspect the type of things easily by hovering my mouse over an expression. As a beginner, I find it hard sometimes to get types correct in Haskell since often variables are not declared as a specific type.
Since you are typically dealing with incomplete programs in an editor this is really tough. The PSG system was able to generate such editors and I once saw it for the purely functional language Sample in action: you could mark any term with the mouse cursor and ask for its type.
One of the emacs modes for Haskell gives the type of the identifier
the cursor is in in the modeline. It does this by examining the type
signatures in the current file, and having the prelude type signatures
built-in. This is quite helpful, if incomplete, and fairly easy to
implement.
--KW 8-)
--
Keith Wansbrough

Hi,
On Wed, Oct 25, 2000 at 09:03:43AM -0700, Doug Ransom wrote:
I would like to be able to inspect the type of things easily by hovering my mouse over an expression. As a beginner, I find it hard sometimes to get types correct in Haskell since often variables are not declared as a specific type.
Since you are typically dealing with incomplete programs in an editor this is really tough. The PSG system was able to generate such editors and I once saw it for the purely functional language Sample in action: you could mark any term with the mouse cursor and ask for its type.
One of the emacs modes for Haskell gives the type of the identifier the cursor is in in the modeline. It does this by examining the type signatures in the current file, and having the prelude type signatures built-in. This is quite helpful, if incomplete, and fairly easy to implement.
To increase its usefulness for multi-module programs, I have been planning for a long time to extract type info out of .hi files and feed it into the haskell-doc emacs module. Well, one day I may write an elisp parser to do that. In the meantime there is of course the possibility of pre-processing the Haskell source (or .hi) and feeding the type info as an elisp expression directly to haskell-doc. Here is the relevant bit from the docu: ;; If you want to define your own strings for some identifiers define an ;; alist of (ID . STRING) and set `haskell-doc-show-user-defined' to t. ;; E.g: ;; ;; (setq haskell-doc-show-user-defined t) ;; (setq haskell-doc-user-defined-ids ;; (list ;; '("main" . "just another pathetic main function") ;; '("foo" . "a very dummy name") ;; '("bar" . "another dummy name"))) Hope that helps, -- Hans Wolfgang
participants (4)
-
Christian Lindig
-
Doug Ransom
-
Hans Wolfgang Loidl
-
Keith Wansbrough