[Haskell-cafe] ANNOUNCE: Guihaskell and PropLang 0.1
Asumu Takikawa
asumu at cyberberry.com
Wed Aug 15 00:58:22 EDT 2007
Hello Haskellers. I'm one of the Google Summer of Code students for '07
and I'd like to announce the project my mentor, Neil Mitchell, and I
have been working on.
== GuiHaskell
Guihaskell is a graphical REPL using PropLang, a GUI combinator library
built on top of Gtk2hs, which aims to be an IDE for Haskell written in
Haskell. It's still rough around the edges, so think of this as an alpha
release. As such, I'd appreciate any feedback very much!
Here's a feature list for 0.1:
* Support for GHCi (default) and Hugs
* Quick switching between compilers
* Simple one-click profiling
* Command history
This first release of Guihaskell is mostly infrastructure. For future
releases I aim to integrate more tools like Cabal and make it easier to
use with an editor.
== PropLang
PropLang is a GUI library built on Gtk2hs that allows for high
level design. The GUI is expressed as a series of relationships between
GUI elements and data sources.
Here's a "Hello World" example:
import PropLang.Gtk
import PropLang.Event
main = do
initPropLang
window <- getWindow "foobar.glade" "wndFoo"
let tb = getCtrl window "button" :: ToolButton
tb!onClicked += putStrLn "Hello World!"
showWindowMain window
This example prints "Hello World!" when the user presses a button
defined in a Glade file. PropLang is used with glade to define the
interface. You can define more complicated relationships using the
combinators in PropLang.Variable.
Here's a snippet from GuiHaskell:
tie (txtSelect!text) filename
(\t -> if null t then Nothing else Just t) (maybe "" id)
"tie" takes two PropLang variables and relates them so that when one is
updated, it will inject its value into another. It also takes two
functions to run on the data before injection. This snippet is used to
tie the representation of the currently selected file in GuiHaskell (a
Maybe String) to Gtk's TextView buffer (a String). If you injected a
new value into filename...
filename -< Nothing
then txtSelect's text buffer would be set to "".
You can also build other behaviors into PropLang variables to do
interesting things. GuiHaskell has a configuration API built around
PropLang. Configuration items are defined as special PropLang variables:
filename <- newVarWithName "selected_filename"
(newConfValueWithDefault Nothing "selected_filename")
"newVarWithName" in PropLang.Variable lets you make new variables with
custom actions to retrieve and set values. "newConfValue" is defined in
GuiHaskell to serialize configuration items to disk so they can be read
back after closing the program.
For more information you can generate the Proplang docs with haddock.
== Install
Get the packages here:
http://hackage.haskell.org/packages/archive/GuiHaskell/0.1/GuiHaskell-0.1.tar.gz
http://hackage.haskell.org/packages/archive/proplang/0.1/proplang-0.1.tar.gz
Install with cabal:
runhaskell Setup.lhs configure
runhaskell Setup.lhs build
runhaskell Setup.lhs install
==
You can send feedback to my e-mail, the list, or contact me on IRC (I'm
Shimei on #haskell). Thanks.
Cheers,
Asumu Takikawa
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20070814/df99216a/attachment.bin
More information about the Haskell-Cafe
mailing list