Announcing <a target="_blank" title="External link to http://conal.net/phooey" href="http://conal.net/phooey" class="externalLink">Phooey</a>, a functional UI library for Haskell.<br><br>GUIs
are usually programmed in an "unnatural" style, in that implementation
dependencies are inverted, relative to logical dependencies. This
reversal results directly from the imperative orientation of most GUI
libraries. While outputs depend on inputs from a user and semantic
point of view, the imperative approach imposes an implementation
dependence of inputs on outputs.<br><br>Phooey ("<strong>Ph</strong>unctional <strong>oo</strong>s<strong>e</strong>r <strong>y</strong>nterfaces")
retains the functional style, in which outputs are expressed in terms
of inputs. In addition, Phooey supports dynamic input bounds, flexible
layout, and mutually-referential widgets. <br><br>As an example of Phooey's style, below is a simple shopping list GUI. The <em>total</em> displayed at the bottom of the window always shows the sum of the values of the
<em>apples</em> and <em>bananas</em> input sliders. When a user changes the inputs, the output updates accordingly.<br><blockquote><img src="http://conal.net/phooey/images/ui1.png"><br></blockquote>Phooey is structured as an arrow, and this example uses arrow notation. The code:
<br><pre> ui1 :: UI () ()<br> ui1 = title "Shopping List" $<br> proc () -> do<br> a <- title "apples" (islider 3) -< (0,10)<br> b <- title "bananas" (islider 7) -< (0,10)
<br> title "total" showDisplay -< a+b<br></pre><br>I am working on a paper about Phooey. For now, please see <a target="_blank" title="External link to http://darcs.haskell.org/packages/phooey/doc" href="http://darcs.haskell.org/packages/phooey/doc" class="externalLink">
the Haddock documentation</a> (which includes more examples), and try the code via<br><br><div style="margin-left: 40px;"><code style="font-family: arial,sans-serif;"> darcs get </code><a style="font-family: arial,sans-serif;" target="_blank" title="External link to http://darcs.haskell.org/packages/phooey" href="http://darcs.haskell.org/packages/phooey" class="externalLink">
http://darcs.haskell.org/packages/phooey</a><span style="font-family: arial,sans-serif;"> </span><code style="font-family: arial,sans-serif;"> --partial</code><br></div> <br>Directions for building are in the <a target="_blank" title="External link to http://darcs.haskell.org/packages/phooey/README" href="http://darcs.haskell.org/packages/phooey/README" class="externalLink">
README</a> file. Distribution tarballs are <a target="_blank" title="External link to http://darcs.haskell.org/packages/phooey/dist" href="http://darcs.haskell.org/packages/phooey/dist" class="externalLink">here</a>.<br>
<br>Comments and collaboration are very welcome!<br><br>Cheers, <br><br> - Conal<br><br>P.S. I'm very grateful for Don Stewart's recent pointers on how to create & release Haskell projects.<br>