You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(127) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
|
Mar
(35) |
Apr
(23) |
May
|
Jun
(1) |
Jul
(48) |
Aug
(23) |
Sep
(10) |
Oct
(4) |
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
(27) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
2007 |
Jan
|
Feb
(16) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(19) |
Oct
(25) |
Nov
(8) |
Dec
(25) |
2009 |
Jan
(6) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(25) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Andre P. <at...@us...> - 2004-05-16 17:04:32
|
Update of /cvsroot/hoc/www In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8604 Modified Files: examples.html Log Message: Updated MVC link Index: examples.html =================================================================== RCS file: /cvsroot/hoc/www/examples.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- examples.html 16 May 2004 16:20:16 -0000 1.2 +++ examples.html 16 May 2004 17:04:22 -0000 1.3 @@ -37,7 +37,7 @@ more of a learning curve to use HOC for writing GUIs, because Cocoa enforces good design by separating your application logic cleanly using design patterns such as <a - href="http://developer.apple.com/documentation/Cocoa/Conceptual/ObjCTutorial/chapter02/chapter_2_section_3.html">Model-View-Controller</a> + href="http://developer.apple.com/documentation/Cocoa/Conceptual/AppArchitecture/Concepts/MVC.html#//apple_ref/doc/uid/20000919">Model-View-Controller</a> (which we will use in this example). So, while this quick tour may seem a bit longer than you expect, the really good news is that Cocoa's design patterns <em>scale</em> very well: writing a small GUI may take 50-100 lines of code, |
From: Andre P. <at...@us...> - 2004-05-16 16:21:57
|
Update of /cvsroot/hoc/hoc/Samples/ExpressionParser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32255 Modified Files: EPController.hs Log Message: Simplied expression parser sample code Index: EPController.hs =================================================================== RCS file: /cvsroot/hoc/hoc/Samples/ExpressionParser/EPController.hs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- EPController.hs 16 May 2004 08:47:33 -0000 1.2 +++ EPController.hs 16 May 2004 16:21:49 -0000 1.3 @@ -7,9 +7,6 @@ import Selectors import Text.ParserCombinators.Parsec (parse) -import GHC.Ptr -import HOC.Base - $(declareClass "EPController" "NSObject") $(exportClass "EPController" "ep_" @@ -22,14 +19,10 @@ obj #. var = obj # getIVar var ep_evaluateExpression _ self = do - expressionTextField <- (self #. _expressionEntry) - expression <- expressionTextField # stringValue >>= haskellString - evaluation <- self #. _evaluation + expression <- self #. _expressionEntry >>= stringValue >>= haskellString case (parse expr "" expression) of - Left err -> - self #. _evaluation >>= - setStringValue (toNSString $ "Error " ++ show err) + Left e -> + self #. _evaluation >>= setStringValue (toNSString $ "Error " ++ show e) Right answer -> - self #. _evaluation >>= - setStringValue (toNSString $ show answer) + self #. _evaluation >>= setStringValue (toNSString $ show answer) |
From: Andre P. <at...@us...> - 2004-05-16 16:20:26
|
Update of /cvsroot/hoc/www In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31552 Modified Files: examples.html hoc.css index.html screenshots.html tab-download-selected.png Added Files: download.html Log Message: Miscellaneous webpage updates Added Downloads page Completed Examples page Fix "Selected Downloads" graphic --- NEW FILE: download.html --- <!--#set var="title" value="Download" --> <!--#set var="active-tab" value="Download" --> <!--#include virtual="/templates.hoc/header.shtml" --> <h1>Requirements</h1> <p>As with most Haskell libraries & tools, we currently provide HOC as a build-it-yourself source distribution tarball. To build HOC, you will need:</p> <ul> <li><p>Mac OS X "Panther" 10.3.x. HOC may also work with Mac OS X 10.2 "Jaguar", but has not been tested with it.</p></li> <li><p>The Mac OS X Developer Tools installed.</p> <li><p><a href="http://www.haskell.org/ghc/">GHC</a> (the Glasgow Haskell Compiler) 6.2, or 6.2.1.</p></li> </ul> <p>HOC has also been very lightly tested with Linux and GNUstep, but this is not the main development platform, so please do not expect much to work. :-)</p> <h1>Releases</h1> All HOC releases are made available via Sourceforge, and may also be downloaded from its <a href="http://sourceforge.net/project/showfiles.php?group_id=93369">project releases</a> page. <div class="inner-box"> <table align="center" width="100%" border="0"> <tr valign="top"> <th align="left">Version</th> <th> </th> <th align="left">Brief description</th> </tr> <tr valign="top"> <td nowrap>1.0 RC1 (release notes)</td> <td></td> <td>Major changes: <em>typed interface</em>, memory management, update to GHC and GHCi 6.2 support, documentation (gasp!), and lots more …</td> </tr> <tr valign="top"> <td nowrap><a href="http://prdownloads.sourceforge.net/hoc/HOC020103.tar.bz2?download">0.1</a> (<a href="http://sourceforge.net/project/shownotes.php?release_id=238704">release notes</a>)</td> <td></td> <td>First development snapshot; more an experiment into Template Haskell than anything else (for historical interest only).</td> </tr> </table> </div> <!--#include virtual="/templates.hoc/footer.shtml" --> Index: index.html =================================================================== RCS file: /cvsroot/hoc/www/index.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- index.html 16 May 2004 08:49:29 -0000 1.4 +++ index.html 16 May 2004 16:20:16 -0000 1.5 @@ -1,61 +1,54 @@ -<!--#set var="title" value="- A Haskell to Objective-C Binding" --> +<!--#set var="title" value="A Haskell to Objective-C Binding" --> <!--#set var="active-tab" value="Home" --> <!--#set var="big-logo" value="yes" --> <!--#include virtual="/templates.hoc/header.shtml" --> - <h1>About</h1> +<h1>About</h1> - <p>HOC is a <strong>H</strong>askell to - <strong>O</strong>bjective-<strong>C</strong> - binding. In a nutshell, it enables you to use - Objective-C objects and frameworks from Haskell, and - also enables you to write Objective-C objects in - Haskell.</p> +<p>HOC is a <strong>H</strong>askell to +<strong>O</strong>bjective-<strong>C</strong> binding. In a nutshell, it +enables you to use Objective-C objects and frameworks from Haskell, and also +enables you to write Objective-C objects in Haskell.</p> - <p>The Haskell interfaces produced by HOC are:</p> +<p>The Haskell interfaces produced by HOC are:</p> - <ul> +<ul> - <li><strong>Strongly Typed</strong>: Take advantage - of Haskell's sound type inference to help you - develop robust, correct Cocoa/GNUstep applications - on your first compile.</li> + <li><strong>Typed</strong>: Take advantage of Haskell's sound type inference + to help you develop robust, correct Cocoa/GNUstep applications on your first + compile.</li> - <li><strong>Automatically Generated</strong>: HOC - comes with an <em>interface generator</em> to - generate Haskell bindings to Objective-C's objects; - use it even with your own custom Objective-C - frameworks!</li> + <li><strong>Automatically Generated</strong>: HOC comes with an <em>interface + generator</em> to generate Haskell bindings to Objective-C's objects; use it +even with your own custom Objective-C frameworks!</li> - <li><strong>Haskell-Friendly</strong>: We make - heavy use of key Haskell features such as type - classes and partial evaluation, to ensure that the - HOC API is as 'Haskell-like' as possible.</li> + <li><strong>Haskell-Friendly</strong>: We make heavy use of key Haskell + features such as type classes and partial application, to ensure that the HOC + API is as 'Haskell-like' as possible.</li> - </ul> +</ul> - <p>You can use HOC to write full-blown GUI - applications using Mac OS X's advanced Cocoa - framework.</p> +<p>You can use HOC to write full-blown GUI applications using Mac OS X's +advanced Cocoa framework.</p> - <h1>News</h1> +<h1>News</h1> - <p><strong>Friday, 14 May 2004</strong>:<br/> HOC - 0.2 released.</p> +<p>Friday, 14 May 2004: <strong>HOC 0.2 released</strong>.</p> - <p><strong>Thursday, 2 Jan 2003</strong>:<br/> HOC - 0.1 released. See the <a - href="http://www.haskell.org/pipermail/glasgow-haskell-users/2003-January/004602.html">full - release announcement</a>, or download it - here.</p> +<p>Thursday, 2 Jan 2003: <strong>HOC 0.1 released</strong>. See the <a + href="http://www.haskell.org/pipermail/glasgow-haskell-users/2003-January/004602.html">full + release announcement</a>, or <a + href="http://prdownloads.sourceforge.net/hoc/HOC020103.tar.bz2?download">download + it</a> here.</p> - </ul> - <h1>License</h1> +</p> - <p>In the spirit of the Haskell and Mac OS X open-source - communities, HOC is provided under the liberal BSD license.</p> +<h1>License</h1> + +<p>In the spirit of the Haskell and Mac OS X open-source communities, HOC is +provided under the liberal BSD license.</p> <!--#include virtual="/templates.hoc/footer.shtml" --> Index: tab-download-selected.png =================================================================== RCS file: /cvsroot/hoc/www/tab-download-selected.png,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 Binary files /tmp/cvsFAh8F3 and /tmp/cvsgzWiaV differ Index: hoc.css =================================================================== RCS file: /cvsroot/hoc/www/hoc.css,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- hoc.css 16 May 2004 08:42:15 -0000 1.2 +++ hoc.css 16 May 2004 16:20:16 -0000 1.3 @@ -29,6 +29,15 @@ align: center; } +ul { + /* same as inner-box */ + margin: 12px 12px; + padding: 12px 35px 12px 35px; + border: 1px solid #BDBDBD; + background-image: url("bg-stripes-dark.png"); + background-repeat: repeat; +} + li { margin: 8px 0; } Index: screenshots.html =================================================================== RCS file: /cvsroot/hoc/www/screenshots.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- screenshots.html 16 May 2004 08:42:15 -0000 1.1 +++ screenshots.html 16 May 2004 16:20:16 -0000 1.2 @@ -8,8 +8,7 @@ <h2>A Text Editor</h2> <p>Here's the canonical GUI text editor application, implemented in about 50 -lines of Haskell code. The code for this is distributed in HOC's -<code>Samples/</code> source distribution.</p> +lines of Haskell code.</p> <p class="center"> <a href="screenshots/Editor.png" class="plain"> @@ -51,7 +50,7 @@ lines for the expression parsing code, and ~50 lines for the GUI.</p> <p> -<table align="center" border="0"> +<table align="center" border="0" cellpadding="4"> <tr> <td> <img src="screenshots/ExpressionParser.png" class="bordered"> Index: examples.html =================================================================== RCS file: /cvsroot/hoc/www/examples.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- examples.html 16 May 2004 08:42:15 -0000 1.1 +++ examples.html 16 May 2004 16:20:16 -0000 1.2 @@ -3,32 +3,74 @@ <!--#include virtual="/templates.hoc/header.shtml" --> -<h1>Cocoa Examples</h1> +<h1>Adding a GUI to an Expression Parser</h1> -<h2>Adding a GUI to an Expression Parser</h2> +<p>You've probably seen many examples of Haskell GUI libraries which show you +how to create a simple graphical application that has a cute little button +which prints "Hello, world!" when you click on it. Well, we'd show you that, +but the truth is it's so easy to do with Cocoa that it'd just be boring (as +well as being useless). So, let's do something a bit more practical with our +first example: our mission is to put a simple GUI around a basic Haskell +program, which is something you're more likely to be interested in.</p> -<p>You've probably seen many examples of Haskell GUI libraries -which show you how to create a simple graphical application with -menus, and a cute little button that prints "Hello, world!" when -you click on it:</p> +<p>For this quick tour, let's write a GUI program that allows a user to type in +arithmetic expressions (e.g. <code>2+5</code> or <code>69*33/3+15</code>), and +print its result. Something like this will do:</p> -TODO: Insert picture +<p> +<table align="center" border="0" cellpadding="4"> + <tr> + <td> + <img src="screenshots/ExpressionParser.png" class="bordered"> + </td> -<p>Well, we'd show you that, but the truth is it's so easy to do -with Cocoa that it'd just be boring. (Really!) So, let's do -something a bit more practical with our first example: put a simple -GUI around a basic Haskell program, which is something you're more -likely to be interested in.</p> + <td> + <img src="screenshots/ExpressionParser_error.png" class="bordered"> + </td> + </tr> +</table> +</p> -<p>Let's assume that you've written a useful Haskell module: say -a simple calculator (or <em>expression parser</em>). To do this, -we could use Daan Leijen's most excellent <a - href="http://www.cs.uu.nl/~daan/parsec.html">Parsec</a> parser -combinator library. In fact, Parsec comes with such excellent -documentation that it even gives <a +<h2>Preface</h2> + +<p>In comparison to other GUI toolkits available for Haskell, there's a bit +more of a learning curve to use HOC for writing GUIs, because Cocoa enforces +good design by separating your application logic cleanly using design patterns +such as <a + href="http://developer.apple.com/documentation/Cocoa/Conceptual/ObjCTutorial/chapter02/chapter_2_section_3.html">Model-View-Controller</a> +(which we will use in this example). So, while this quick tour may seem a bit +longer than you expect, the really good news is that Cocoa's design patterns +<em>scale</em> very well: writing a small GUI may take 50-100 lines of code, +but writing a much bigger, fancy GUI with lots of widgets and controls may only +take 100-200 lines rather than 500-1000, because much of the GUI code is +handled for you by Interface Builder's target-action/outlet design. In Mac OS +X Panther, you can even use <a + href="http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/CocoaBindings.html">Cocoa + Bindings</a> with your Haskell application, and cut down your code size even +further.</p> + +<p>Note that HOC is also a lower-level binding than higher-level GUI toolkits +such as <a + href="http://www.cs.chalmers.se/ComputingScience/Research/Functional/Fudgets/">Fudgets</a> +or even <a href="http://wxhaskell.sourceforge.net/">wxHaskell</a>: it is really +a bridge which enables you to use Objective-C objects from Haskell (and thus +gives you much more functionality than simply being able to write GUIs!). In +the future, we hope to layer a higher-level interface on top of HOC to provide +a more functional API, so you're not forced into imperative style of coding as +you would write Objective-C code. Even so, the Cocoa framework is so well +designed that the resulting imperative code is still far shorter than it would +be compared to most other frameworks .</p> + +<h2>The Model: an Arithmetic Expression Parser</h2> + +<p>Our first step is to write the arithmetic expression parser. To do this, we +could use Daan Leijen's most excellent <a + href="http://www.cs.uu.nl/~daan/parsec.html">Parsec</a> parser combinator +library. In fact, Parsec comes with such excellent documentation that it even +gives <a href="http://www.cs.uu.nl/~daan/download/parsec/parsec.html#Expressions">example - code</a> which shows how to do this. So, imagine the following -code is in an <code>ExpressionParser.hs</code> Haskell module:</a> + code</a> which shows how to do this. So, imagine the following code is in an +<code>ExpressionParser.hs</code> Haskell module:</a> <div class="inner-box"> <pre>module ExpressionParser @@ -67,8 +109,160 @@ </div> <p>So, you have a working expression parser. Unfortunately, you have to to run -this from GHCI. Wouldn't it be nicer if you could run it from a Haskell GUI -instead?</p> +this from GHCi to use it. You could write a command-line interface to it, but +wouldn't it be nicer if you could run it from a Haskell GUI instead?</p> + +<h2>The View: a GUI for the Expression Parser</h2> + +<p>Now that you've written the model, it's time to write the <em>view</em>, +which lets the user interact with the model by clicking on buttons, selecting +menu items, and all that fancy GUI stuff. Luckily, the Cocoa framework on Mac +OS X makes this quite trivial: instead of writing tedious layout code to draw +the view, set up the menus, etc., we use <a + href="http://developer.apple.com/tools/interfacebuilder/">Interface + Builder</a>, a GUI design tool. Briefly, the steps involved with Interface +Builder are:</p> + +<ul> + + <li>Drag the text fields and buttons from the Cocoa Controls palette into + your window.</li> + + <li>Tell Interface Builder that you'll be writing a class called + <code>EPController</code> to handle events such as the user clicking on + buttons. To do this, you simply subclass and instantiate the + <code>NSObject</code> class (the root of all of Cocoa's classes) in Interface + Builder's Classes window.</li> + + <li>Add two <em>outlets</em> to the <code>EPController</code> class, which + are pointers to the two text fields in the window. This enables your + controller class to read the user's typed-in expression from the first text + field, and write its output to the second text field.</li> + + <li>Add an <em>action</em> to the <code>EPController</code> class, which + contains the expression-evaluation code that will run when the user clicks on + the "Evaluate" button (or presses the <em>Enter</em> key in the input text + field).</li> + + <li><em>Connect</em> the text fields to <code>EPController</code>'s outlets + by Ctrl-dragging from the instantiated <code>EPController</code> object to + the text field, and setting the outlet appropriately. You also want to + connect the Evaluate button and text field entry to + <code>EPController</code>'s, again by Ctrl-dragging from them to the + instantiated <code>EPController</code> object icon.</li> + +</ul> + +<p>That's it: your view's done. You could write all this code programmatically +of course, but why bother? Interface Builder allows you to add GUIs to your +code very rapidly, and also handles issues such as window re-sizing elegantly. +(This is often quoted as a reason to manually write code—so you can use +a geometry manager—rather than using a GUI designer tool. Truth is, +Cocoa and Interface Builder's re-sizing controls are so easy and powerful that +you'll very rarely have to write any geometry management code—I've +<em>never</em> had to, even when writing a full-fledged media player +application!) Here's a screenshot of what Interface Builder will look like as +you're designing your view with it:</p> + +<p class="center" align="center"> +<a href="screenshots/ExpressionParser_view.png" class="plain"> + <img src="screenshots/ExpressionParser_view.png" width="90%"> +</a> +</p> + +<p class="center" align="center"> +<a href="screenshots/ExpressionParser_view.png"> + (Click to enlarge.) +</a> +<p> + +<h2>The Controller: Handling User Interaction</h2> + +<p>Now that you've written the model and the view, it's time to write the +<em>controller</em>, which the view sends messages to in response to user +interactions. The controller is responsible for calling the appopriate +functions in the model, and delivering the model's outputs to the view. In +this case, that means delivering the expression the user typed in to the +<code>ExpressionParser</code> module's parsing code, taking the parser's +output, and displaying that back in the view.</p> + +<p>HOC enables you to write the controller's code in pure Haskell: first, you +need to write a <code>Selectors.hs</code> file which declares all the +<em>selectors</em> (method names) that you will be using:</p> + +<div class="inner-box"> +<pre>{-# OPTIONS -fglasgow-exts #-} + +module Selectors where + +import AppKit.NSButton + +$(declareSelector "evaluateExpression:" [t| forall a. NSButton a -> IO () |]) +</pre> +</div> + +<p>This enables better static checking of method names, and prevents scenarios +such as pondering why your method wasn't being called when you actually +misspelled it (which can happen with Objective-C). After this, it's time to +write the controller code:</p> + +<div class="inner-box"> +<pre>{-# OPTIONS -fglasgow-exts #-} + +module EPController where + +import Cocoa hiding (parse) +import ExpressionParser +import Selectors +import Text.ParserCombinators.Parsec (parse) + +$(declareClass "EPController" "NSObject") + +$(exportClass "EPController" "ep_" + [ Outlet "expressionEntry" [t| NSTextField () |] + , Outlet "evaluation" [t| NSTextField () |] + , InstanceMethod Selectors.info_evaluateExpression ]) + +obj #. var = obj # getIVar var + +ep_evaluateExpression _ self = do + -- Get the expressionEntry outlet text field from this object, and get + -- what the user typed as a Haskell string + expression <- self #. _expressionEntry >>= stringValue >>= haskellString + -- Parse the expression + case (parse expr "" expression) of + Left err -> + -- Parsing returned an error: display it in the output text field + self #. _evaluation >>= setStringValue (toNSString $ "Error " ++ show err) + Right answer -> + -- Parsing was successful: display the answer + self #. _evaluation >>= setStringValue (toNSString $ show answer) +</pre> +</div> + +<p>That's it: you've just added a pretty GUI to your expression parser. Once +again, here's what the result looks like:</p> + +<p> +<table align="center" border="0" cellpadding="4"> + <tr> + <td> + <img src="screenshots/ExpressionParser.png" class="bordered"> + </td> + + <td> + <img src="screenshots/ExpressionParser_error.png" class="bordered"> + </td> + </tr> +</table> +</p> + +<p>Of course, this is only a quick overview on how to use HOC: this brief look +at HOC is expanded upon in the HOC <a + href="documentation.html">documentation</a>, where we describe the exact +steps involved in building this arithmetic expression parser. We hope that +this example gives you an idea of how you can use HOC to easily implement a GUI +for your existing Haskell applications!</p> <!--#include virtual="/templates.hoc/footer.shtml" --> |
From: Andre P. <at...@us...> - 2004-05-16 16:20:26
|
Update of /cvsroot/hoc/www/templates.hoc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31552/templates.hoc Modified Files: header.shtml Log Message: Miscellaneous webpage updates Added Downloads page Completed Examples page Fix "Selected Downloads" graphic Index: header.shtml =================================================================== RCS file: /cvsroot/hoc/www/templates.hoc/header.shtml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- header.shtml 16 May 2004 08:42:16 -0000 1.1 +++ header.shtml 16 May 2004 16:20:16 -0000 1.2 @@ -1,7 +1,7 @@ <html> <head> - <title>HOC <!--#echo var="title" --></title> + <title>HOC: <!--#echo var="title" --></title> </head> <style type="text/css" media="screen">@import "hoc.css";</style> @@ -79,9 +79,13 @@ <!-- Download --> <td border="0"> + <!--#if expr="${active-tab} = Download" --> + <img src="tab-download-selected.png" alt="Download" border="0"> + <!--#else --> <a href="download.html" class="plain"> <img src="tab-download.png" alt="Download" border="0"> </a> + <!--#endif --> </td> <!--#if expr="${active-tab} = Download || ${active-tab} = Examples" --> |
From: Andre P. <at...@us...> - 2004-05-16 16:20:26
|
Update of /cvsroot/hoc/www/screenshots In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31552/screenshots Added Files: ExpressionParser_view.png Log Message: Miscellaneous webpage updates Added Downloads page Completed Examples page Fix "Selected Downloads" graphic --- NEW FILE: ExpressionParser_view.png --- (This appears to be a binary file; contents omitted.) |
From: Andre P. <at...@us...> - 2004-05-16 08:49:38
|
Update of /cvsroot/hoc/www In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3538 Modified Files: index.html Log Message: Use SSI-generated footer, rather than hardcoded footer Index: index.html =================================================================== RCS file: /cvsroot/hoc/www/index.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- index.html 16 May 2004 08:42:15 -0000 1.3 +++ index.html 16 May 2004 08:49:29 -0000 1.4 @@ -57,18 +57,5 @@ <p>In the spirit of the Haskell and Mac OS X open-source communities, HOC is provided under the liberal BSD license.</p> - </div> - </div> - - </div> - - <p align="right"><a href="http://sourceforge.net/" class="plain"> <img - src="http://sourceforge.net/sflogo.php?group_id=93369&type=5" - width="210" height="62" border="0" alt="SourceForge.net Logo" /> </a></p> - - </div> - -</body> - -</html> +<!--#include virtual="/templates.hoc/footer.shtml" --> |
From: Andre P. <at...@us...> - 2004-05-16 08:47:44
|
Update of /cvsroot/hoc/hoc/Samples/ExpressionParser/Contents/Resources/English.lproj In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2948/Contents/Resources/English.lproj Added Files: InfoPlist.strings Log Message: Renamed "evaluate" selector to "evaluteExpression" (to avoid conflicts with existing Cocoa names) Added ExpressionParser.nib file --- NEW FILE: InfoPlist.strings --- (This appears to be a binary file; contents omitted.) |
From: Andre P. <at...@us...> - 2004-05-16 08:47:44
|
Update of /cvsroot/hoc/hoc/Samples/ExpressionParser/Contents/Resources/English.lproj/ExpressionParser.nib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2948/Contents/Resources/English.lproj/ExpressionParser.nib Added Files: classes.nib info.nib keyedobjects.nib objects.nib Log Message: Renamed "evaluate" selector to "evaluteExpression" (to avoid conflicts with existing Cocoa names) Added ExpressionParser.nib file --- NEW FILE: info.nib --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>IBDocumentLocation</key> <string>69 10 356 240 0 0 1280 832 </string> <key>IBEditorPositions</key> <dict> <key>29</key> <string>69 255 318 44 0 0 1280 832 </string> </dict> <key>IBFramework Version</key> <string>349.0</string> <key>IBOpenObjects</key> <array> <integer>21</integer> <integer>29</integer> </array> <key>IBSystem Version</key> <string>7F44</string> </dict> </plist> --- NEW FILE: objects.nib --- (This appears to be a binary file; contents omitted.) --- NEW FILE: classes.nib --- { IBClasses = ( { ACTIONS = {evaluateExpression = id; }; CLASS = EPController; LANGUAGE = ObjC; OUTLETS = {evaluation = id; expressionEntry = id; }; SUPERCLASS = NSObject; }, {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; } ); IBVersion = 1; } --- NEW FILE: keyedobjects.nib --- (This appears to be a binary file; contents omitted.) |
From: Andre P. <at...@us...> - 2004-05-16 08:47:43
|
Update of /cvsroot/hoc/hoc/Samples/ExpressionParser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2948 Modified Files: EPController.hs Selectors.hs Log Message: Renamed "evaluate" selector to "evaluteExpression" (to avoid conflicts with existing Cocoa names) Added ExpressionParser.nib file Index: EPController.hs =================================================================== RCS file: /cvsroot/hoc/hoc/Samples/ExpressionParser/EPController.hs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- EPController.hs 14 May 2004 15:34:31 -0000 1.1 +++ EPController.hs 16 May 2004 08:47:33 -0000 1.2 @@ -2,29 +2,34 @@ module EPController where -import Cocoa hiding (parse, info_evaluate, ImpType_evaluate) +import Cocoa hiding (parse) import ExpressionParser import Selectors import Text.ParserCombinators.Parsec (parse) +import GHC.Ptr +import HOC.Base + $(declareClass "EPController" "NSObject") $(exportClass "EPController" "ep_" [ Outlet "expressionEntry" [t| NSTextField () |] , Outlet "evaluation" [t| NSTextField () |] - , InstanceMethod Selectors.info_evaluate + , InstanceMethod Selectors.info_evaluateExpression ] ) obj #. var = obj # getIVar var -ep_evaluate _ self = do +ep_evaluateExpression _ self = do expressionTextField <- (self #. _expressionEntry) expression <- expressionTextField # stringValue >>= haskellString evaluation <- self #. _evaluation case (parse expr "" expression) of Left err -> - self #. _evaluation >>= setStringValue (toNSString "(error)") + self #. _evaluation >>= + setStringValue (toNSString $ "Error " ++ show err) Right answer -> - self #. _evaluation >>= setStringValue (toNSString $ show answer) + self #. _evaluation >>= + setStringValue (toNSString $ show answer) Index: Selectors.hs =================================================================== RCS file: /cvsroot/hoc/hoc/Samples/ExpressionParser/Selectors.hs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Selectors.hs 14 May 2004 15:34:31 -0000 1.1 +++ Selectors.hs 16 May 2004 08:47:33 -0000 1.2 @@ -4,5 +4,5 @@ import AppKit.NSButton -$(declareSelector "evaluate:" [t| forall a. NSButton a -> IO () |]) +$(declareSelector "evaluateExpression:" [t| forall a. NSButton a -> IO () |]) |
From: Andre P. <at...@us...> - 2004-05-16 08:47:43
|
Update of /cvsroot/hoc/hoc/Samples/ExpressionParser/Contents In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2948/Contents Added Files: Info.plist PkgInfo Log Message: Renamed "evaluate" selector to "evaluteExpression" (to avoid conflicts with existing Cocoa names) Added ExpressionParser.nib file --- NEW FILE: Info.plist --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleExecutable</key> <string>App</string> <key>CFBundleIconFile</key> <string></string> <key>CFBundleIdentifier</key> <string>net.sourceforge.hoc.expressionparser</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>0.1</string> <key>NSMainNibFile</key> <string>ExpressionParser</string> <key>NSPrincipalClass</key> <string>NSApplication</string> </dict> </plist> --- NEW FILE: PkgInfo --- APPL???? |
From: Andre P. <at...@us...> - 2004-05-16 08:46:31
|
Update of /cvsroot/hoc/hoc/Samples/ExpressionParser/Contents/Resources/English.lproj/ExpressionParser.nib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2855/ExpressionParser.nib Log Message: Directory /cvsroot/hoc/hoc/Samples/ExpressionParser/Contents/Resources/English.lproj/ExpressionParser.nib added to the repository |
From: Andre P. <at...@us...> - 2004-05-16 08:46:11
|
Update of /cvsroot/hoc/hoc/Samples/ExpressionParser/Contents/Resources/English.lproj In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2764/English.lproj Log Message: Directory /cvsroot/hoc/hoc/Samples/ExpressionParser/Contents/Resources/English.lproj added to the repository |
From: Andre P. <at...@us...> - 2004-05-16 08:45:59
|
Update of /cvsroot/hoc/hoc/Samples/ExpressionParser/Contents/Resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2720/Resources Log Message: Directory /cvsroot/hoc/hoc/Samples/ExpressionParser/Contents/Resources added to the repository |
From: Andre P. <at...@us...> - 2004-05-16 08:45:32
|
Update of /cvsroot/hoc/hoc/Samples/ExpressionParser/Contents In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2640/Contents Log Message: Directory /cvsroot/hoc/hoc/Samples/ExpressionParser/Contents added to the repository |
From: Andre P. <at...@us...> - 2004-05-16 08:42:24
|
Update of /cvsroot/hoc/www/templates.hoc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1857/templates.hoc Added Files: .htaccess footer.shtml header.shtml Log Message: Switched webpages to use Apache server-side includes (SSI) rather than duplicating header/footer information in every HTML file Added Screenshots page Added Examples page --- NEW FILE: .htaccess --- # Turn on Server-Side Includes (SSI) and indexes Options Indexes +Includes # SSI support for .shtml files AddType text/html .shtml AddHandler server-parsed .shtml # SSI support for +x'ed .html files: # See http://httpd.apache.org/docs/howto/ssi.html XBitHack Full --- NEW FILE: header.shtml --- <html> <head> <title>HOC <!--#echo var="title" --></title> </head> <style type="text/css" media="screen">@import "hoc.css";</style> <body> <div id="mainBox" class="main-box"> <div class="content-box"> <!-- Logo --> <div class="logo-box"> <!--#if expr="${big-logo} = yes" --> <table width="100%" cellpadding="4" cellspacing="4"> <tr> <td border="0" rowspan="2"> <img src="HOC-Logo.png"> </td> <td align="center"> <font size="+4"><strong>HOC:</strong></font> </td> </tr> <th align="center"> <font size="+3">A Haskell to Objective-C Binding</a> </th> </table> <!--#else --> <table align="center" width="100%" cellpadding="4" cellspacing="4"> <tr> <td border="0" align="right"> <img src="HOC-Small-Logo.png"> </td> <td align="center"> <font size="+3">HOC: A Haskell to Objective-C Binding</font> </td> </tr> </table> <!--#endif --> </div> <!-- Tabs --> <div class="tab-box"> <table align="center" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"> <!-- Home --> <!--#if expr="${active-tab} = Home" --> <td><img src="tab-start-selected.png" alt="" border="0"></td> <td border="0"> <img src="tab-home-selected.png" alt="Home" border="0"> </td> <!--#else --> <td><img src="tab-start.png" alt="" border="0"></td> <td border="0"> <a href="index.html" class="plain"> <img src="tab-home.png" alt="Home" border="0"> </a> </td> <!--#endif --> <!--#if expr="${active-tab} = Home || ${active-tab} = Download" --> <td><img src="tab-divisor-selected.png" alt=" | " border="0"></td> <!--#else --> <td><img src="tab-divisor.png" alt=" | " border="0"></td> <!--#endif --> <!-- Download --> <td border="0"> <a href="download.html" class="plain"> <img src="tab-download.png" alt="Download" border="0"> </a> </td> <!--#if expr="${active-tab} = Download || ${active-tab} = Examples" --> <td><img src="tab-divisor-selected.png" alt=" | " border="0"></td> <!--#else --> <td><img src="tab-divisor.png" alt=" | " border="0"></td> <!--#endif --> <!-- Examples --> <td border="0"> <!--#if expr="${active-tab} = Examples" --> <img src="tab-examples-selected.png" alt="Examples" border="0"> <!--#else --> <a href="examples.html" class="plain"> <img src="tab-examples.png" alt="Examples" border="0"> </a> <!--#endif --> </td> <!--#if expr="${active-tab} = Examples || ${active-tab} = Screenshots" --> <td><img src="tab-divisor-selected.png" alt=" | " border="0"></td> <!--#else --> <td><img src="tab-divisor.png" alt=" | " border="0"></td> <!--#endif --> <!-- Screenshots --> <td border="0"> <!--#if expr="${active-tab} = Screenshots" --> <img src="tab-screenshots-selected.png" alt="Screenshots" border="0"> <!--#else --> <a href="screenshots.html" class="plain"> <img src="tab-screenshots.png" alt="Screenshots" border="0"> </a> <!--#endif --> </td> <!--#if expr="${active-tab} = Screenshots || ${active-tab} = Documentation" --> <td><img src="tab-divisor-selected.png" alt=" | " border="0"></td> <!--#else --> <td><img src="tab-divisor.png" alt=" | " border="0"></td> <!--#endif --> <!-- Documentation --> <td border="0"> <!--#if expr="${active-tab} = Documentation" --> <img src="tab-documentation-selected.png" alt="Documentation" border="0"> <!--#else --> <a href="documentation.html" class="plain"> <img src="tab-documentation.png" alt="Documentation" border="0"> </a> <!--#endif --> </td> <!--#if expr="${active-tab} = Documentation || ${active-tab} = Support" --> <td><img src="tab-divisor-selected.png" alt=" | " border="0"></td> <!--#else --> <td><img src="tab-divisor.png" alt=" | " border="0"></td> <!--#endif --> <!-- Support --> <td border="0"> <!--#if expr="${active-tab} = Support" --> <img src="tab-support-selected.png" alt="Support" border="0"> <!--#else --> <a href="support.html" class="plain"> <img src="tab-support.png" alt="Support" border="0"> </a> <!--#endif --> </td> <!--#if expr="${active-tab} = Support" --> <td border="0"><img src="tab-end-selected.png" alt="" border="0"></td> <!--#else --> <td border="0"><img src="tab-end.png" alt="" border="0"></td> <!--#endif --> </tr> </table> <div class="firstpage"> --- NEW FILE: footer.shtml --- </div> </div> </div> <p><table width="100%" cellpadding="0" cellspacing="0"> <tr> <td align="left" valign="top"> <font size="-1"> <!--#config timefmt="%A, %B %d %Y (%H:%M %z)" --> Last updated on <!--#echo var="LAST_MODIFIED" --> </font> </td> <td align="right"><a href="http://sourceforge.net/" class="plain"> <img src="http://sourceforge.net/sflogo.php?group_id=93369&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /> </a> </td> </tr> </table></p> </div> </body> </html> |
From: Andre P. <at...@us...> - 2004-05-16 08:42:24
|
Update of /cvsroot/hoc/www In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1857 Modified Files: hoc.css index.html support.html Added Files: .htaccess bg-stripes-verydark.png examples.html screenshots.html Log Message: Switched webpages to use Apache server-side includes (SSI) rather than duplicating header/footer information in every HTML file Added Screenshots page Added Examples page Index: index.html =================================================================== RCS file: /cvsroot/hoc/www/index.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- index.html 14 May 2004 07:41:41 -0000 1.2 +++ index.html 16 May 2004 08:42:15 -0000 1.3 @@ -1,87 +1,8 @@ -<html> - - <head> - <title>HOC: A Haskell to Objective-C binding</title> - </head> - - <style type="text/css" media="screen">@import "hoc.css";</style> - - <body> - - <div id="mainBox" class="main-box"> - <div class="content-box"> - <div class="logo-box"> - <table width="100%" cellpadding="4" cellspacing="4"> - <tr> - <td border="0" rowspan="2"> - <img src="HOC-Logo.png"> - </td> - <td align="center"> - <font size="+4"><strong>HOC:</strong></font> - </td> - </tr> - <th align="center"> - <font size="+3">A Haskell to Objective-C Binding</a> - </th> - </table> - </div> - <div class="tab-box"> - - <table align="center" cellpadding="0" cellspacing="0" - border="0"> - <tr valign="top"> - <td><img src="tab-start-selected.png" alt="" border="0"></td> - - <td border="0"> - <img src="tab-home-selected.png" alt="Home" border="0"> - </td> - - <td><img src="tab-divisor-selected.png" alt=" | " border="0"></td> - - <td border="0"> - <a href="download.html" class="plain"> - <img src="tab-download.png" alt="Download" border="0"> - </a> - </td> - - <td><img src="tab-divisor.png" alt=" | " border="0"></td> - - <td border="0"> - <a href="examples.html" class="plain"> - <img src="tab-examples.png" alt="Examples" border="0"> - </a> - </td> - - <td><img src="tab-divisor.png" alt=" | " border="0"></td> - - <td border="0"> - <a href="screenshots.html" class="plain"> - <img src="tab-screenshots.png" alt="Screenshots" border="0"> - </a> - </td> - - <td><img src="tab-divisor.png" alt=" | " border="0"></td> - - <td border="0"> - <a href="documentation.html" class="plain"> - <img src="tab-documentation.png" alt="Documentation" border="0"> - </a> - </td> - - <td><img src="tab-divisor.png" alt=" | " border="0"></td> - - <td border="0"> - <a href="support.html" class="plain"> - <img src="tab-support.png" alt="Support" border="0"> - </a> - </td> - - <td border="0"><img src="tab-end.png" alt="" border="0"></td> - - </tr> - </table> +<!--#set var="title" value="- A Haskell to Objective-C Binding" --> +<!--#set var="active-tab" value="Home" --> +<!--#set var="big-logo" value="yes" --> - <div class="firstpage"> +<!--#include virtual="/templates.hoc/header.shtml" --> <h1>About</h1> @@ -141,7 +62,7 @@ </div> - <p align="right"><a href="http://sourceforge.net/"> <img + <p align="right"><a href="http://sourceforge.net/" class="plain"> <img src="http://sourceforge.net/sflogo.php?group_id=93369&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /> </a></p> Index: hoc.css =================================================================== RCS file: /cvsroot/hoc/www/hoc.css,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- hoc.css 14 May 2004 07:34:14 -0000 1.1.1.1 +++ hoc.css 16 May 2004 08:42:15 -0000 1.2 @@ -19,7 +19,14 @@ p { font-size:100%; margin: 12px 0; - align: justify; + text-align: justify; +} + +p.center { + font-size:100%; + margin: 12px 0; + text-align: center; + align: center; } li { @@ -36,9 +43,9 @@ h2 { font-family: Verdana, sans-serif; - font-size:130%; - line-height: 130%; - color: #000066; + font-size:120%; + line-height: 120%; + /* color: #000066; */ text-align: center; } @@ -64,6 +71,13 @@ border: none; } +img.bordered { + border: 1px solid #BDBDBD; + padding: 12px 12px; + background-image: url("bg-stripes-verydark.png"); + background-repeat: repeat; +} + /* :: header graphics :: */ img.site-header { @@ -82,6 +96,9 @@ border: none; } +img.screenshot { +} + /* :: outer boxes :: */ body { --- NEW FILE: .htaccess --- # Turn on Server-Side Includes (SSI) and indexes Options Indexes +Includes # SSI support for .shtml files AddType text/html .shtml AddHandler server-parsed .shtml # SSI support for +x'ed .html files: # See http://httpd.apache.org/docs/howto/ssi.html XBitHack Full --- NEW FILE: bg-stripes-verydark.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: screenshots.html --- <!--#set var="title" value="Screenshots" --> <!--#set var="active-tab" value="Screenshots" --> <!--#include virtual="/templates.hoc/header.shtml" --> <h1>Screenshots</h1> <h2>A Text Editor</h2> <p>Here's the canonical GUI text editor application, implemented in about 50 lines of Haskell code. The code for this is distributed in HOC's <code>Samples/</code> source distribution.</p> <p class="center"> <a href="screenshots/Editor.png" class="plain"> <img src="screenshots/Editor.png" width="90%"> </a> </p> <p class="center" align="center"> <a href="screenshots/Editor.png"> (Click to enlarge.) </a> <p> <h2>Class Browser</h2> <p>This is a small program that comes with HOC which shows you the list of all known Objective-C <em>selectors</em> (method names). It shows you the selector in both Objective-C and Haskell syntax, the type of the Haskell function produced, and what class (and thus the Haskell module) the selector is defined in. This program's approximately 200 lines of code.</p> <p class="center" align="center"> <a href="screenshots/Browser.png" class="plain"> <img src="screenshots/Browser.png" width="90%"> </a> </p> <p class="center" align="center"> <a href="screenshots/Browser.png"> (Click to enlarge.) </a> <p> <h2>A Calculator</h2> <p>Here's a small application which allows you to enter in arithmetic expressions (e.g. <code>2+5</code> or <code>69*33/3+15</code>) and will calculate the final result. The full program is about 75 lines long: about 25 lines for the expression parsing code, and ~50 lines for the GUI.</p> <p> <table align="center" border="0"> <tr> <td> <img src="screenshots/ExpressionParser.png" class="bordered"> </td> <td> <img src="screenshots/ExpressionParser_error.png" class="bordered"> </td> </tr> </table> </p> <!--#include virtual="/templates.hoc/footer.shtml" --> Index: support.html =================================================================== RCS file: /cvsroot/hoc/www/support.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- support.html 14 May 2004 07:41:41 -0000 1.2 +++ support.html 16 May 2004 08:42:15 -0000 1.3 @@ -1,140 +1,46 @@ -<html> - - <head> - <title>HOC: A Haskell to Objective-C binding</title> - </head> - - <style type="text/css" media="screen">@import "hoc.css";</style> - - <body> - - <div id="mainBox" class="main-box"> - <div class="content-box"> - <div class="logo-box"> - - <table align="center" width="100%" cellpadding="4" cellspacing="4"> - <tr> - <td border="0" align="right"> - <img src="HOC-Small-Logo.png"> - </td> - <td align="center"> - <font size="+3">HOC: A Haskell to Objective-C Binding</font> - </td> - </tr> - </table> - - </div> - <div class="tab-box"> - - <table align="center" cellpadding="0" cellspacing="0" - border="0"> - <tr valign="top"> - <td><img src="tab-start.png" alt="" border="0"></td> - - <td border="0"> - <a href="index.html" class="plain"> - <img src="tab-home.png" alt="Home" border="0"> - </a> - </td> - - <td><img src="tab-divisor.png" alt=" | " border="0"></td> - - <td border="0"> - <a href="download.html" class="plain"> - <img src="tab-download.png" alt="Download" border="0"> - </a> - </td> - - <td><img src="tab-divisor.png" alt=" | " border="0"></td> - - <td border="0"> - <a href="examples.html" class="plain"> - <img src="tab-examples.png" alt="Examples" border="0"> - </a> - </td> - - <td><img src="tab-divisor.png" alt=" | " border="0"></td> - - <td border="0"> - <a href="screenshots.html" class="plain"> - <img src="tab-screenshots.png" alt="Screenshots" border="0"> - </a> - </td> - - <td><img src="tab-divisor.png" alt=" | " border="0"></td> - - <td border="0"> - <a href="documentation.html" class="plain"> - <img src="tab-documentation.png" alt="Documentation" border="0"> - </a> - </td> - - <td><img src="tab-divisor-selected.png" alt=" | " border="0"></td> - - <td border="0"> - <img src="tab-support-selected.png" alt="Support" border="0"> - </td> - - <td border="0"><img src="tab-end-selected.png" alt="" border="0"></td> - - </tr> - </table> - - <div class="firstpage"> - - <h1>Mailing Lists</h1> - - <p>There are four mailing lists where you can contact the HOC - developers and other users:</p> - - <div class="inner-box"> - - <table align="center" width="100%"> - <tr> - <td nowrap> - <code><a href="http://lists.sourceforge.net/lists/listinfo/hoc-announce">hoc...@li...</a> </code> - <td>Announcements of HOC releases and related tools (low-traffic)</td> - </tr> +<!--#set var="title" value="Support" --> +<!--#set var="active-tab" value="Support" --> - <tr> - <td nowrap> - <code><a href="http://lists.sourceforge.net/lists/listinfo/hoc-users">hoc...@li...</a></code> - </td> - <td>General HOC discussions</td> - </tr> +<!--#include virtual="/templates.hoc/header.shtml" --> - <tr> - <td nowrap> - <code><a href="http://lists.sourceforge.net/lists/listinfo/hoc-devel">hoc...@li...</a></code> - </td> - <td>HOC developer & implementation discussions</td> +<h1>Mailing Lists</h1> - </tr> +<p>There are four mailing lists where you can contact the HOC +developers and other users:</p> - <tr> - <td nowrap> - <code><a href="http://lists.sourceforge.net/lists/listinfo/hoc-cvs">ho...@li...</a></code> - </td> - <td>CVS commit log messages</td> - </tr> +<div class="inner-box"> - </table> + <table align="center" width="100%"> + <tr> + <td nowrap> + <code><a href="http://lists.sourceforge.net/lists/listinfo/hoc-announce">hoc-announce</a> </code></td> + <td>Announcements of HOC releases and related tools (low-traffic)</td> + </tr> - </div> + <tr> + <td nowrap> + <code><a href="http://lists.sourceforge.net/lists/listinfo/hoc-users">hoc-users</a></code> + </td> + <td>General HOC discussions</td> + </tr> - </div> - </div> - <!-- <a class="plain" href="/"><img - src="HOC-Small-Logo.png"></a> --> - </div> + <tr> + <td nowrap> + <code><a href="http://lists.sourceforge.net/lists/listinfo/hoc-devel">hoc-devel</a></code> + </td> + <td>HOC developer & implementation discussions</td> + </tr> - <p align="right"><a href="http://sourceforge.net/"> <img - src="http://sourceforge.net/sflogo.php?group_id=93369&type=5" - width="210" height="62" border="0" alt="SourceForge.net Logo" /> </a></p> + <tr> + <td nowrap> + <code><a href="http://lists.sourceforge.net/lists/listinfo/hoc-cvs">hoc-cvs</a></code> + </td> + <td>CVS commit log messages</td> + </tr> - </div> + </table> - </body> +</div> - </html> +<!--#include virtual="/templates.hoc/footer.shtml" --> --- NEW FILE: examples.html --- <!--#set var="title" value="Examples" --> <!--#set var="active-tab" value="Examples" --> <!--#include virtual="/templates.hoc/header.shtml" --> <h1>Cocoa Examples</h1> <h2>Adding a GUI to an Expression Parser</h2> <p>You've probably seen many examples of Haskell GUI libraries which show you how to create a simple graphical application with menus, and a cute little button that prints "Hello, world!" when you click on it:</p> TODO: Insert picture <p>Well, we'd show you that, but the truth is it's so easy to do with Cocoa that it'd just be boring. (Really!) So, let's do something a bit more practical with our first example: put a simple GUI around a basic Haskell program, which is something you're more likely to be interested in.</p> <p>Let's assume that you've written a useful Haskell module: say a simple calculator (or <em>expression parser</em>). To do this, we could use Daan Leijen's most excellent <a href="http://www.cs.uu.nl/~daan/parsec.html">Parsec</a> parser combinator library. In fact, Parsec comes with such excellent documentation that it even gives <a href="http://www.cs.uu.nl/~daan/download/parsec/parsec.html#Expressions">example code</a> which shows how to do this. So, imagine the following code is in an <code>ExpressionParser.hs</code> Haskell module:</a> <div class="inner-box"> <pre>module ExpressionParser where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Expr expr :: Parser Integer expr = buildExpressionParser table factor <?> "expression" table = [ [op "*" (*) AssocLeft, op "/" div AssocLeft] , [op "+" (+) AssocLeft, op "-" (-) AssocLeft] ] where op s f assoc = Infix (do { string s; return f }) assoc factor = do { char '('; x <- expr; char ')'; return x } <|> number <?> "simple expression" number :: Parser Integer number = do { ds <- many1 digit; return (read ds) } <?> "number" </pre> </div> <p>There's probably around 10 lines of code there, but if you run the code in GHCi, it seems to work quite well:</p> <div class="inner-box"> <pre>*ExpressionParser> parseTest expr "2+5*2" 12 *ExpressionParser> parseTest expr "69/3+1" 24 </pre> </div> <p>So, you have a working expression parser. Unfortunately, you have to to run this from GHCI. Wouldn't it be nicer if you could run it from a Haskell GUI instead?</p> <!--#include virtual="/templates.hoc/footer.shtml" --> |
From: Andre P. <at...@us...> - 2004-05-16 08:42:24
|
Update of /cvsroot/hoc/www/screenshots In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1857/screenshots Added Files: Browser.png Editor.png ExpressionParser.png ExpressionParser_error.png Log Message: Switched webpages to use Apache server-side includes (SSI) rather than duplicating header/footer information in every HTML file Added Screenshots page Added Examples page --- NEW FILE: Browser.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ExpressionParser.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ExpressionParser_error.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Editor.png --- (This appears to be a binary file; contents omitted.) |
From: Andre P. <at...@us...> - 2004-05-16 08:40:02
|
Update of /cvsroot/hoc/www/screenshots In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1464/screenshots Log Message: Directory /cvsroot/hoc/www/screenshots added to the repository |
From: Andre P. <at...@us...> - 2004-05-16 08:39:10
|
Update of /cvsroot/hoc/www/templates.hoc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1349/templates.hoc Log Message: Directory /cvsroot/hoc/www/templates.hoc added to the repository |
From: Andre P. <at...@us...> - 2004-05-14 15:34:40
|
Update of /cvsroot/hoc/hoc/Samples/ExpressionParser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24809/ExpressionParser Added Files: EPController.hs ExpressionParser.hs Main.hs Makefile Selectors.hs Log Message: Added ExpressionParser sample --- NEW FILE: EPController.hs --- {-# OPTIONS -fglasgow-exts #-} module EPController where import Cocoa hiding (parse, info_evaluate, ImpType_evaluate) import ExpressionParser import Selectors import Text.ParserCombinators.Parsec (parse) $(declareClass "EPController" "NSObject") $(exportClass "EPController" "ep_" [ Outlet "expressionEntry" [t| NSTextField () |] , Outlet "evaluation" [t| NSTextField () |] , InstanceMethod Selectors.info_evaluate ] ) obj #. var = obj # getIVar var ep_evaluate _ self = do expressionTextField <- (self #. _expressionEntry) expression <- expressionTextField # stringValue >>= haskellString evaluation <- self #. _evaluation case (parse expr "" expression) of Left err -> self #. _evaluation >>= setStringValue (toNSString "(error)") Right answer -> self #. _evaluation >>= setStringValue (toNSString $ show answer) --- NEW FILE: ExpressionParser.hs --- module ExpressionParser where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Expr expr :: Parser Integer expr = buildExpressionParser table factor <?> "expression" table = [ [op "*" (*) AssocLeft, op "/" div AssocLeft] , [op "+" (+) AssocLeft, op "-" (-) AssocLeft] ] where op s f assoc = Infix (do { string s; return f }) assoc factor = do { char '('; x <- expr; char ')'; return x } <|> number <?> "simple expression" number :: Parser Integer number = do { ds <- many1 digit; return (read ds) } <?> "number" --- NEW FILE: Selectors.hs --- {-# OPTIONS -fglasgow-exts #-} module Selectors where import AppKit.NSButton $(declareSelector "evaluate:" [t| forall a. NSButton a -> IO () |]) --- NEW FILE: Makefile --- include ../../config.mk all: ExpressionParser.app ExpressionParser.app: ExpressionParser hocwrap ExpressionParser ExpressionParser: *.hs mkdir -p build ghc --make Main.hs -odir build -hidir build -O -o $@ interpret: mkdir -p build hocwrap -i -- Main.hs -odir build -hidir build zerolink: nolink interpret nolink: mkdir -p build ghc --make Main.hs -odir build -hidir build -O -pgml true clean: rm -rf build/ ExpressionParser ExpressionParser.app/ 'Interpreted Haskell Application.app/' --- NEW FILE: Main.hs --- module Main where import EPController import AppKit.NSApplication(nsApplicationMain_) main = do initializeClass_EPController nsApplicationMain_ |
From: Andre P. <at...@us...> - 2004-05-14 15:34:02
|
Update of /cvsroot/hoc/hoc/Samples/ExpressionParser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24703/ExpressionParser Log Message: Directory /cvsroot/hoc/hoc/Samples/ExpressionParser added to the repository |
From: Andre P. <at...@us...> - 2004-05-14 07:41:51
|
Update of /cvsroot/hoc/www In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25786 Modified Files: index.html support.html Log Message: Added Sourceforge logo to bottom of page (as required by Sourceforge policy: see <http://sourceforge.net/project/admin/prweb.php?group_id=93369>) Index: index.html =================================================================== RCS file: /cvsroot/hoc/www/index.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- index.html 14 May 2004 07:34:14 -0000 1.1.1.1 +++ index.html 14 May 2004 07:41:41 -0000 1.2 @@ -91,7 +91,7 @@ Objective-C objects and frameworks from Haskell, and also enables you to write Objective-C objects in Haskell.</p> - + <p>The Haskell interfaces produced by HOC are:</p> <ul> @@ -123,27 +123,31 @@ <p><strong>Friday, 14 May 2004</strong>:<br/> HOC 0.2 released.</p> - <p><strong>Thursday, 2 Jan 2003</strong>:<br/> HOC - 0.1 released. See the <a - href="http://www.haskell.org/pipermail/glasgow-haskell-users/2003-January/004602.html">full - release announcement</a>, or download it - here.</p> + <p><strong>Thursday, 2 Jan 2003</strong>:<br/> HOC + 0.1 released. See the <a + href="http://www.haskell.org/pipermail/glasgow-haskell-users/2003-January/004602.html">full + release announcement</a>, or download it + here.</p> - </ul> + </ul> - <h1>License</h1> + <h1>License</h1> - <p>In the spirit of the Haskell and Mac OS X open-source - communities, HOC is provided under the liberal BSD license.</p> + <p>In the spirit of the Haskell and Mac OS X open-source + communities, HOC is provided under the liberal BSD license.</p> - </div> </div> - <!-- <a class="plain" href="/"><img - src="HOC-Small-Logo.png"></a> --> </div> + </div> - </body> + <p align="right"><a href="http://sourceforge.net/"> <img + src="http://sourceforge.net/sflogo.php?group_id=93369&type=5" + width="210" height="62" border="0" alt="SourceForge.net Logo" /> </a></p> + + </div> + +</body> </html> Index: support.html =================================================================== RCS file: /cvsroot/hoc/www/support.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- support.html 14 May 2004 07:34:14 -0000 1.1.1.1 +++ support.html 14 May 2004 07:41:41 -0000 1.2 @@ -11,7 +11,7 @@ <div id="mainBox" class="main-box"> <div class="content-box"> <div class="logo-box"> - + <table align="center" width="100%" cellpadding="4" cellspacing="4"> <tr> <td border="0" align="right"> @@ -120,16 +120,21 @@ </table> - </div> + </div> + </div> </div> + <!-- <a class="plain" href="/"><img + src="HOC-Small-Logo.png"></a> --> </div> - <!-- <a class="plain" href="/"><img - src="HOC-Small-Logo.png"></a> --> + + <p align="right"><a href="http://sourceforge.net/"> <img + src="http://sourceforge.net/sflogo.php?group_id=93369&type=5" + width="210" height="62" border="0" alt="SourceForge.net Logo" /> </a></p> + </div> - </div> - </body> + </body> -</html> + </html> |
From: Andre P. <at...@us...> - 2004-05-14 07:35:37
|
Update of /cvsroot/hoc/www In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24793 Removed Files: haskell.html Log Message: Removed unused haskell.html file --- haskell.html DELETED --- |
From: Andre P. <at...@us...> - 2004-05-14 06:05:52
|
Update of /cvsroot/hoc/hoc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10883 Modified Files: configure.ac config.mk.in Log Message: More build system changes ... Build system now actually implements the --with-ghc parameter :) -- define a $GHC variable in config.mk Added --with-ghc-pkg parameter (if you want to e.g. do "--with-ghc-pkg=ghc-pkg-6.2.1") Define $GHC_LIB_PATH in config.mk and use that rather than `ghc --print-libdir` in all the Makefiles Lifted DOT and POD2HTML autoconf substitutions to config.mk, rather than being output directly to docs/Makefile Index: configure.ac =================================================================== RCS file: /cvsroot/hoc/hoc/configure.ac,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- configure.ac 12 May 2004 05:51:13 -0000 1.3 +++ configure.ac 14 May 2004 06:05:10 -0000 1.4 @@ -38,13 +38,13 @@ # -# Test for GHC: this handy autoconf macro blatantly stolen from HDoc +# Test for GHC: this handy autoconf macro blatantly stolen from HDoc: # http://www.fmi.uni-passau.de/~groessli/hdoc/ # AC_ARG_WITH(ghc, - [ --with-ghc=GHC where to find ghc], - [GHC=$withval]) + [ --with-ghc=... command to run ghc (e.g. $HOME/bin/ghc-6.2.1)], + [GHC=$withval]) if test -z "$GHC"; then AC_CHECK_TOOL(GHC, ghc, ghc) @@ -53,30 +53,40 @@ GHC_FLAGS="" if test "$GHC"; then - AC_MSG_CHECKING([for ghc version]) - changequote(<<, >>) - ghc_version=`$GHC --version 2>&1 | sed -n -e 's/.* version \([0-9.][0-9.]*\).*/\1/p'` - ghc_major=`echo "$ghc_version" | sed -n -e 's/\([0-9][0-9]*\).*/\1/p'` - ghc_minor=`echo "$ghc_version" | sed -n -e 's/[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/p'` - changequote([, ]) - AC_MSG_RESULT([$ghc_version]) - if test '(' "$ghc_major" -ge 6 -a "$ghc_minor" -ge 2 ')' -o \ + AC_MSG_CHECKING([for ghc version]) + changequote(<<, >>) + ghc_version=`$GHC --version 2>&1 | sed -n -e 's/.* version \([0-9.][0-9.]*\).*/\1/p'` + ghc_major=`echo "$ghc_version" | sed -n -e 's/\([0-9][0-9]*\).*/\1/p'` + ghc_minor=`echo "$ghc_version" | sed -n -e 's/[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/p'` + changequote([, ]) + AC_MSG_RESULT([$ghc_version]) + if test '(' "$ghc_major" -ge 6 -a "$ghc_minor" -ge 2 ')' -o \ '(' "$ghc_major" -ge 6 ')'; then - AC_MSG_CHECKING([for ghc library directory]) - GHC_LIB_PATH=`$GHC --print-libdir` - AC_MSG_RESULT([$GHC_LIB_PATH]) - else - AC_MSG_ERROR([** Sorry, your GHC is too old. GHC >= 6.2 required.]) - GHC="" - fi + AC_MSG_CHECKING([for ghc library directory]) + GHC_LIB_PATH=`$GHC --print-libdir` + AC_MSG_RESULT([$GHC_LIB_PATH]) + else + AC_MSG_ERROR([** Sorry, your GHC is too old. GHC >= 6.2 required.]) + GHC="" + fi else - AC_MSG_ERROR([** Could not find GHC.]) + AC_MSG_ERROR([** Could not find GHC.]) fi AC_SUBST(GHC) AC_SUBST(GHC_LIB_PATH) -AC_CHECK_TOOL(GHC_PKG, ghc-pkg, ghc-pkg) +# Check for ghc-pkg +AC_ARG_WITH(ghc-pkg, + [ --with-ghc-pkg=... command to run ghc-pkg (e.g. $HOME/bin/ghc-pkg-6.2.1)], + [GHC_PKG="$withval"]) + +if test -n "$GHC_PKG"; then + AC_SUBST(GHC_PKG) + true +else + AC_CHECK_TOOL(GHC_PKG, ghc-pkg, ghc-pkg) +fi # Index: config.mk.in =================================================================== RCS file: /cvsroot/hoc/hoc/config.mk.in,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- config.mk.in 12 May 2004 05:44:08 -0000 1.1 +++ config.mk.in 14 May 2004 06:05:10 -0000 1.2 @@ -6,3 +6,10 @@ DEFINES=@HOC_DEFINES@ CFLAGS=@HOC_CFLAGS@ +GHC=@GHC@ +GHC_PKG=@GHC_PKG@ +GHC_LIB_PATH=@GHC_LIB_PATH@ + +DOT=@DOT@ +POD2HTML=@POD2HTML@ + |
From: Andre P. <at...@us...> - 2004-05-14 06:05:52
|
Update of /cvsroot/hoc/hoc/Foundation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10883/Foundation Modified Files: Makefile.in Log Message: More build system changes ... Build system now actually implements the --with-ghc parameter :) -- define a $GHC variable in config.mk Added --with-ghc-pkg parameter (if you want to e.g. do "--with-ghc-pkg=ghc-pkg-6.2.1") Define $GHC_LIB_PATH in config.mk and use that rather than `ghc --print-libdir` in all the Makefiles Lifted DOT and POD2HTML autoconf substitutions to config.mk, rather than being output directly to docs/Makefile Index: Makefile.in =================================================================== RCS file: /cvsroot/hoc/hoc/Foundation/Makefile.in,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.in 12 May 2004 11:11:06 -0000 1.3 +++ Makefile.in 14 May 2004 06:05:12 -0000 1.4 @@ -13,14 +13,14 @@ ln -sf ../Bindings/ifgen-output/GNUstepBase.hs . mkdir -p build/objects mkdir -p build/imports - ghc --make Foundation.hs \ + $(GHC) --make Foundation.hs \ -package-name Foundation \ -odir build/objects \ -hidir build/imports \ -package-conf ../HOC/HOC-$(PLATFORM).conf-inplace \ -fglasgow-exts test ! -r GNUstepBase.hs || \ - ghc --make GNUstepBase.hs \ + $(GHC) --make GNUstepBase.hs \ -package-name Foundation \ -odir build/objects \ -hidir build/imports \ @@ -44,10 +44,10 @@ Foundation ghcmake.build-stamp install: all - mkdir -p `ghc --print-libdir`/Foundation + mkdir -p $(GHC_LIB_PATH)/Foundation cp -R libHSFoundation.a HSFoundation.o build/imports \ - `ghc --print-libdir`/Foundation/ - ranlib `ghc --print-libdir`/Foundation/libHSFoundation.a - ghc-pkg --update-package \ + $(GHC_LIB_PATH)/Foundation/ + ranlib $(GHC_LIB_PATH)/Foundation/libHSFoundation.a + $(GHC_PKG) --update-package \ --input-file=Foundation.conf |