Network


Latest external collaboration on country level. Dive into details by clicking on the dots.

Hotspot


Dive into the research topics where Neil Ghani is active.

Publication


Featured researches published by Neil Ghani.


Theoretical Computer Science | 2005

Containers: constructing strictly positive types

Michael Gordon Abbott; Thorsten Altenkirch; Neil Ghani

We introduce the notion of a Martin-Lof category--a locally cartesian closed category with disjoint coproducts and initial algebras of container functors (the categorical analogue of W-types)--and then establish that nested strictly positive inductive and coinductive types, which we call strictly positive types, exist in any Martin-Lof category.Central to our development are the notions of containers and container functors. These provide a new conceptual analysis of data structures and polymorphic functions by exploiting dependent type theory as a convenient way to define constructions in Martin-Lof categories. We also show that morphisms between containers can be full and faithfully interpreted as polymorphic functions (i.e. natural transformations) and that, in the presence of W-types, all strictly positive types (including nested inductive and coinductive types) give rise to containers.


Journal of Functional Programming | 1995

The virtues of eta-expansion

C. Barry Jay; Neil Ghani

Interpreting η-conversion as an expansion rule in the simply-typed λ-calculus maintains the confluence of reduction in a richer type structure. This use of expansions is supported by categorical models of reduction, where β-contraction, as the local counit, and η-expansion, as the local unit, are linked by local triangle laws. The latter form reduction loops, but strong normalization (to the long βη-normal forms) can be recovered by ‘cutting’ the loops.


foundations of software science and computation structure | 2003

Categories of containers

Michael Gordon Abbott; Thorsten Altenkirch; Neil Ghani

We introduce the notion of containers as a mathematical formalisation of the idea that many important datatypes consist of templates where data is stored. We show that containers have good closure properties under a variety of constructions including the formation of initial algebras and final coalgebras. We also show that containers include strictly positive types and shapely types but that there are containers which do not correspond to either of these. Further, we derive a representation result classifying the nature of polymorphic functions between containers. We finish this paper with an application to the theory of shapely types and refer to a forthcoming paper which applies this theory to differentiable types.


international conference on functional programming | 2002

Composing monads using coproducts

Christoph Lüth; Neil Ghani

Monads are a useful abstraction of computation, as they model diverse computational effects such as stateful computations, exceptions and I/O in a uniform manner. Their potential to provide both a modular semantics and a modular programming style was soon recognised. However, in general, monads proved difficult to compose and so research focused on special mechanisms for their composition such as distributive monads and monad transformers.We present a new approach to this problem which is general in that nearly all monads compose, mathematically elegant in using the standard categorical tools underpinning monads and computationally expressive in supporting a canonical recursion operator. In a nutshell, we propose that two monads should be composed by taking their coproduct. Although abstractly this is a simple idea, the actual construction of the coproduct of two monads is non-trivial. We outline this construction, show how to implement the coproduct within Haskell and demonstrate its usage with a few examples. We also discuss its relationship with other ways of combining monads, in particular distributive laws for monads and monad transformers.


symposium on principles of programming languages | 2008

Foundations for structured programming with GADTs

Patricia Johann; Neil Ghani

GADTs are at the cutting edge of functional programming and becomemore widely used every day. Nevertheless, the semantic foundations underlying GADTs are not well understood. In this paper we solve this problem by showing that the standard theory of data types as carriers of initial algebras of functors can be extended from algebraic and nested data types to GADTs. We then use this observation to derivean initial algebra semantics for GADTs, thus ensuring that all of the accumulated knowledge about initial algebras can be brought to bear on them. Next, we use our initial algebra semantics for GADTs to derive expressive and principled tools --- analogous to the well-known and widely-used ones for algebraic and nested data types---for reasoning about, programming with, and improving the performance of programs involving, GADTs; we christen such a collection of tools for a GADT an initial algebra package. Along the way, we give a constructive demonstration that every GADT can be reduced to one which uses only the equality GADT and existential quantification. Although other such reductions exist in the literature, ours is entirely local, is independent of any particular syntactic presentation of GADTs, and can be implemented in the host language, rather than existing solely as a metatheoretical artifact. The main technical ideas underlying our approach are (i) to modify the notion of a higher-order functor so that GADTs can be seen as carriers of initial algebras of higher-order functors, and (ii) to use left Kan extensions to trade arbitrary GADTs for simpler-but-equivalent ones for which initial algebra semantics can bederived.


