Results 1  10
of
13
A Semantics for Shape
 Science of Computer Programming
, 1995
"... Shapely types separate data, represented by lists, from shape, or structure. This separation supports shape polymorphism, where operations are defined for arbitrary shapes, and shapely operations, for which the shape of the result is determined by that of the input, permitting static shape checking. ..."
Abstract

Cited by 60 (18 self)
 Add to MetaCart
Shapely types separate data, represented by lists, from shape, or structure. This separation supports shape polymorphism, where operations are defined for arbitrary shapes, and shapely operations, for which the shape of the result is determined by that of the input, permitting static shape checking. The shapely types are closed under the formation of fixpoints, and hence include the usual algebraic types of lists, trees, etc. They also include other standard data structures such as arrays, graphs and records. 1 Introduction The values of a shapely type are uniquely determined by their shape and their data. The shape can be thought of as a structure with holes or positions, into which data elements (stored in a list) can be inserted. The use of shape in computing is widespread, but till now it has not, apparently, been the subject of independent study. The body of the paper presents a semantics for shape, based on elementary ideas from category theory. First, let us consider some examp...
Shapely Types and Shape Polymorphism
 Programming Languages and Systems  ESOP '94: 5th European Symposium on Programming
, 1994
"... . Shapely types separate data, represented by lists, from shape, or structure. This separation supports shape polymorphism, where operations are defined for arbitrary shapes, and shapely operations, for which the shape of the result is determined by that of the input, permitting static shape checkin ..."
Abstract

Cited by 34 (6 self)
 Add to MetaCart
. Shapely types separate data, represented by lists, from shape, or structure. This separation supports shape polymorphism, where operations are defined for arbitrary shapes, and shapely operations, for which the shape of the result is determined by that of the input, permitting static shape checking. They include both arrays and the usual algebraic types (of trees, graphs, etc.), and are closed under the formation of initial algebras. 1 Introduction Consider the operation map which applies a function to each element of a list. In existing functional languages, its type is (ff!fi)!ff list!fi list where ff and fi may range over any types. This data polymorphism allows the data (ff and fi) to vary, but uses a fixed shape, list. Shape polymorphism fixes the data, but allows the shape to vary, so that, for types A and B, instances of map include (A!B)!A tree!B tree and (A!B)!A matrix!B matrix In each case map(f) applies f to the data (the leaves or entries), while leaving the shape fi...
About Charity
, 1992
"... Charity is a categorical programming language based on distributive categories (in the sense of Schanuel and Lawvere) with strong datatypes (in the sense of Hagino). Distributive categories come with a term logic which can express most standard programs; and they are fundamental to computer science ..."
Abstract

Cited by 22 (0 self)
 Add to MetaCart
Charity is a categorical programming language based on distributive categories (in the sense of Schanuel and Lawvere) with strong datatypes (in the sense of Hagino). Distributive categories come with a term logic which can express most standard programs; and they are fundamental to computer science because they permit proof by case analysis and, when strong datatypes are introduced, proof by structural induction. Charity is functional and polymorphic in style, and is strongly normalizing. As a categorical programming language it provides a unique marriage of computer science and mathematical thought. The above aspects are particularly important for the production of verified programs as the naturality of morphisms gives us "theorems for free", termination proofs are not required, and mathemathical specifications can be used. 1 Introduction Functional and logic programming languages have reduced the gap between theory and implementation by reducing the notational movement from mathema...
Distinguishing Data Structures and Functions: the Constructor Calculus and Functorial Types
 Typed Lambda Calculi and Applications: 5th International Conference TLCA 2001
, 2001
"... The expressive power of functional programming can be improved by identifying and exploiting the characteristics that distinguish data types from function types. Data types support generic functions for equality, mapping, folding, etc. that do not apply to functions. Such generic functions requi ..."
Abstract

Cited by 9 (1 self)
 Add to MetaCart
The expressive power of functional programming can be improved by identifying and exploiting the characteristics that distinguish data types from function types. Data types support generic functions for equality, mapping, folding, etc. that do not apply to functions. Such generic functions require case analysis, or patternmatching, where the branches may have incompatible types, e.g. products or sums. This is handled in the constructor calculus where specialisation of program extensions is governed by constructors for data types. Typing of generic functions employs polymorphism over functors in a functorial type system. The expressive power is greatly increased by allowing the functors to be polymorphic in the number of arguments they take, i.e. in their arities. The resulting system can define and type the fundamental examples above. Some basic properties are established, namely subject reduction, the ChurchRosser property, and the existence of a practical type inference algorithm.
Data Categories
 Computing: The Australasian Theory Symposium Proceedings
, 1996
"... Data categories and functors, and the strong natural transformations between them provide a universe in which to model parametric polymorphism. Data functors are distinguished by being decomposable into shape and data, i.e. they represent types that store data. Every strong transformation between tw ..."
Abstract

Cited by 7 (5 self)
 Add to MetaCart
Data categories and functors, and the strong natural transformations between them provide a universe in which to model parametric polymorphism. Data functors are distinguished by being decomposable into shape and data, i.e. they represent types that store data. Every strong transformation between two such is given by a uniform algorithm, and so may represent a polymorphic term. The data functors are closed under composition, finite products and sums, exponentiation by an object, final coalgebras and initial algebras. For any two such, the collection of strong natural transformations between them is representable by an object. The covariant type system supports parametric polymorphism on data types, and can be modelled in a data category. Since the category of sets is a data category, it follows that parametric polymorphism can have a settheoretic model. Keywords data categories covariance parametric polymorphism. 1 Introduction This paper introduces data functors, the data categor...
Tail Recursion Through Universal Invariants
 Theoretical Computer Science
