Personal tools

Grapefruit

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(Publications and talks: talks and thesis by Matthias Reisner added)
(Development versions: adapted info to changes in darcs repositories related to the start of Grapefruit 0.2)
 
(2 intermediate revisions by one user not shown)
Line 35: Line 35:
 
=== Development versions ===
 
=== Development versions ===
   
Development versions can be fetched from the [[Darcs|darcs]] repository at http://darcs.grapefruit-project.org/main. You can build them by building the individual [[Cabal]] packages in the <code>grapefruit-*</code> directories. Note that <code>grapefruit-graphics</code> is currently defunct.
+
Currently, Grapefruit is undergoing a complete rewrite, which will base it on new concepts. For each part of the new Grapefruit, there is a corresponding [[Darcs|darcs]] repository at <nowiki>http://darcs.grapefruit-project.org/</nowiki>''package-name''/main. The code of the old 0.1&nbsp;branch of Grapefruit resides in a single darcs repository at http://darcs.grapefruit-project.org/monolithic/0.1.
   
 
== Running the examples ==
 
== Running the examples ==
Line 49: Line 49:
 
== Publications and talks ==
 
== Publications and talks ==
   
The following publications and talks are related to Grapefruit:
+
See [https://grapefruit-project.org/publications-and-talks the respective list] on [https://grapefruit-project.org/ the new Grapefruit website].
 
* Wolfgang Jeltsch: First-class Subkinds in Haskell. [http://cs.ioc.ee/~tarmo/tsem11/ TTÜ Küberneetika Instituudi arvutiteaduse teooriaseminar]. October 27, 2011.
 
** [http://cs.ioc.ee/~tarmo/tsem11/jeltsch2710-slides.pdf slides]
 
 
* Wolfgang Jeltsch: Record Type Families: A Key to Generic Record Combinators. [http://cs.ioc.ee/~tarmo/tsem11/ TTÜ Küberneetika Instituudi arvutiteaduse teooriaseminar]. October 20, 2011.
 
** [http://cs.ioc.ee/~tarmo/tsem11/jeltsch2010-slides.pdf slides]
 
 
* Wolfgang Jeltsch: First-Class Signals for Functional Reactive Programming. [http://cs.ioc.ee/~tarmo/tsem11/ TTÜ Küberneetika Instituudi arvutiteaduse teooriaseminar]. October 13, 2011.
 
** [http://cs.ioc.ee/~tarmo/tsem11/jeltsch1310-slides.pdf slides]
 
 
* Matthias Reisner: Ein Interpreter für die funktional-reaktive Sprache Tempus. Diplomarbeit am [http://www.tu-cottbus.de/programmiersprachen-compilerbau Lehrstuhl Programmiersprachen und Compilerbau der BTU Cottbus]. September 23, 2011.
 
** [http://www.informatik.tu-cottbus.de/~jeltsch/research/reisner-diplo-2011-thesis.pdf thesis]
 
** [http://www.informatik.tu-cottbus.de/~jeltsch/research/reisner-diplo-2011-slides.pdf slides]
 
 
* Matthias Reisner: Implementierung eines Interpreters für die FRP-Sprache Tempus. Kolloquium des [http://www.tu-cottbus.de/programmiersprachen-compilerbau Lehrstuhls Programmiersprachen und Compilerbau der BTU Cottbus]. April 14, 2011.
 
** [http://www.informatik.tu-cottbus.de/~jeltsch/research/reisner-btupscb-2011-slides.pdf slides]
 
 
* Wolfgang Jeltsch: Programming in Linear Temporal Logic. [http://cs.ioc.ee/~tarmo/tsem10/ TTÜ Küberneetika Instituudi arvutiteaduse teooriaseminar]. February 10, 2011.
 
** [http://cs.ioc.ee/~tarmo/tsem10/jeltsch-slides.pdf slides]
 
 
* Wolfgang Jeltsch: The Curry–Howard Correspondence between Temporal Logic and Functional Reactive Programming. [http://www.cs.ut.ee/~varmo/tday-nelijarve/ Teooriapäevad Nelijärvel]. February 4–6, 2011.
 
** [http://www.cs.ut.ee/~varmo/tday-nelijarve/jeltsch-slides.pdf slides]
 
 
* Wolfgang Jeltsch: Generic Record Combinators with Static Type Checking. [http://www.risc.jku.at/conferences/ppdp2010/ 12th International Symposium on Principles and Practice of Declarative Programming]. July 26–28, 2010.
 
** [http://www.informatik.tu-cottbus.de/~jeltsch/research/ppdp-2010-paper.pdf paper]
 
** [http://www.informatik.tu-cottbus.de/~jeltsch/research/ppdp-2010-slides.pdf slides] (including non-shown additional material)
 
 
* Wolfgang Jeltsch: Signale statt Generatoren!. [http://www-ps.informatik.uni-kiel.de/fg214/Honnef2010/ 27. Workshop der GI-Fachgruppe Programmiersprachen und Rechenkonzepte]. May 3–5, 2010.
 
** [http://www.informatik.tu-cottbus.de/~jeltsch/research/gipsrk-2010-slides.pdf slides] (including non-shown additional material)
 
 
* Wolfgang Jeltsch: Generische Record-Kombinatoren mit statischer Typprüfung. Kolloquium des [http://www.tu-cottbus.de/programmiersprachen-compilerbau Lehrstuhls Programmiersprachen und Compilerbau der BTU Cottbus]. January 13, 2010.
 
** [http://www.informatik.tu-cottbus.de/~jeltsch/research/btupscb-2010-slides.pdf slides]
 
 
* Wolfgang Jeltsch: Programmierung und Verifikation reaktiver Systeme mittels funktionaler Programmierung. Kolloquium des [http://www.informatik.tu-cottbus.de/ Instituts für Informatik der BTU Cottbus]. November 18, 2009.
 
** [http://www.informatik.tu-cottbus.de/~jeltsch/research/btuifi-2009-slides.pdf slides]
 
 
* Wolfgang Jeltsch: A Generic Foundation for Record Combinators. [http://blogs.shu.edu/projects/IFL2009/ 21st International Symposium on Implementation and Application of Functional Languages]. September 23–25, 2009.
 
** [http://www.informatik.tu-cottbus.de/~jeltsch/research/ifl-2009-slides.pdf slides] (including non-shown additional material)
 
 
* Wolfgang Jeltsch: Signals, Not Generators!. [http://www.inf.elte.hu/english/conf/tfp_cefp_2009/Lapok/index.aspx Tenth Symposium on Trends in Functional Programming]. June 2–4, 2009.
 
** [http://www.informatik.tu-cottbus.de/~jeltsch/research/tfp-2009-paper.pdf paper]
 
** [http://www.informatik.tu-cottbus.de/~jeltsch/research/tfp-2009-slides.pdf slides] (including non-shown additional material)
 
 
* Wolfgang Jeltsch: Declarative Programming of Interactive Systems with Grapefruit. [http://www.cs.uu.nl/wiki/Stc Software Technology Colloquium of Universiteit Utrecht]. May 29, 2008.
 
** [http://www.cs.uu.nl/wiki/bin/view/Stc/DeclarativeProgrammingOfInteractiveSystemsWithGrapefruit time, place and abstract]
 
** [http://www.informatik.tu-cottbus.de/~jeltsch/research/uustc-20080529-slides.pdf slides] (including non-shown additional material)
 
 
* Wolfgang Jeltsch: Improving Push-based FRP. [http://www.st.cs.ru.nl/AFP_TFP_2008/ Ninth Symposium on Trends in Functional Programming]. May 26–28, 2008.
 
** [http://www.informatik.tu-cottbus.de/~jeltsch/research/tfp-2008-draft-paper.pdf draft paper] (published in the draft proceedings)
 
** [http://www.informatik.tu-cottbus.de/~jeltsch/research/tfp-2008-slides.pdf slides] (including non-shown additional material)
 
 
* Wolfgang Jeltsch: Funktionale GUI-Programmierung in Haskell mit Grapefruit. [http://www.iba-cg.de/haskell.html Haskell in Leipzig&nbsp;2]. July 10, 2007.
 
** [http://video.google.com/videoplay?docid=-8925440604853415181 video]
 
** [http://www.informatik.tu-cottbus.de/~jeltsch/research/hal-2-slides.pdf slides]
 
   
 
== Community ==
 
== Community ==

Latest revision as of 14:47, 10 February 2012


Contents

[edit] 1 About

Grapefruit is a library for Functional Reactive Programming (FRP) with a focus on user interfaces. FRP makes it possible to implement reactive and interactive systems in a declarative style. With Grapefruit, user interfaces are described as networks of communicating widgets and windows. Communication is done via different kinds of signals which describe temporal behavior.

[edit] 2 Features

Grapefruit has the following important features:

  • a push-based FRP implementation where signals
    • can be memoized using ordinary variable bindings
    • can be merged without doubling of simultaneous events
    • cannot behave differently by starting them at different times
  • a record system which makes it possible that
    • input signals can be left out to get default behavior
    • output signals can be left out to ignore uninteresting data
    • output signals can be chosen and fetched by pattern matching
  • an abstract UI implementation which can work with different backends which in turn use different toolkits to provide different look and feel with one and the same application code (At the moment, the only supported UI toolkit is GTK+ (via Gtk2Hs). We plan to support Qt in the future, making use of the HQK project’s output.)

You might be interested in a comparison of Grapefruit to other FRP libaries

[edit] 3 Installation

[edit] 3.1 Released versions

Grapefruit is released on Hackage. If you do not have special requirements, you can install Grapefruit by saying cabal install grapefruit-ui-gtk grapefruit-examples.

If you do not have installed the gtk package yet, this command will also try to install this package. However, this will fail unless gtk2hs-buildtools is already installed. See the Gtk2Hs website for further information.

[edit] 3.2 Development versions

Currently, Grapefruit is undergoing a complete rewrite, which will base it on new concepts. For each part of the new Grapefruit, there is a corresponding darcs repository at http://darcs.grapefruit-project.org/package-name/main. The code of the old 0.1 branch of Grapefruit resides in a single darcs repository at http://darcs.grapefruit-project.org/monolithic/0.1.

[edit] 4 Running the examples

You can run the examples by typing the following lines into GHCi:

import Graphics.UI.Grapefruit.Circuit
import Graphics.UI.Grapefruit.UIBackend
import Examples.Grapefruit.Example
run UIBackend mainCircuit ()

Replace Example with the name of the example to run and UIBackend with the name of the UI backend you want to use. At the moment, the only meaningful replacement for UIBackend is GTK. Possible replacements for Example are Converter, ListView, SetView, Simple, and Switching.

We do not provide ready-to-use executables since it is possible (at least in theory) to run the examples with different UI backends and an executable would be fixed to a specific backend.

[edit] 5 Publications and talks

See the respective list on the new Grapefruit website.

[edit] 6 Community

Grapefruit has a mailing list and a project management website where you can report bugs, for example.

[edit] 7 Screenshots

Below are some screenshots from the examples of an earlier Grapefruit version. The Simple example is also available in the current version, along with several other examples not mentioned here.

Simple
Clicking on the button adds a star to the caption of the button. This doesn’t look very meaningful. However, Simple is actually a very important example since it demonstrates that feedbacks work—the output of the button is transformed and then used as the button’s input.
Grapefruit-screenshot-Simple.png
Codebreaker
This is a Mastermind™-like game. The Add button is enabled if and only if the input field contains a valid code and the display box is enabled if and only if the list of guesses does not contain the code chosen by the computer. These properties are described in a declarative way in the source code.
Grapefruit-screenshot-Codebreaker.png
CircuitingObjects
This example demonstrates Grapefruit’s support for animations.
Grapefruit-screenshot-CircuitingObjects.png