Free monads are useful for many tree-like structures and domain specific languages.
A Monad n is a free Monad for f if every Monad homomorphism from n to another monad m is equivalent to a natural transformation from f to m.
Cofree comonads provide convenient ways to talk about branching streams and rose-trees, and can be used to annotate syntax trees.
A Comonad v is a cofree Comonad for f if every Comonad homomorphism another comonad w to v is equivalent to a natural transformation from w to f.
Release the storage associated with the given FunPtr, which must have been obtained from a wrapper stub. This should be called whenever the return value from a foreign import wrapper function is no longer required; otherwise, the storage it uses will leak.
Deallocate a memory pool and everything which has been allocated in the pool itself.
Dissolve the association between the stable pointer and the Haskell value. Afterwards, if the stable pointer is passed to deRefStablePtr or freeStablePtr, the behaviour is undefined. However, the stable pointer may still be passed to castStablePtrToPtr, but the Foreign.Ptr.Ptr () value returned by castStablePtrToPtr, in this case, is undefined (in particular, it may be Foreign.Ptr.nullPtr). Nevertheless, the call to castStablePtrToPtr is guaranteed not to diverge.
A free functor is a left adjoint to a forgetful functor. It used to be the case that the only category that was easy to work with in Haskell was Hask itself, so there were no interesting forgetful functors.
But the new ConstraintKinds feature of GHC provides an easy way of creating subcategories of Hask. That brings interesting opportunities for free (and cofree) functors.
The examples directory contains an implementation of non-empty lists as free semigroups, and automata as free actions. The standard example of free higher order functors is free monads, and this definition can be found in Data.Functor.HFree.
Cross-platform GUI library based on free monads
The free-theorems library allows to automatically generate free theorems from Haskell type expressions. It supports nearly all Haskell 98 types except of type constructor classes, and in addition it can also handle higher-rank functions. Free theorems are generated for three different sublanguages of Haskell, a basic one corresponding to the polymorphic lambda-calculus of Girard-Reynolds, an extension of that allowing for recursion and errors, and finally a sublanguage additionally allowing seq. In the last two sublanguages, also inequational free theorems may be derived in addition to classical equational results.
This program is to verify (or to put into question) strictness conditions on free theorems that arise if a polymorphic lambda calculus is enriched by general recursion. Given a type the program either returns an instance of the corresponding unrestricted free theorem that does not hold and thereby verifies the need of the additional restrictions or it returns without finding such an instantiation and thereby suggests (but not proves) that the strictness conditions are superfluous. The underlying algorithm is described in "Automatically Generating Counterexamples to Naive Free Theorems" (FLOPS'10) by Daniel Seidel and Janis Voigtländer. A webinterface for the program is also available at http://www-ps.iai.uni-bonn.de/cgi-bin/exfind.cgi.
Related to this package you may be interested in the online free theorem generator at http://www-ps.iai.uni-bonn.de/ft that is also available offline via http://hackage.haskell.org/cgi-bin/hackage-scripts/package/free-theorems-webui. Also interesting may be the tool polyseq that generates "optimal" free theorems in a polymorphic lambda calculus with selective strictness. Polyseq can be downloaded at http://hackage.haskell.org/cgi-bin/hackage-scripts/package/polyseq but the functionality is as well provided via a webinterface at http://www-ps.iai.uni-bonn.de/cgi-bin/polyseq.cgi.
A soccer game.
Interface to the Kinect device. Currently supports depth perception. (No video or audio.)
This package provides a preprocessor executable, 'freesect', which implements a broad generalisation of sections (dubbed 'free sections') for partial application and higher-order style. Some examples of free sections can be found in the included test suite; refer to the homepage for more info.
Wrapper around FreeType 2 library. Relevant exerpts from the FreeType 2 website:
What is FreeType 2?
FreeType 2 is a software font engine that is designed to be small, efficient, highly customizable, and portable while capable of producing high-quality output (glyph images). It can be used in graphics libraries, display servers, font conversion tools, text image generation tools, and many other products as well.
The following is a non-exhaustive list of features provided by FreeType 2.
* FreeType 2 provides a simple and easy-to-use API to access font content in a uniform way, independently of the file format. Additionally, some format-specific APIs can be used to access special data in the font file.
* Unlike most comparable libraries, FreeType 2 supports scalable font formats like TrueType or Type 1 natively and can return the outline data (and control instructions/hints) to client applications.
By default, FreeType 2 supports the following font formats.
* TrueType fonts (and collections)
* Type 1 fonts
* CID-keyed Type 1 fonts
* CFF fonts
* OpenType fonts (both TrueType and CFF variants)
* SFNT-based bitmap fonts
* X11 PCF fonts
* Windows FNT fonts
* BDF fonts (including anti-aliased ones)
* PFR fonts
* Type 42 fonts (limited support)
From a given glyph outline, FreeType 2 is capable of producing a high-quality monochrome bitmap, or anti-aliased pixmap, using 256 levels of gray. This is much better than the 5 levels used by Windows 9x/98/NT/2000 or FreeType 1.
FreeType 2 supports all the character mappings defined by the TrueType and OpenType specification. It is also capable of automatically synthetizing a Unicode charmap from Type 1 fonts, which puts an end to the painful 'encoding translation' headache common with this format (of course, original encodings are also available in the case where you need them).
The FreeType 2 core API provides simple functions to access advanced information like glyph names or kerning data.
FreeType 2 provides information that is often not available from other similar font engines, like kerning distances, glyph names, vertical metrics, etc.
FreeType 2 provides its own caching subsystem since release 2.0.1. It can be used to cache either face instances or glyph images efficiently.
Based on the freetype-gl library, with large modifications.
This is similar to the FTGL (http://hackage.haskell.org/package/FTGL) library, but avoids C++, which makes it easier to wrap and work with in Haskell-land.
Unfortunately, it seems not to perform as well as FTGL on some setups.
NOTE: Most of the demos and C-side documentation are out-of-date, as the C side was heavily modified, without updating many of the demos or the C documentation.
Show more results