https://wiki.haskell.org/api.php?action=feedcontributions&user=Mjgajda&feedformat=atomHaskellWiki - User contributions [en]2020-02-28T22:43:21ZUser contributionsMediaWiki 1.27.4https://wiki.haskell.org/index.php?title=Game_Development&diff=58916Game Development2014-09-28T05:43:07Z<p>Mjgajda: /* Wishlist */ Added pointers to existing octree and KD-tree implementations.</p>
<hr />
<div>[[Category:Games]] [[Category:Community]]<br />
<br />
This page and the #haskell-game [[IRC channel]] are the starting points for everyone interested in doing game development with Haskell. You may also wish to join the [http://www.haskellers.com/teams/7 Games group] on haskellers.com, or [http://www.reddit.com/r/haskellgamedev the Haskell game development subreddit].<br />
<br />
There are quite a lot of games, unfinished libraries, and interested people out there - please gather links here and join us on '''[irc://irc.freenode.net/#haskell-game #haskell-game]''' !<br />
<br />
== Games and game engines ==<br />
<br />
* [[Applications and libraries/Games]] lists [[Applications and libraries/Games#Games|games]] and [[Applications and libraries/Games#Game_Engines_and_Libraries|game engines/libs]]<br />
<br />
* See also Hackage categories: [http://hackage.haskell.org/packages/archive/pkg-list.html#cat:Game Game], [http://hackage.haskell.org/packages/archive/pkg-list.html#cat:Game%20Engine Game Engine], [http://hackage.haskell.org/packages/archive/pkg-list.html#cat:Graphics Graphics], [http://hackage.haskell.org/packages/archive/pkg-list.html#cat:Sound Sound], [http://hackage.haskell.org/packages/archive/pkg-list.html#cat:Physics Physics], [http://hackage.haskell.org/packages/#cat:FRP FRP]<br />
<br />
* Other game-related wiki pages: [[:category:Games]]<br />
<br />
<br />
=== Other supporting software ===<br />
<br />
* [http://hackage.haskell.org/package/grid grid] provides tools for working with regular arrangements of tiles, such as might be used in a board game or self-organising map (SOM). Grid currently supports triangular, square, and hexagonal tiles, with various 2D and toroidal layouts ([https://github.com/mhwombat/grid/wiki description]).<br />
<br />
== Articles and blog posts ==<br />
<!-- add new ones at the top, probably --><br />
<br />
* [https://github.com/alexander-b/master-thesis The Quest for Programming Nirvana: On Programming Game Systems in Haskell]; a Master Thesis on programming game systems in Haskell<br />
<br />
* [http://www.cse.unsw.edu.au/~pls/thesis/munc-thesis.pdf Functional Programming and 3D Games] (thesis, PDF)<br />
<br />
* [http://blog.chucklefish.org/?p=154 Wayward Tide: Technical Info]<br />
<br />
* [http://ocharles.org.uk/blog/posts/2013-08-18-asteroids-in-netwire.html Asteroids & Netwire]<br />
<br />
* [http://jshaskell.blogspot.nl/2012/09/breakout.html Writing JavaScript games in Haskell - Breakout]<br />
<br />
* [https://github.com/leonidas/codeblog/blob/master/2012/2012-01-17-declarative-game-logic-afrp.md Purely Functional, Declarative Game Logic Using Reactive Programming]<br />
<br />
* [http://folk.uio.no/carljsv/computergames/computergames.pdf Computer Games'] - trying to implement the game flow of a computer game<br />
<br />
* [http://lambda-the-ultimate.org/node/1277 The Next Mainstream Programming Languages: A Game Developer's Perspective] (PPT, PDF) presentation by Tim Sweeney<br />
<br />
* [http://prog21.dadgum.com/23.html Purely Functional Retrogames]<br />
<br />
* [http://prog21.dadgum.com/36.html Accidentally Introducing Side Effects into Purely Functional Code]<br />
<br />
* [http://legacy.cs.uu.nl/daan/download/papers/wxhaskell.pdf wxHaskell - A Portable and Concise GUI Library for Haskell] (PDF) - describes an implementation of an asteroids game, [[wxAsteroids]]<br />
<br />
* [http://www.palgorithm.co.uk/2009/08/haskell-for-games/ Haskell for Games!] Blog post, with PDF slides from AngloHaskell talk.<br />
<br />
* [http://www.gamasutra.com/view/feature/2985/postmortem_naughty_dogs_jak_and_.php Postmortem: Naughty Dog's Jak and Daxter: the Precursor Legacy]; an article about a game developed with a [http://en.wikipedia.org/wiki/Domain-specific_language DSL] compiler written in Lisp<br />
<br />
* [http://lambdor.net/ Lambdor] blog mostly about Yampa FRP and game development in Haskell with some tutorials<br />
<br />
* [http://jshaskell.blogspot.de/ Writing JavaScript games in Haskell]<br />
<br />
* [http://lambdacube3d.wordpress.com/ LambdaCube 3D] is a domain specific language and library that makes it possible to program GPUs in a purely functional style.<br />
<br />
== Videos ==<br />
* <strike>[http://video.google.com/videoplay?docid=9139666903029663537 Games in Haskell] - Matthew Sackman and Tristan Allwood on developing games with OpenGL in Haskell</strike> (404)<br />
<br />
* [http://www.youtube.com/watch?v=AJQZg3Po-Ag bloxors: an OpenGL Logic Game written in Haskell]<br />
<br />
* [http://www.youtube.com/watch?v=XoE5CKLLnaM LambdaCube 3D - Stunts example]<br />
<br />
* [http://www.youtube.com/watch?v=JleoASegUlk LambdaCube 3D - Quake 3 example]<br />
<br />
== Examples ==<br />
<!-- add new ones at the top, probably --><br />
<br />
* [http://folk.uio.no/carljsv/gorillabas/ GorillaBAS] - this was an attempt on defining computer games, and build such a thing.<br />
<br />
* https://github.com/mlesniak/game - Haskell/OpenGL/Chipmunk game prototypes<br />
<br />
* [[wxAsteroids]], a well-documented game, based on [[wxHaskell]]<br />
<br />
* [https://github.com/simonmichael/hssdl-mac-example hssdl-mac-example] - how to make an SDL-using package buildable on mac OSX<br />
<br />
* http://codepad.org/LRGEkkDp - initialization for SDL to start rendering OpenGL stuff<br />
<br />
* http://hackage.haskell.org/package/stunts - A revival of the classic racing game Stunts to serve as a non-toy-sized example for LambdaCube.<br />
<br />
* http://hackage.haskell.org/package/dow - Dungeons of Wor is an homage to the classic arcade game, Wizard of Wor. This game is also an experiment in functional reactive programming, so it might be a useful resource to anyone interested in this topic.<br />
<br />
* Possible Hackage categorisation guidelines: upload games to Game, engines and libs to Game Engine, or at least to some category beginning with Game, and check latest categories before uploading<br />
<br />
== Wishlist ==<br />
<br />
Is Hackage missing a useful data structure or library for some functionality that would benefit game programming? Suggestions for useful things can be added here as potential projects to hack on.<br />
<br />
* [https://hackage.haskell.org/package/Octree Octtree], [http://hackage.haskell.org/package/KdTree kd]-[http://hackage.haskell.org/package/kd-tree tree], various space partitioning techniques (maybe start with [http://hackage.haskell.org/package/spacepart spacepart]).<br />
<br />
* Binding to [http://www.fmod.org fmod]<br />
<br />
* Binding to [http://enet.bespin.org/Features.html enet] for multiplayer games. (jeffz is working on this).</div>Mjgajdahttps://wiki.haskell.org/index.php?title=Applications_and_libraries/Bioinformatics&diff=57288Applications and libraries/Bioinformatics2013-12-06T18:30:00Z<p>Mjgajda: /* The Biohaskell library and applications */ ADPFusion is now redir to CHvS</p>
<hr />
<div>== The [http://www.biohaskell.org/ Biohaskell library] and applications ==<br />
<br />
There are [http://biohaskell.org/Libraries three main kinds of the libraries] within BioHaskell project:<br />
<br />
* sequence and alignment processing -- see [http://malde.org/~ketil/biohaskell/ Ketil's bioinformatics] [http://www.ii.uib.no/~ketil/bioinformatics/ pages], and [http://blog.malde.org his blog]. In particular:<br />
** xsact - a sequence clustering tool (currently in revision 1.5).<br />
** xtract - a sequence assembly tool which uses an interesting algorithm based on de Bruijn graphs, but unfortunately is hard to tune to give optimal results. Unless you plan to fix it, use CAP3 instead.<br />
** rbr - a sequence masking tool, masking ESTs based on a statistical measure of word frequencies.<br />
** rselect - a simple and efficient tool for extracting random sets of sequences<br />
** [http://hackage.haskell.org/package/blastxml blastxml] - parser for Blast XML data output.<br />
** [http://hackage.haskell.org/package/blastHTTP blastHTTP] - tool to query [http://blast.ncbi.nlm.nih.gov/ NCBI Blast service]<br />
<br />
* RNA secondary structure tools, some of them using [http://www.tbi.univie.ac.at/~choener/adpfusion/ ADPFusion framework].<br />
<br />
* Structural libraries:<br />
** [http://hackage.haskell.org/package/hPDB hPDB] - fastest parallel Protein Databank parser according to [http://www.biomedcentral.com/1756-0500/6/483/abstract this benchmark].<br />
** [http://hackage.haskell.org/package/parsestar parseSTAR] - parser for [http://www.bmrb.wisc.edu Biological Magnetic Resonance Bank] data.<br />
** [http://hackage.haskell.org/package/hTalos hTalos] - parser for [http://spin.niddk.nih.gov/NMRPipe/talos/ TALOS+] output.<br />
<br />
== PolyFARM ==<br />
<br />
;[http://www.aber.ac.uk/en/cs/research/cb/dss/polyfarm/ PolyFARM]<br />
:PolyFARM (Poly-machine First-order Association Rule Mining) is a data mining program which finds first order associations in Datalog data. It is based on the ideas from WARMR (L. Dehaspe and L. De Raedt (1997) Mining Association Rules in Multiple Relations. It is described in Clare, A. and King R.D. (2003) "Data mining the yeast genome in a lazy functional language."<br />
<br />
== Other ==<br />
<br />
* [http://people.cs.missouri.edu/~harrisonwl/ Bill Harrison]<br />
* [http://www.techfak.uni-bielefeld.de/ags/pi/ Robert Giegerich's group (AGPI) at Bielefeld University]<br />
<br />
{{LibrariesPage}}</div>Mjgajdahttps://wiki.haskell.org/index.php?title=Applications_and_libraries/Bioinformatics&diff=57287Applications and libraries/Bioinformatics2013-12-06T18:28:44Z<p>Mjgajda: /* Other */ Updated Bill Harrison's link, are we sure it is relevant? I see no recent papers on bioinformatics. Just few on Haskell and monads.</p>
<hr />
<div>== The [http://www.biohaskell.org/ Biohaskell library] and applications ==<br />
<br />
There are [http://biohaskell.org/Libraries three main kinds of the libraries] within BioHaskell project:<br />
<br />
* sequence and alignment processing -- see [http://malde.org/~ketil/biohaskell/ Ketil's bioinformatics] [http://www.ii.uib.no/~ketil/bioinformatics/ pages], and [http://blog.malde.org his blog]. In particular:<br />
** xsact - a sequence clustering tool (currently in revision 1.5).<br />
** xtract - a sequence assembly tool which uses an interesting algorithm based on de Bruijn graphs, but unfortunately is hard to tune to give optimal results. Unless you plan to fix it, use CAP3 instead.<br />
** rbr - a sequence masking tool, masking ESTs based on a statistical measure of word frequencies.<br />
** rselect - a simple and efficient tool for extracting random sets of sequences<br />
** [http://hackage.haskell.org/package/blastxml blastxml] - parser for Blast XML data output.<br />
** [http://hackage.haskell.org/package/blastHTTP blastHTTP] - tool to query [http://blast.ncbi.nlm.nih.gov/ NCBI Blast service]<br />
<br />
* RNA secondary structure tools, some of them using [http://www.tbi.univie.ac.at/~choener/adpfusion/ ADPFusion framework] from [http://www.techfak.uni-bielefeld.de/ags/pi/pages/bioinformatics.htm Robert Giegerich group].<br />
<br />
* Structural libraries:<br />
** [http://hackage.haskell.org/package/hPDB hPDB] - fastest parallel Protein Databank parser according to [http://www.biomedcentral.com/1756-0500/6/483/abstract this benchmark].<br />
** [http://hackage.haskell.org/package/parsestar parseSTAR] - parser for [http://www.bmrb.wisc.edu Biological Magnetic Resonance Bank] data.<br />
** [http://hackage.haskell.org/package/hTalos hTalos] - parser for [http://spin.niddk.nih.gov/NMRPipe/talos/ TALOS+] output.<br />
<br />
== PolyFARM ==<br />
<br />
;[http://www.aber.ac.uk/en/cs/research/cb/dss/polyfarm/ PolyFARM]<br />
:PolyFARM (Poly-machine First-order Association Rule Mining) is a data mining program which finds first order associations in Datalog data. It is based on the ideas from WARMR (L. Dehaspe and L. De Raedt (1997) Mining Association Rules in Multiple Relations. It is described in Clare, A. and King R.D. (2003) "Data mining the yeast genome in a lazy functional language."<br />
<br />
== Other ==<br />
<br />
* [http://people.cs.missouri.edu/~harrisonwl/ Bill Harrison]<br />
* [http://www.techfak.uni-bielefeld.de/ags/pi/ Robert Giegerich's group (AGPI) at Bielefeld University]<br />
<br />
{{LibrariesPage}}</div>Mjgajdahttps://wiki.haskell.org/index.php?title=Applications_and_libraries/Bioinformatics&diff=57286Applications and libraries/Bioinformatics2013-12-06T18:22:08Z<p>Mjgajda: /* The Biohaskell library and applications */ Updated outline of BioHaskell libraries.</p>
<hr />
<div>== The [http://www.biohaskell.org/ Biohaskell library] and applications ==<br />
<br />
There are [http://biohaskell.org/Libraries three main kinds of the libraries] within BioHaskell project:<br />
<br />
* sequence and alignment processing -- see [http://malde.org/~ketil/biohaskell/ Ketil's bioinformatics] [http://www.ii.uib.no/~ketil/bioinformatics/ pages], and [http://blog.malde.org his blog]. In particular:<br />
** xsact - a sequence clustering tool (currently in revision 1.5).<br />
** xtract - a sequence assembly tool which uses an interesting algorithm based on de Bruijn graphs, but unfortunately is hard to tune to give optimal results. Unless you plan to fix it, use CAP3 instead.<br />
** rbr - a sequence masking tool, masking ESTs based on a statistical measure of word frequencies.<br />
** rselect - a simple and efficient tool for extracting random sets of sequences<br />
** [http://hackage.haskell.org/package/blastxml blastxml] - parser for Blast XML data output.<br />
** [http://hackage.haskell.org/package/blastHTTP blastHTTP] - tool to query [http://blast.ncbi.nlm.nih.gov/ NCBI Blast service]<br />
<br />
* RNA secondary structure tools, some of them using [http://www.tbi.univie.ac.at/~choener/adpfusion/ ADPFusion framework] from [http://www.techfak.uni-bielefeld.de/ags/pi/pages/bioinformatics.htm Robert Giegerich group].<br />
<br />
* Structural libraries:<br />
** [http://hackage.haskell.org/package/hPDB hPDB] - fastest parallel Protein Databank parser according to [http://www.biomedcentral.com/1756-0500/6/483/abstract this benchmark].<br />
** [http://hackage.haskell.org/package/parsestar parseSTAR] - parser for [http://www.bmrb.wisc.edu Biological Magnetic Resonance Bank] data.<br />
** [http://hackage.haskell.org/package/hTalos hTalos] - parser for [http://spin.niddk.nih.gov/NMRPipe/talos/ TALOS+] output.<br />
<br />
== PolyFARM ==<br />
<br />
;[http://www.aber.ac.uk/en/cs/research/cb/dss/polyfarm/ PolyFARM]<br />
:PolyFARM (Poly-machine First-order Association Rule Mining) is a data mining program which finds first order associations in Datalog data. It is based on the ideas from WARMR (L. Dehaspe and L. De Raedt (1997) Mining Association Rules in Multiple Relations. It is described in Clare, A. and King R.D. (2003) "Data mining the yeast genome in a lazy functional language."<br />
<br />
== Other ==<br />
<br />
* [http://www.cs.missouri.edu/~harrisonwl/abstracts.html Bill Harrison]<br />
* [http://www.techfak.uni-bielefeld.de/ags/pi/ Robert Giegerich's group (AGPI) at Bielefeld University]<br />
<br />
{{LibrariesPage}}</div>Mjgajdahttps://wiki.haskell.org/index.php?title=Applications_and_libraries/Data_structures&diff=54201Applications and libraries/Data structures2012-10-06T15:22:27Z<p>Mjgajda: Added reference for 2/3/N-dimensional spatial index structures.</p>
<hr />
<div>{{unknown copyright}}<br />
{{LibrariesPage}}<br />
<br />
==General libraries and tools for data structures==<br />
<br />
;[http://www.cs.princeton.edu/~rdockins/edison/home/ Edison]<br />
:This is the latest version of the Edison library of efficient data structures. There are also [http://www.haskell.org/ghc/docs/edison/ earlier version of Edison] by Chris Okasaki. It provides sequences, finite maps, priority queues, and sets/bags. ([http://www.eecs.usma.edu/Personnel/okasaki/pubs.html#hw00 overview paper]).<br />
<br />
;[[Library/New collections]]<br />
:This is a package of many useful collections types. Advantages include:<br />
:*It's easy to migrate from standard Lists/Sets/Maps to the new package. The package is an evolution (rather than a revolution) of the collections currently in the base package.<br />
:*Each collection type fits in a consistent framework (thanks to classes)<br />
:*An extensive QuickCheck test suite also serves as detailed specification for the collections.<br />
<br />
:This package includes and supercedes the following libraries:<br />
<br />
:;[http://homepages.nildram.co.uk/~ahey/HLibs/Data.Tree.AVL/ Data.Tree.AVL]<br />
::An implementation of AVL trees and related utilities.<br />
<br />
:;[http://homepages.nildram.co.uk/~ahey/HLibs/Data.StringMap/ Data.StringMap]<br />
::A library providing maps from String keys to values, based on Tries.<br />
<br />
:This package includes the following libraries, but they are maintained separately:<br />
<br />
:;[http://sourceforge.net/projects/ranged-sets/ Ranged Sets]<br />
::A ranged set is a list of non-overlapping ranges. The ranges have upper and lower boundaries, and a boundary divides the base type into values above and below. No value can ever sit on a boundary. So you can have the set {2.0 < x <= 3.0, 5.3 < x < 6}<br />
<br />
;[http://www.cs.vu.nl/Strafunski/ Strafunski]<br />
:A bundle for generic programming. It provides programming support for generic traversal as useful in the implementation of program transformations.<br />
<br />
;[http://www.lochan.org/2005/keith-cl/libs/ Partial v0.1]<br />
:The Partial library provides a partial order class. It also provides routines for generating a Hasse diagram from a set and a partial order. Renderers are provided for the abstract Hasse diagram representation into LaTeX (via Xy-pic) and into dot, the format for AT&amp;T's Graphviz tools. Since no horizontal sorting is done, the Xy-pic output is rather poor at present; dot does a much better job with its layout optimisation algorithm.<br />
<br />
;[http://web.engr.oregonstate.edu/~erwig/diet/ Discrete Interval Encoding Trees]<br />
:The discrete interval encoding tree (DIET) is a structure for storing subsets of types having a total order and a predecessor and a successor function.<br />
<br />
;[http://www.cwi.nl/~ralf/HList/ HList]<br />
:A heterogeneous collection is a datatype that is capable of storing data of different types, while providing operations for look-up, update, iteration, and others. There are various kinds of heterogeneous collections, differing in representation, invariants, and access operations.<br />
<br />
;[http://www.csee.ogi.edu/~diatchki/monadLib monadLib]<br />
:Iavor Diatchki's library of monad transformers for Haskell. It enables the quick construction of monads --- abstract data types that capture common programming idioms, such as throwing and catching exceptions or continuations. In many programming languages such features are built into the language (if they're provided at all), but in Haskell they are user-programmable.<br />
<br />
;[http://wiki.di.uminho.pt/wiki/bin/view/Alcino/PointlessHaskell Pointless Haskell]<br />
:Pointless Haskell is library for [[pointfree|point-free]] programming with recursion patterns defined as hylomorphisms. It also allows the visualization of the intermediate data structure of the hylomorphisms with GHood. This feature together with the DrHylo tool allows us to easily visualize recursion trees of Haskell functions.<br />
<br />
;[http://www.informatik.uni-freiburg.de/~wehr/haskell/ rhaskell : Reactive Objects]<br />
:Stefan Wehr's reactive objects library. Reactive objects are a convenient abstraction for writing programs which have to interact with a concurrent environment. A reactive object has two characteristics: the abandonment of all blocking operations and the unification of the concepts state and process. The former allows a reactive object to accept input from multiple sources without imposing any ordering on the input events. The latter prevents race conditions because the state of an object is only manipulated from the process belonging to the object.<br />
<br />
;[http://repetae.net/john/recent/out/GenUtil.html GenUtil]<br />
:A collection of random useful utility functions written in pure Haskell 98. In general, it tries to conform to the naming scheme put forth in the Haskell prelude and fill in the obvious omissions, as well as providing useful routines in general.<br />
<br />
;[http://www.cs.uu.nl/~afie/pd09122004.zip PersistentDocument] ''The link is dead, somebody please either update it or remove it.''<br />
:The persistent document abstraction takes care of dealing with a document you want to open from and save to disk and that supports undo. This functionality can be used by editors of arbitrary documents and saves you a lot of quite subtle coding.<br />
<br />
;[[Zipper monad]]<br />
:A generic monad for navigating around arbitrary data structures<br />
<br />
==Graphs==<br />
<br />
;[http://web.engr.oregonstate.edu/~erwig/fgl/haskell/ FGL - A Functional Graph Library]<br />
:The functional graph library provides a collection of graph operations.<br />
<br />
;[http://wiki.di.uminho.pt/wiki/bin/view/PURe/PUReSoftware Data.Relation]<br />
:Part of the UMinho Haskell libraries, this library provides a representation and operations on relations. A special case of relations are graphs. The operations include graph chopping and slicing, strong connected component analysis, graphs metrics, and more.<br />
<br />
;[http://article.gmane.org/gmane.comp.lang.haskell.libraries/4739 Haskell Graph Automorphism Library]<br />
:Jean-Philippe Bernardy's implementation of Brendan McKay's algorithm for graph canonical labeling and automorphism group (Nauty).<br />
<br />
==IO==<br />
<br />
;[[Library/Streams | Streams]]<br />
:Streams is a feature-rich, flexible, extensible, backward-compatible and fast I/O library. It supports various stream types: files and legacy Handle type, string and memory buffers, pipes. There is also common functionality available for any stream: buffering, Char encoding, locking.<br />
<br />
;[[Binary IO]]<br />
<br />
==Mutable data==<br />
<br />
;[http://www.isi.edu/~hdaume/STPP/ The Haskell STate Preprocessor]<br />
:This is a short preprocessor for stateful Haskell programs. It aleviates the pain of performing single array lookup/write/update functions with some syntax to support it. It also supports hash table operations based on the HashTable implementation available from the author. Finally, it supports monadic if and monadic case constructions. It is lightweight in the sense that it performs no syntactic analysis and is essentially a character transformer.<br />
<br />
;[[Library/ArrayRef | Arrays & References Library]]<br />
:Featuring:<br />
* Unboxed references in IO and ST monads<br />
* Monad-independent interfaces to boxed and unboxed references<br />
* Syntax sugar to make using of mutable objects easier (=:, +=, -=,..)<br />
* Reimplemented Arrays library with the following improvements:<br />
* Unboxed arrays now can be used in polymorphic functions<br />
* The MArray class now supports arrays with dynamic bounds<br />
* Implementation of dynamic (resizable) arrays<br />
<br />
;[http://code.haskell.org/storablevector/ Data.StorableVector.ST]<br />
:StorableVector also support mutation in ST monad.<br />
<br />
See also [[Modern array libraries]]<br />
<br />
==Lists==<br />
<br />
;[http://code.google.com/p/slist/ SList] ''(broken link)''<br />
:Sized lists for Haskell<br />
<br />
;[http://www.cse.unsw.edu.au/~dons/dlist.html dlist]<br />
:Difference lists (supporting O(1) append and snoc)<br />
<br />
==Strings==<br />
<br />
;[http://www.cse.unsw.edu.au/~dons/fps.html Data.ByteString]<br />
:The FPS library provides mmapped and malloc'd packed strings (byte arrays held by a ForeignPtr), along with a list interface to these strings. It lets you do extremely fast I/O in Haskell; in some cases, even faster than typical C implementations, as well as conserving space.<br />
<br />
;[http://hackage.haskell.org/package/Data-Rope Data.Rope]<br />
:A well-known tree data structure for manipulating strings without (too many) memory copies, contrarily to what Data.ByteString does. Also, contrarily to the functions in Data.ByteString.Lazy, most operations on ropes are in O(log n).<br />
<br />
;[http://code.haskell.org/storablevector/ Data.StorableVector]<br />
:This is very much the same like Data.ByteString extended to any Storable element type. There is a data structure for monolithic blocks and chunky sequences. Mutable access is also possible in ST monad.<br />
<br />
;[http://software.complete.org/missingh/ MissingH]<br />
:MissingH is a library of pure-Haskell utility functions relating to strings, logging, and I/O.<br />
<br />
;[http://repetae.net/john/recent/out/HsLocale.html HsLocale]<br />
:A locale-aware replacement for the standard IO routines, and support for ''wide'' strings<br />
<br />
;[http://www.cse.unsw.edu.au/~dons/code/icfp05/tests/unit-tests/VariableExpansion.hs VariableExpansion]<br />
:A library for variable expansion inside strings<br />
<br />
;[http://haskell-i18n.cvs.sourceforge.net/haskell-i18n/ i18n strings]<br />
:At sourceforge<br />
<br />
==Regular expressions==<br />
<br />
There are many libraries for regular expressions available. By default<br />
GHC comes with:<br />
<br />
;[http://darcs.haskell.org/packages/regex-base/ regex-base]<br />
:This defines the type classes for the new API<br />
<br />
;[http://darcs.haskell.org/packages/regex-compat/ regex-compat]<br />
:This defines the old Text.Regex.Posix API, using regex-posix<br />
<br />
;[http://darcs.haskell.org/packages/regex-posix/ regex-posix]<br />
:This is the interface to the old (and slow) posix backend (C's regex.h)<br />
<br />
All backends provide String and ByteString interfaces.<br />
<br />
Additional backend libraries are available for (hopefully) more efficient regular expression<br />
implementations:<br />
<br />
;[http://darcs.haskell.org/packages/regex-pcre/ regex-pcre]<br />
:PCRE-based regexes. This requires [http://www.pcre.org/ libpcre] (currently works against version 6.6.0 as of January 2007). This Haskell library and libpcre are both BSD. This is very fast but has left branch semantics instead of POSIX leftmost longest semantics.<br />
<br />
;[http://darcs.haskell.org/packages/regex-tre/ regex-tre]<br />
:TRE-based regexes. This requires [http://laurikari.net/tre/ libtre] (currently works against version 0.7.5 as of January 2007). Libtre aims to be POSIX compatible and is a much faster implementation that used by regex-posix. Note that libtre does have an [http://laurikari.net/pipermail/tre-general/2007-January/000083.html outstanding bug] in correctly interpreting some regular expressions. This Haskell package is BSD-3 licensed and libtre is LGPL.<br />
<br />
;[http://darcs.haskell.org/packages/regex-parsec/ regex-parsec]<br />
:Pure Haskell regexes implemented via parsec. The leftmost longest subexpression capture semantics of this library differ from the POSIX standard. This also has an option to prefer the left branch semantics that libpcre uses.<br />
<br />
;[http://darcs.haskell.org/packages/regex-dfa/ regex-dfa]<br />
:Pure Haskell DFA for regexes. This is licensed under LPGL (the above packages are all under BSD-3) due to derived code. This is faster than regex-parsec but does not return captured subexpressions. It also is being updated to handle repeated patterns that can match empty strings (the older version hangs, the new version rewrites the pattern internally).<br />
<br />
;There is a regex-tdfa packages in development (not released) that will be a pure Haskell and BSD-3 licensed implementation inspired by libtre. It aims to be a replacement for regex-posix.<br />
<br />
;Development versions (possible unstable or broken) of the above packages are also available under [http://darcs.haskell.org/packages/regex-unstable/ regex-unstable]. For support, please use the [[Mailing_lists | haskell-cafe]] mailing list.<br />
<br />
==Spatial indices==<br />
There are several libraries containing generic code for maps indexed by 2D, 3D or N-dimensional points that support efficient nearest-neighbour or range operations:<br />
<br />
* 2D:<br />
:;[http://hackage.haskell.org/package/spacepart spacepart]<br />
::Contains quadtree implementation.<br />
<br />
* 3D:<br />
:;[http://hackage.haskell.org/package/Octree octree]<br />
:: Simple unbalanced octrees.<br />
<br />
* Of arbitrary dimensionality:<br />
<br />
:;[http://hackage.haskell.org/package/pktree pktree]<br />
::PK-trees support both radius and rectangular range search.<br />
<br />
:;[http://hackage.haskell.org/package/KdTree k-d tree]<br />
::k-d trees also support efficient range and nearest neighbour search<br />
<br />
==Serialising data==<br />
<br />
;[http://www.cse.unsw.edu.au/~dons/binary/Data-Binary.html Data.Binary] ([http://darcs.haskell.org/binary/ darcs repository])<br />
;A library for serialising binary values to and from lazy ByteStrings.<br />
<br />
;[http://www.n-heptane.com/nhlab/repos/NewBinary NewBinary]<br />
:A port of Malcolm Wallace's Binary library from NHC, offering facilities for heap compression and binary I/O. The de-facto standard for binary I/O in Haskell<br />
<br />
;[http://www.cs.helsinki.fi/u/ekarttun/SerTH/ SerTH]<br />
:SerTH is a binary serialization library for Haskell. It supports serializing cyclic datatypes in a fast binary format. SerTH uses template haskell for deriving the serializing interface for new datatypes.<br />
<br />
;[[Library/AltBinary | AltBinary]]<br />
: AltBinary is an exhaustive library that support binary I/O and serialization. It's part of [http://haskell.org/haskellwiki/Library/Streams Streams] library, so serialization is possible to any I/O source, from String to memory-mapped file. It's also backward compatible with [http://www.n-heptane.com/nhlab/repos/NewBinary NewBinary] library what makes translation of old code trivial. Very fast, very feature-rich, Hugs/GHC compatible, etc, etc...<br />
<br />
;[http://svn.openfoundry.org/pugs/third-party/HsSyck/ HsSyck]<br />
:YAML is a straightforward machine parsable data serialization format designed for human readability and interaction with dynamic languages. It is optimized for data serialization, configuration settings, log files, Internet messaging and filtering. Syck is an extension, written in C, for reading and writing YAML swiftly in popular scripting languages. It is part of core Ruby, and also has bindings for Perl 5, Python, Lua, Cocoa, and Perl 6. HsSyck provides Data.Yaml.Syck as an interface to YAML structures, using Data.ByteString for efficient textual data representation. Additionally, we provide a set of DrIFT rules to dump and load arbitrary Haskell data types in the YAML format.<br />
<br />
;[[GenericSerialize]]<br />
:GenericSerialize is a library which serializes data using the "Scrap Your Boilerplate" infrastructure. This means that while it cannot easily support data-structure-specific serialization, it can support many different data formats cheaply.<br />
<br />
==Compressing data==<br />
<br />
;[[Library/Compression | Compressions-2005]]<br />
:Features of the Compression-2005 Library ([http://freearc.narod.ru/ homepage])<br />
* easy and uniform access to most competitive free compression algorithms as of April'05: LZMA, PPMd and GRZip<br />
* all input/output performed via user-supplied functions (callbacks), so you can compress data in memory, files, pipes, sockets and anything else<br />
* all parameters of compression algorithm are defined with a single string, for example "lzma:8mb:fast:hc4:fb32". <br />
* Using this library, you can write a bzip-like utility in one line, with better compression results than bzip2 itself.<br />
<br />
;[http://hackage.haskell.org/cgi-bin/hackage-scripts/package/zlib Zlib]<br />
:Zlib bindings for ByteStrings. darcs get http://code.haskell.org/zlib/ ([http://hackage.haskell.org/cgi-bin/hackage-scripts/package/zlib docs])<br />
<br />
;[http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bzlib BZip2]<br />
:BZip2 bindings for ByteStrings. darcs get http://code.haskell.org/bzlib/ ([http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bzlib docs])<br />
<br />
==Benchmarking data structures==<br />
<br />
;[http://www.cs.york.ac.uk/fp/auburn/ Auburn]<br />
:Auburn is Graeme Moss's kit for benchmarking implementations of lazy data structures. Give it several implementations of an ADT (abstract data type) and it will tell you which one is best for your particular application.<br />
<br />
;[http://www.cse.unsw.edu.au/~dons/code/fps/tests/Bench.hs Bench]<br />
:Simple time and space benchmarking for various list-like data structures. Easily adapted to arbitrary structures<br />
<br />
==Generic traversals==<br />
<br />
;[http://eecs.oregonstate.edu/~erwig/reclib/ RecLib A Recursion and Traversal Library for Haskell]<br />
:The Recursion Library for Haskell provides a rich set of generic traversal strategies to facilitate the flexible specification of generic term traversals. The underlying mechanism is the Scrap Your Boilerplate (SYB) approach. Most of the strategies that are used to implement recursion operators are taken from Stratego.<br />
<br />
==Typesafe variants of <hask>IntSet</hask> and <hask>IntMap</hask> for enumerations==<br />
<br />
* ChrisKuklewicz wrote a bit of boilerplate to re-use IntSet and IntMap with any Enum type: [[EnumSet EnumMap]]<br />
* an efficient implementation of EnumSet for sets which fit into a machine word can be found in [http://www.eecs.tufts.edu/~rdocki01/docs/edison/Data-Edison-Coll-EnumSet.html Edison] (see above)<br />
<br />
==Hackage==<br />
<br />
* [http://hackage.haskell.org/packages/archive/pkg-list.html#cat:Data%20Structures Data structures on Hackage]<br />
* [http://hackage.haskell.org/packages/archive/pkg-list.html#cat:Data More data structures on Hackage]<br />
* [http://hackage.haskell.org/packages/archive/pkg-list.html#cat:Generics Generics on Hackage]</div>Mjgajdahttps://wiki.haskell.org/index.php?title=Cloud_Haskell&diff=54189Cloud Haskell2012-10-06T12:44:30Z<p>Mjgajda: /* Serializable */</p>
<hr />
<div>Cloud Haskell is a domain-speciﬁc language for developing programs for a distributed computing environment. Implemented as a shallow embedding in Haskell, it provides a message passing communication model, inspired by Erlang, without introducing incompatibility with Haskell’s established shared-memory<br />
concurrency.<br />
<br />
== Availability ==<br />
<br />
Cloud Haskell is available from Hackage as [http://hackage.haskell.org/package/distributed-process distributed-process]. You might also want to install [http://hackage.haskell.org/package/distributed-process-simplelocalnet distributed-process-simplelocalnet]. The cutting edge development version is on [https://github.com/haskell-distributed/distributed-process github]. <br />
<br />
There is also the older prototype implementation [http://hackage.haskell.org/package/remote remote] (also available from [https://github.com/jepst/CloudHaskell github]).<br />
<br />
== Documentation ==<br />
<br />
For an overview of Cloud Haskell it's probably a good idea to read ''Towards Haskell in the Cloud'' (details below). The relevant documentation (in order of importance is)<br />
<br />
* [http://hackage.haskell.org/packages/archive/distributed-process/latest/doc/html/Control-Distributed-Process.html Control.Distributed.Process]<br />
* [http://hackage.haskell.org/packages/archive/distributed-process/latest/doc/html/Control-Distributed-Process-Closure.html Control.Distributed.Process.Closure]<br />
* [http://hackage.haskell.org/packages/archive/distributed-process/latest/doc/html/Control-Distributed-Process-Node.html Control.Distributed.Process.Node]<br />
<br />
and<br />
<br />
* [http://hackage.haskell.org/packages/archive/distributed-process-simplelocalnet/latest/doc/html/Control-Distributed-Process-Backend-SimpleLocalnet.html Control.Distributed.Process.SimpleLocalnet]<br />
<br />
If you want to know more details about <tt>Closure</tt> or <tt>Static</tt> (without the Template Haskell magic on top) you might want to read<br />
<br />
* [http://hackage.haskell.org/packages/archive/distributed-static/latest/doc/html/Control-Distributed-Static.html Control.Distributed.Static]<br />
<br />
== Blog Posts ==<br />
<br />
Cloud Haskell intros<br />
<br />
* [http://www.well-typed.com/blog/68 A Cloud Haskell Appetiser (Parallel Haskell Digest 11)]<br />
<br />
Alen Ribic has a series of blog posts about (Cloud) Haskell on the Raspberry Pi<br />
<br />
* [http://alenribic.com/writings/post/running-haskell-on-raspberry-pi Running Haskell on Raspberry Pi]<br />
* [http://alenribic.com/writings/post/raspberry-pi-in-a-haskell-cloud Raspberry Pi in a Haskell Cloud]<br />
<br />
Well-Typed have a series of blog posts "Communication Patterns in Cloud Haskell"<br />
<br />
* [http://www.well-typed.com/blog/71 Part 1: Master-Slave, Work-Stealing and Work-Pushing]<br />
* Part 2: Performance (to appear)<br />
* Part 3: Map-Reduce (to appear)<br />
* Part 4: K-Means (to appear) <br />
<br />
== Papers ==<br />
<br />
* [http://research.microsoft.com/en-us/um/people/simonpj/papers/parallel/remote.pdf Towards Haskell in the Cloud], Jeff Epstein, Andrew Black, and and Simon Peyton Jones. Haskell Symposium, Tokyo, Sept 2011.<br />
* [http://research.microsoft.com/en-us/um/people/simonpj/papers/parallel/epstein-thesis.pdf Functional programming for the data centre], Jeff Epstein. Masters Thesis, University of Cambridge, 2011<br />
<br />
== Other Useful Packages ==<br />
<br />
=== Serializable ===<br />
<br />
A core concept in Cloud Haskell is that of ''serializable'' values. The <tt>Serializable</tt> type class combines <tt>Typeable</tt> and <tt>Binary</tt>. <tt>ghc</tt> can automatically derive <tt>Typeable</tt> instances for custom data types, but you need a package to derive <tt>Binary</tt>. There are various packages available that assist with this:<br />
<br />
* [http://hackage.haskell.org/package/binary-generic binary-generic]<br />
* [http://hackage.haskell.org/package/binary-derive binary-derive]<br />
* [http://hackage.haskell.org/package/generic-binary generic-binary]<br />
* [http://hackage.haskell.org/package/derive derive]<br />
<br />
<tt>binary-generic</tt> and <tt>derive</tt> have been confirmed to work with Cloud Haskell; the status of the other packages is unknown -- YMMV (please feel free to update this wiki page if you have more information).</div>Mjgajda