This article defines a set of type inference rules for resolving overloading introduced by type classes, as used in the functional programming language Haskell. Programs including type classes are transformed into ones which may be typed by standard Hindley-Milner inference rules. In contrast to other work on type classes, the rules presented here relate directly to Haskell programs. An innovative aspect of this work is the use of second-order lambda calculus to record type information in the transformed program.
The process of writing large parallel programs is complicated by
the
need to specify both the parallel behaviour of the program and the algorithm
that is to be used to compute its
result. This paper introduces evaluation strategies: lazy higher-order
functions that control the
parallel evaluation of non-strict functional languages. Using evaluation
strategies, it is possible
to achieve a clean separation between algorithmic and behavioural code.
The result is enhanced
clarity and shorter parallel programs. Evaluation strategies are a very
general concept: this
paper shows how they can be used to model a wide range of commonly used
programming
paradigms, including divide-and-conquer parallelism, pipeline
parallelism, producer/consumer
parallelism, and data-oriented parallelism. Because they are based on unrestricted
higher-order
functions, they can also capture irregular parallel structures. Evaluation
strategies are not
just of theoretical interest: they have evolved out of our experience in
parallelising several
large-scale parallel applications, where they have proved invaluable in
helping to manage the
complexities of parallel behaviour. Some of these applications are described
in detail here.
The largest application we have studied to date, Lolita, is a 40,000 line
natural language
engineering system. Initial results show that for these programs we can
achieve acceptable
parallel performance, for relatively little programming effort.
This paper defines a set of type inference rules for resolving overloading introduced by type classes. Programs including type classes are transformed into ones which may be typed by the HindleyMilner inference rules. In contrast to other work on type classes, the rules presented here relate directly to user programs. An innovative aspect of this work is the use of second-order lambda calculus to record type information in the program.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.