1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
6 <article id="visual-haskell">
10 <title>Visual Haskell User's Guide</title>
12 <firstname>Simon</firstname>
13 <surname>Marlow</surname>
14 <email>simonmar@microsoft.com</email>
17 <firstname>Krasimir</firstname>
18 <surname>Angelov</surname>
19 <email>kr.angelov@gmail.com</email>
30 <section id="sec-introduction">
31 <title>Introduction</title>
33 <para>Visual Haskell is a plugin for Microsoft's Visual Studio
34 development environment to support development of Haskell software.
35 Like the other Visual languages, Visual Haskell integrates with the
36 Visual Studio editor to provide interactive features to aid Haskell
37 development, and it enables the construction of projects consisting of
38 multiple Haskell modules.</para>
40 <section id="sec-obtaining">
41 <title>Installing Visual Haskell</title>
43 <para>In order to use Visual Haskell, you need <ulink url="http://msdn.microsoft.com/vstudio/productinfo/">Visual Studio .NET
44 2003</ulink>. Right now, this is the only supported version of Visual
45 Studio - unfortunately we haven't yet added support for the 2005
46 Beta. The Express languages (Visual C++ Express etc.) also will not
47 work, because they don't have support for plugins.</para>
49 <para>You don't need to install GHC separately: Visual Haskell
50 is bundled with a complete GHC distribution, and various other tools
51 (Happy, Alex, Haddock).</para>
53 <para>The latest Visual Haskell installer can be obtained from
57 url="http://www.haskell.org/visualhaskell/"><literal>http://www.haskell.org/visualhaskell/</literal></ulink></para>
60 <section id="release-notes">
61 <title>Release Notes</title>
64 <title>Version 0.0, first release</title>
66 <para>This release is a technology preview, and should be considered
67 alpha quality. It works for us, but you are fairly likely to
68 encounter problems. If you're willing to try it out and report
69 bugs, we'd be grateful for the feedback.</para>
73 <para>This release of Visual Haskell is bundled with a
74 development snapshot of GHC, version 6.5 from around 14
75 September 2005. This version of GHC is used to provide the
76 interactive editing features, and will be used to compile all
77 code inside Visual Haskell. It is possible that in future
78 releases we may be able to relax this tight coupling between
79 Visual Haskell and the bundled GHC.</para>
81 <para>Please note that future releases of Visual
82 Haskell will update the compiler, and hence the
83 packages, and so may break your code. Also note that because
84 the bundled GHC is not a released version, it may have bugs and
85 quirks itself: please report them as usual to
86 <email>glasgow-haskell-bugs@haskell.org</email>.</para>
90 <para>We're not making source code for the plugin generally
91 available at this time, due to licensing restrictions on the
92 Visual Studio APIs that the plugin uses (for more
93 information see <ulink
94 url="http://msdn.microsoft.com/vstudio/extend/">Visual Studio
95 Extensibility Center</ulink>). If you're interested in
96 contributing to Visual Haskell, please get in touch with the
103 <section id="sec-bugs">
104 <title>Getting support, reporting bugs</title>
105 <para>Please report bugs to
106 <email>glasgow-haskell-bugs@haskell.org</email> (subscribe <ulink url="http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs">here</ulink>), clearly indicating
107 that your bug report relates to Visual Haskell, and giving as much
108 information as possible so that we can reproduce the bug. Even if
109 you can't reproduce the bug reliably, it is still useful to report
110 what you've seen.</para>
112 <para>For help and support, use the
113 <email>glasgow-haskell-users@haskell.org</email> (subscribe <ulink
114 url="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users">here</ulink>) mailing list.</para>
117 <section id="sec-license">
118 <title>License</title>
121 <para>Copyright © Microsoft Corporation. All rights reserved.</para>
122 <para>Copyright © The University of Glasgow. All rights reserved.</para>
123 <para>Copyright © Krasimir Angelov. All rights reserved.</para>
125 <para>Redistribution and use in source and binary forms, with or without
126 modification, are permitted provided that the following conditions
131 <para>Redistributions of source code must retain the above
132 copyright notice, this list of conditions and the following
137 <para>Redistributions in binary form must reproduce the above
138 copyright notice, this list of conditions and the following
139 disclaimer in the documentation and/or other materials provided
140 with the distribution.</para>
144 <para>The names of the copyright holders may not be used to endorse
145 or promote products derived from this software without specific
146 prior written permission.</para>
150 <para>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
151 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
152 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
153 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
154 COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
155 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
156 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
157 USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
158 AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
159 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
160 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
161 POSSIBILITY OF SUCH DAMAGE.</para>
167 <section id="sec-using">
168 <title>Using Visual Haskell</title>
171 <title>Overview of features</title>
173 <para>The following features are provided in the Visual Studio editor
174 when editing Haskell code:</para>
178 <para>Automatic checking of code as you type, and visual indication
179 of parse errors, scoping errors and type errors.</para>
183 <para>Quick info: hovering the mouse over an identifier pops up
184 an information box, including the type of the identifier.</para>
188 <para>A drop-down bar at the top of the editing window lists the
189 top-level declarations in the module, and allows quick navigation
190 to a declaration.</para>
194 <para>Name completion for identifiers in scope: press Ctrl+Space
195 after a partial identifier to see the completions.</para>
199 <para>Go to declaration: right clicking on an identifier and
200 selecting "Go to declaration" will jump the cursor to the
201 declaration of the identifier. This works for locally-defined
202 identifiers and those defined in another module of the project; it
203 does not work for library functions currently.</para>
207 <para>The following features are provided by the project system for
208 constructing Haskell projects:</para>
212 <para>Multi-module Haskell projects are fully supported, based on the
213 <ulink url="http://www.haskell.org/cabal">Cabal</ulink>
214 infrastructure. A project in Visual Haskell <emphasis>is</emphasis>
215 a Cabal package, and vice-versa. A Visual Studio project can be
216 taken to a machine without Visual Haskell and built/installed as a
217 normal Cabal package, and an existing Cabal package can be edited
218 directly in Visual Haskell<footnote><para>This works as long as the
219 Cabal package is using Cabal's simple build system; Cabal
220 packages using their own build systems cannot be edited in Visual
226 <para>Editing of most of the package meta-data is supported through
227 the project property pages.</para>
231 <para>The interactive editing features work across multiple modules in
232 a project. When one module is edited, changes are automatically
233 propagated to dependent modules, even if the edited module has not yet
238 <para>Building is supported through the Cabal build system, and build
239 errors are communicated back to the editor and placed in the task
240 list. Use any of the Visual Studio build commands (e.g. Build
241 Project from the context menu on the project, or Ctrl-Shift-B to
242 build the whole solution).</para>
247 <para>Additionally, Visual Haskell is bundled with a large collection of
248 documentation: the GHC manual, the hierarchical libraries reference, and
249 other material all of which can be browsed within Visual Studio
254 <title>Getting Started</title>
256 <para>After installing Visual Haskell, start up Visual Studio as you
257 would normally, and observe that on the splash screen where it lists
258 the supported languages you should now see an icon for Visual
259 Haskell (if you don't see this, something has gone wrong... please let
262 <para>Firstly, take a look at the bundled documentation. Go to
263 Help->Contents, and you should see the “Visual Haskell Help
264 Collection”, which contains a large collection of GHC and
265 Haskell-related documentaiton, including this document.</para>
267 <para>To start using Visual Haskell right away, create a new
268 project (File->New->Project...). Select one of the Haskell
269 project types (Console Application or Library Package), and hit Ok.
270 The project will be created for you, and an example module
271 added: <literal>Main.hs</literal> for an application, or
272 <literal>Module1.hs</literal> for a library.</para>
274 <para>You can now start adding code to
275 <literal>Main.hs</literal>, or adding new modules. To add a new
276 module, right-click on the <literal>src</literal> directory, and
277 select Add->New Item. Visual Haskell supports hierarchical
278 modules too: you can add new folders using the same Add menu to
279 create new nodes in the hierarchy.</para>
281 <para>If you have any errors in your code, they will be underlined with
282 a red squiggly line. Select the Tasks window (usually a tab near the
283 bottom of the Visual Studio window) to see the error messages, and
284 click on an error message to jump to it in the editor.</para>
286 <para>To build the program, hit Ctrl-Shift-B, or select one of the
287 options from the Build menu.</para>
291 <title>Editing Haskell code</title>
293 <para>(ToDo: more detail here)</para>
295 <para>Your module must be plain Haskell (<literal>.hs</literal>) for the interactive features to
296 fully work. If your module is pre-processed with CPP or Literate
297 Haskell, then Visual Haskell will only check the module when it is
298 saved; between saves the source will not be checked for errors and
299 the type information will not be updated. If the source file is
300 pre-processed with Happy or another pre-processor, then you may have
301 to build the project before the type information will be updated
302 (because the pre-processor is only run as part of the build
303 process). Pre-processed source files work fine in a multi-module
304 setting; you can have modules which depend on a pre-processed module
305 and full interactive checking will still be available in those
308 <para>Because Visual Haskell is using GHC as a backend for its
309 interactive editing features, it supports the full GHC language,
310 including all extensions.</para>
314 <title>Using Projects</title>
315 <para>(ToDo: more detail here)</para>