Logical Methods in Computer Science | 2009

Representations of stream processors using nested fixed points

Peter Hancock; Dirk Pattinson; Neil Ghani

We define representations of continuous functions on infinite streams of dis- crete values, both in the case of discrete-valued functions, and in the case of stream-valued functions. We define also an operation on the representations of two continuous functions between streams that yields a representation of their composite. In the case of discrete-valued functions, the representatives are well-founded (finite- path) trees of a certain kind. The underlying idea can be traced back to Brouwers justi- fication of bar-induction, or to Kreisel and Troelstras elimination of choice-sequences. In the case of stream-valued functions, the representatives are non-wellfounded trees pieced together in a coinductive fashion from well-founded trees. The definition requires an al- ternating fixpoint construction of some ubiquity.


international conference on typed lambda calculi and applications | 1995

ßn-Equality for Coproducts

Neil Ghani

Recently several researchers have investigated βη-equality for the simply typed λ-calculus with exponentials, products and unit types. In these works, η-conversion was interpreted as an expansion with syntactic restrictions imposed to prevent the expansion of introduction terms or terms which form the major premise of elimination rules. The resulting rewrite relation was shown confluent and strongly normalising to the long βη-normal forms. Thus reduction to normal form provides a decision procedure for βη-equality.


international conference on typed lambda calculi and applications | 2007

Initial algebra semantics is enough

Patricia Johann; Neil Ghani

Initial algebra semantics is a cornerstone of the theory of modern functional programming languages. For each inductive data type, it provides a fold combinator encapsulating structured recursion over data of that type, a Church encoding, a build combinator which constructs data of that type, and a fold/build rule which optimises modular programs by eliminating intermediate data of that type. It has long been thought that initial algebra semantics is not expressive enough to provide a similar foundation for programming with nested types. Specifically, the folds have been considered too weak to capture commonly occurring patterns of recursion, and no Church encodings, build combinators, or fold/build rules have been given for nested types. This paper overturns this conventional wisdom by solving all of these problems.


international conference on typed lambda calculi and applications | 1997

Eta-Expansions in Dependent Type Theory - The Calculus of Constructions

Neil Ghani

Although the use of expansionary η-rewrite has become increasingly common in recent years, one area where ν-contractions have until now remained the only possibility is in the more powerful type theories of the λ-cube. This paper rectifies this situation by applying η-expansions to the Calculus of Constructions — we discuss some of the difficulties posed by the presence of dependent types, prove that every term rewrites to a unique long βη-normal form and deduce the decidability of βη-equality, typeability and type inhabitation as corollaries.


Lecture Notes in Computer Science | 1997

Monads and Modular Term Rewriting

Christoph Lüth; Neil Ghani

Monads can be used to model term rewriting systems by generalising the well-known equivalence between universal algebra and monads on the category Set. In [Lu96], this semantics was used to give a purely categorical proof of the modularity of confluence for the disjoint union of term rewriting systems. This paper provides further support for monadic semantics of rewriting by giving a categorical proof of the most general theorem concerning the modularity of strong normalisation. In the process, we improve upon the technical aspects of earlier work.

Collaboration


Dive into the Neil Ghani's collaboration.

Top Co-Authors

Avatar

Patricia Johann

University of Strathclyde

View shared research outputs
Top Co-Authors

Avatar
Top Co-Authors

Avatar
Top Co-Authors

Avatar
Top Co-Authors

Avatar
Top Co-Authors

Avatar

Conor McBride

University of Strathclyde

View shared research outputs
Top Co-Authors

Avatar

Robert Atkey

University of Strathclyde

View shared research outputs
Top Co-Authors

Avatar
Top Co-Authors

Avatar

Clément Fumex

University of Strathclyde

View shared research outputs
Top Co-Authors

Avatar
Researchain Logo
Decentralizing Knowledge