, 1993
"... Tail recursive constructions suggest a new semantics for datatypes, which allows a direct match between specifications and tail recursive programs. The semantics focusses on loops, their fixpoints, invariants and convergence. Convergent models of the natural numbers and lists are examined in detail, ..."
Abstract

Cited by 6 (4 self)
 Add to MetaCart
Tail recursive constructions suggest a new semantics for datatypes, which allows a direct match between specifications and tail recursive programs. The semantics focusses on loops, their fixpoints, invariants and convergence. Convergent models of the natural numbers and lists are examined in detail, and, under very mild conditions, are shown to be equivalent to the corresponding initial algebra models. 1 Introduction Tail recursion is a central feature of program construction because of its efficiency, but is usually assigned a secondary place in semantics, which is dominated by primitive recursion as expressed through initial algebras. The success of this approach is testimony to the ease with which we can use initial algebras to specify functions, and their theoretical power. The difficulty is that whenever such a specification is to be translated into code there remains the need to optimise it, often by conversion into tail recursive form. Conversely, it is not at all easy to provi...
Monads, Shapely Functors and Traversals
, 1999
"... This paper demonstrates the potential for combining the polytypic and monadic programming styles, by introducing a new kind of combinator, called a traversal. The natural setting for dening traversals is the class of shapely data types. This result reinforces the view that shapely data types form a ..."
Abstract

Cited by 4 (0 self)
 Add to MetaCart
This paper demonstrates the potential for combining the polytypic and monadic programming styles, by introducing a new kind of combinator, called a traversal. The natural setting for dening traversals is the class of shapely data types. This result reinforces the view that shapely data types form a natural domain for polytypism: they include most of the data types of interest, while to exceed them would sacrice a very smooth interaction between polytypic and monadic programming. Keywords: functional/monadic/polytypic programming, shape theory. 1 Introduction Monadic programming has proved itself extremely useful as a means of encapsulating state and other computational eects in a functional programming setting (see e.g. [12,14]). Recently, interactions between monads and data structures have been studied as a further way for structuring programs. Initially focusing on lists, the studies have been extended to the class of regular datatypes (see e.g. [4,11,1]), with the aim to embo...
Matrices, Monads and the Fast Fourier Transform
 Proceedings of the
, 1993
"... This paper presents a formal semantics for vectors and matrices, suitable for static typechecking. This is not available in apl, which produces runtime type errors, or in the usual functional languages, where matrices are typically implemented by lists of lists. Here, a matrix is a vector of vecto ..."
Abstract

Cited by 2 (1 self)
 Add to MetaCart
This paper presents a formal semantics for vectors and matrices, suitable for static typechecking. This is not available in apl, which produces runtime type errors, or in the usual functional languages, where matrices are typically implemented by lists of lists. Here, a matrix is a vector of vectors. Vectors are distinguished from lists by requiring that vector computations determine the length of the result from that of the argument, without reference to values. This leads to a twolevel semantics, with values above and shapes below. Each operation must then specify its action on shapes as well as its action on values. Vectors and matrices inherit much of their structure from lists. In particular, the monadic structure given by singleton lists and the flattening of lists of lists extends in this way. Some new constructions, such as transposition of matrices, have no list counterpart. The power of this calculus for vector and matrix algebra is sufficient to represent the discrete Fou...
Sketches: Outline with References
 Dept. of Computer Science, Katholieke Universiteit Leuven
, 1994
"... This document is an outline of the theory of sketches with pointers to the literature. An extensive bibliography is given. Some coverage is given to related areas such as algebraic theories, categorial model theory and categorial logic as well. An appendix beginning on page 11 provides definitions o ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
This document is an outline of the theory of sketches with pointers to the literature. An extensive bibliography is given. Some coverage is given to related areas such as algebraic theories, categorial model theory and categorial logic as well. An appendix beginning on page 11 provides definitions of some of the less standard terms used in the paper, but the reader is expected to be familiar with the basic ideas of category theory. A rough machine generated index begins on page 21. I would have liked to explain the main ideas of all the papers referred to herein, but I am not familiar enough with some of them to do that. It seemed more useful to be inclusive, even if many papers were mentioned without comment. One consequence of this is that the discussions in this document often go into more detail about the papers published in North America than about those published elsewhere. The DVI file for this article is available by anonymous FTP from ftp.cwru.edu in the directory
Finite Objects in a Locos
 Mathematical Structures in Computer Science
, 1994
"... Listable objects in a locos are those which have a (finite) list of elements. Their full subcategory forms a 2valued topos satisfying the axiom of choice. Listable objects are isomorphic to finite cardinals. 1 Introduction This work starts from the premise that lists are one of the fundamental con ..."
Abstract

Cited by 1 (1 self)
 Add to MetaCart
Listable objects in a locos are those which have a (finite) list of elements. Their full subcategory forms a 2valued topos satisfying the axiom of choice. Listable objects are isomorphic to finite cardinals. 1 Introduction This work starts from the premise that lists are one of the fundamental construction in computing. Their centrality is due to their use in constructing inputs and outputs, and the influence this has on our notions of what constutes a useful datatype. These views are supported by [5] where the usual inductive types are inferred from the presence of lists, and the primacy of lists in the theory of languages and automata [7]. This shift from sets (and their generalisation in toposes) and functions (cartesian closed categories) to lists (as presented in locoses) requires us to reexamine some of the basic concepts. This paper is concerned with that of finiteness, and was motivated by the desire to recover the main results of automata theory (which will appear in due co...