From HaskellWiki
Revision as of 14:35, 28 September 2006 by NeilMitchell (talk | contribs)

Jump to: navigation, search

There are quite a few Haskell compilers/interpretters, and on Windows they all want to be the default handler for .hs and .lhs files. This document prescribes how all the installers should work with regards to file paths. Hopefully this document can reach a concensus.

The compilers which are committed to implementing this standard are: Yhc, Hugs

User configuration

During install the user will be asked whether they want to register .hs/.lhs files to open with the compiler being installed. Yes will be the default. If the user picks no, then no changes will be made to the .lhs/.hs association settings.

File types

The Haskell file types are given as .hs and .lhs. They icon used shall be the top line of this image. These icons are available in the Hugs CVS repository in Windows .ico format (where?).

The file type description for each file shall be "Haskell Document".

Actions available

The actions available for each compiler shall be:

  • Open in <interpretter>

Where interpretter is an interactive environment, in the style of Hugs/GHCi/Yhe.

An additional action shall be available, Open, which will be the default. This will cause the Haskell file to open in an appropriate editor. The way an appropriate editor is determined is:

  • If prior to installing the compiler there is a default document handler for .hs/.lhs files, which is not one of the compilers adhereing to this standard, then that will be used.
  • If multiple compilers are installed, then each will give its own behaviour for the Open command. The following is a priority list of what the Open command should do - compilers should overwrite the existing setting if bound to a lower priority compiler, but not if bound to a higher priority one:
    1. WinHugs, opens using the sophisticated editor facilities, including auto-detection of appropriate editors and a configurable option
    2. GHCi, open using Notepad, unless someone can think of a better default.

i.e. installing WinHugs will overwrite GHC's configured Open command, installing GHC will not overwrite WinHugs' setting.

An entry should be added to the Explorer's New menu, giving Haskell Document as an option, which will create a .hs file.

Technical Implementation

Not much point in doing this section until everyone agrees on the end user behaviour!