Report on the programming language Haskell (original) (raw)
1992, ACM SIGPLAN Notices
This report is the official specification of the Haskell language and should be suitable for writing programs and building implementations. It is not a tutorial on programming in Haskell such as the 'Gentle Introduction' [5], so some familiarity with functional languages is assumed. Version 1.4 of the report was unveiled in 1997. It makes some minor corrections to version 1.3 and adds a few new features as described below. Version 1.4 is described in two separate documents: the Haskell Language Report (this document) and the Haskell Library Report[8]. Highlights of Haskell 1.3 Libraries For the first time, we distinguish between Prelude and Library entities. Entities defined by the Prelude, a module named Prelude, are in scope unless explicitly hidden. Entities defined in library modules are in scope only if that module is explicitly imported. The library modules specified by Haskell are described in the Haskell Library Report. Monadic I/O Monadic I/O has proven to be more general and in many respects simpler than the streambased I/O system used in Haskell 1.2. Here are the highlights of the I/O definition. • We define a monadic programming model for Haskell. Expressions of type IO a denote computations that may engage in I/O before returning an answer of type a. • The IO monad admits computations that fail and recovers from such failures. • We define a new type of handles, to mediate I/O operations on files and other I/O devices. Handles are part of the I/O library. • We define input polling and input of characters. In contrast, Haskell 1.2 represented character input as a single String (that is, a lazy list of characters), containing all the characters available for input throughout the program execution. • Monadic I/O provides an extensible framework capable of incorporating advanced operating system and GUI interfaces in libraries. • Monadic programming has been made more readable through the introduction of a special do syntax. PREFACE v Constructor Classes Constructor classes are a natural generalization of the original Haskell type system, supporting polymorphism over type constructors. For example, the monadic operators used by the I/O system have been generalized using constructor classes to arbitrary monads just as (+) has been generalized to arbitrary numeric types using type classes. New Datatype Features A number of enhancements have been made to Haskell type declarations. These include: • Strictness annotations allow structures to be represented in a more efficient manner. • The components of a constructor may be labeled using field names. Selection, construction, and update operations that reference fields by name rather than position are now available. Highlights of Haskell 1.4 Version 1.4 of the report makes the following changes in the language: vi PREFACE • The character set has been changed to Unicode. • List comprehensions have been generalized to arbitrary monads. • Import and export of class methods and constructors is no longer restricted to 'all or nothing' as previously. Any subset of class methods or data constructors may be selected for import or export. Also, constructors and class methods can now be named directly on import and export lists instead of as components of a type or class. • Qualified names may now be used as field names in patterns and updates. • Ord is no longer a superclass of Enum. Some of the default methods for Enum have changed. • Context restrictions on newtype declarations have been relaxed. • The Prelude is now more explicit about some instances for Read and Show.
Related papers
Report on the programming language Haskell, a non-strict, purely functional …
Sigplan …, 1992
Wise, and Jonathan Young-for the major contributions they have made to previous versions of this report. We also thank those who have participated in the lively discussions about Haskell on the FP and Haskell mailing lists. x PREFACE 1. At the topmost level a Haskell program is a set of modules, described in Section 5. Modules provide a way to control namespaces and to re-use software in large programs. 2. The top level of a module consists of a collection of declarations, of which there are several kinds, all described in Section 4. Declarations define things such as ordinary values, datatypes, type classes, and fixity information. 3. At the next lower level are expressions, described in Section 3. An expression denotes a value and has a static type; expressions are at the heart of Haskell programming "in the small." 4. At the bottom level is Haskell's lexical structure, defined in Section 2. The lexical structure captures the concrete representation of Haskell programs in text files. This report proceeds bottom-up with respect to Haskell's syntactic structure. The sections not mentioned above are Section 6, which describes the standard built-in datatypes and classes in Haskell, and Section 7, which discusses the I/O facility in Haskell (i.e. how Haskell programs communicate with the outside world). Also, there are several appendices describing the Prelude, the concrete syntax, literate programming, the specification of derived instances, and pragmas supported by most Haskell compilers. Examples of Haskell program fragments in running text are given in typewriter font:
An implementation of the Haskell language
1990
Abstract This report describes the design and implementation of HASKELL system. The areas implemented are the lexical analysis, parsing, intepretation of the lambda tree, and machine code generation. Because of the size, complexity and novelty of the language many of these areas present particular difficulty. A considarable amount of meta-programming was used in order to tackle the size of the project.
Haskell's overlooked object system
Computing Research Repository, 2005
Haskell provides type-class-bounded and parametric polymorphism as opposed to subtype polymorphism,of object-oriented languages such as Java and OCaml. It is a contentious question whether Haskell 98 without extensions, or with common extensions, or with new extensions can fully support conventional object-oriented programming,with encapsulation, mutable state, inheritance, overriding, statically checked implicit and explicit subtyping, and so on. In a first
Generic Haskell: Practice and Theory
2003
Generic Haskell is an extension of Haskell that supports the construction of generic programs. These lecture notes describe the basic constructs of Generic Haskell and highlight the underlying theory.
1992
The functional programming language Haskell is examined from the point of view of proving programs correct. Particular features explored include the data type definition facilities, classes, the behaviour of patterns and guards and the monad approach to IO in the Glasgow Haskell compiler.
The goal of the Yet Another Haskell Tutorial is to provide a complete intoduction to the Haskell programming language. It assumes no knowledge of the Haskell language or familiarity with functional programming in general. However, general familiarity with programming concepts (such as algorithms) will be helpful. This is not intended to be an introduction to programming in general; rather, to programming in Haskell. Sufficient familiarity with your operating system and a text editor is also necessary (this report only discusses installation on configuration on Windows and *Nix system; other operating systems may be supported -consult the documentation of your chosen compiler for more information on installing on other platforms).
Semantics of pH: A parallel dialect of Haskell
1995
The semantics of kernel pH are de ned in the form of a parallel, normalizing interpreter. A description of I-structure and M-structure operators is also given within the same framework. Semantics of barriers in pH are presented by translation into the kernel language without barriers. The framework presented is also suitable for multithreaded compilation of pH.
Loading Preview
Sorry, preview is currently unavailable. You can download the paper by clicking the button above.
Related papers
Proceedings of the 8th ACM SIGPLAN workshop on Types in language design and implementation - TLDI '12, 2012