Instructions for building under Windows This section gives detailed instructions for how to build GHC from source on your Windows machine. Similar instructions for installing and running GHC may be found in the user guide. Make sure you read the preceding section on platforms before reading section. You don't need Cygwin or MSYS to use GHC, but you do need one or the other to build GHC
Efficiently translating Haskell to JVM Bytecode using GHC's intermediate language, STG. LambdaVM is the proof that complete and efficient translation is possible. LambdaVM is a set of patches to GHC's which extend it to fully support generating useable JVM bytecode. It modifies the three primary components of GHC: * The compiler itself: The compiler has been modified to transform STG, one of GHC's many intermediate languages, to JVM bytecode. * The runtime system (RTS): GHC's RTS implemented as a mix of C and C-- has been reimplemented in Java. * The base libraries: GHC's base libraries have been modified to run on top of Java's standard libraries rather than ANSI C/POSIX libraries. October, 2008 Update LambdaVM is coming back! I've fixed all the GHC 6.8.x build problems and the instructions below should once again work. LambdaVM itself is still based on a circa November, 2007 GHC HEAD but moving all my changes to the current HEAD is next
LambdaVM is a JVM backend for GHC. It is available at http://darcs.brianweb.net/ghc. October, 2008 Update See http://www.cs.rit.edu/~bja8464/lambdavm/ Documentation * Building Guide * FFI * Exceptions * Concurrency Misc Notes * Implementation * Todo * NestedVM Integration
S Peyton Jones, D Vytiniotis, S Weirich, and G Washburn, ICFP 2006, pp50-61 Generalized algebraic data types (GADTs), sometimes known as "guarded recursive data types" or "first-class phantom types", are a simple but powerful generalization of the data types of Haskell and ML. Recent works have given compelling examples of the utility of GADTs, although type inference is known to be difficult. Our contribution is to show how to exploit programmer-supplied type annotations to make the type inference task almost embarrassingly easy. Our main technical innovation is wobbly types, which express in a declarative way the uncertainty caused by the incremental nature of typical type-inference algorithms. [This is a version of Wobbly types: type inference for generalised algebraic data types. Relative to ICFP 2006, the PDF above also describes a simplification to the type system, at the cost of extra annotation burden. This simpler system is the one actually implemented in GHC 6.8]
This article is part three in a series on introductory Haskell programming. In the first article, we wrote a small program to recursively scan file-system directories and print their contents as ASCII-art trees. In the second article, we refactored the program to make its logic more reusable by separating the directory-scanning logic from the tree-printing logic. In this article, we will address a shortcoming of the refactored version: It must scan directory hierarchies completely before printing their trees, i.e., it must scan and then print, when doing both simultaneously is both more efficient and more user friendly. Recall from the previous article that our directory-printing program is factored into three pieces of logic:
One of the pleasant new features in GHC 6.10 is the long-awaited addition of view patterns. This feature is usually advertised as making it possible to pattern match against the values of an abstract type. An essential aspect of modular software design is that we don't want to expose the implementation of complex code. Someone will surely come along and start making decisions based on bits of our code that they can see, thus limiting our future room to manoeuvre. This is all amply explained on the view pattern wiki page and in the GHC User's Guide. how do they diff from f# active pats
This paper presents an automatic fusion system, stream fusion, based on equational transformations, that fuses a wider range of functions than existing short-cut fusion systems. In particular, stream fusion is able to fuse zips, left folds and functions over nested lists, including list comprehensions. A distinguishing feature of the stream fusion framework is its simplicity: by transforming list functions to expose their structure, intermediate values are eliminated by general purpose compiler optimisations. We have reimplemented the entire Haskell standard list library on top of our framework, providing stream fusion for Haskell lists. By allowing a wider range of functions to fuse, we see an increase in the number of occurrences of fusion in typical Haskell programs. We present benchmarks documenting time and space improvements.
The Haskell String type is notoriously inefficient. We introduce a new data type, ByteString, based on lazy lists of byte arrays, combining the speed benefits of strict arrays with lazy evaluation. Equational transformations based on term rewriting are used to deforest intermediate ByteStrings automatically. We describe novel fusion combinators with improved expressivity and performance over previous functional array fusion strategies. A library for ByteStrings is implemented, providing a purely functional interface, and approaches the speed of low-level mutable arrays in C.