| Robin Cockett and Tom Fukushima. About Charity. Technical Report 92/480/18, University of Calgary, June 1992. |
....3 after we recall the basic concepts of distributive categories in Section 2. 4 2 Distributive Categories Distributive categories are the appropriate formal setting for studying abstract data type specifications and control flow aspects of programs. See [LS91, Wal92a] for an introduction and [Coc91, CF92, CLW93] for more details. Here by a distributive category we mean one in the sense of Lawvere and Schanuel 1 : a category with with finite sums (coproducts) and finite limits, such that in the diagram Y g y X fflffl f Z oo z h A i A A B B oo i B (5) where the bottom row is a ....
Robin Cockett and Tom Fukushima. About Charity. Technical Report 92/480/18, University of Calgary, June 1992.
....necessary to assume that the underlying category C is cartesian closed. Instead, it is sufficient to assume that the initial algebra is strongly initial [10] or initial with parameters) The theory of strong datatypes has been used as the basis for the design of the programming language charity [9]. 8 The concept of strong initiality is based on that of strong functor. A functor F : C C is said to be strong if it is equipped with a natural transformation F A;X : FA Theta X F (A Theta X) called a strength, such that the following equations hold: F 1 ffi F A;X = 1 (7) F ff ....
....x) h 2 (f(t; x) a; f(u; x) x) 2 The pfold operator can also be used to give a definition of a strength for any type functor D corresponding to a strongly initial parameterised datatype induced by a bifunctor F that satisfies to be bistrong. A bifunctor F : C Theta C C is called bistrong [9] if the functors F (A; Gamma) and F ( Gamma; B) are strong. Then, D A;X : D A Theta X D (A Theta X) is given by D A;X = pfold FA (OE A;X ) where OE A;X = in FA ThetaX ffi F ( Gamma;D (A ThetaX) A;X A proof that D A;X is indeed a strength can be found in [29] Now, let us see ....
R. Cockett and T. Fukushima. About Charity. Technical Report 92/480/18, University of Calgary, June 1992.
....some types X and Y then a dummy constructor must be introduced to distinguish them. The other method is to generate the mapping algorithm automatically, from the structure of the functor. This results in a small loss of exibility, but saves the user from supplying repetitious algorithms. Charity [CF92] encodes this directly. Jeuring [Jeu95] uses a pre processor to determine the appropriate Haskell code for mapping and other polytypic operations. Intensional polymorphism [HM95] is a general technique for describing type dependent operations in an extension of ML, designed to obtain more ecient ....
J.R.B. Cockett and T. Fukushima. About charity. Technical Report 92/480/18, University of Calgary, 1992.
....generally, and that it will have an influence on future languages for programming and reasoning. When these languages are equipped with definition mechanisms both for algebraic and for coalgebraic data types (as suggested in [Hag87] and realised in the experimental programming language charity [CF92, CS95] then one can use (and reason about) coalgebraic data structures like trees with infinitely many branches, and possibly infinite depth with the same ease as algebraic structures like finitely branching trees. What is useful to have is a language which does not only provide users with ....
....refinement lemma then states that the existence of a refinement implies trace inclusion. This is an important proof method because local reasoning is sufficient for a refinement proof. The refinement lemma is a (nontrivial) illustration for the use of filtering and mapping of sequences. charity [CF92, CS95] is a programming language which is functional in style and is solely based on induction for (initial) datatypes and coinduction for (final) codatatypes. A codatatype for sequences supports definitions in the style of coreduce. The second challenge we briefly discuss in this section ....
[Article contains additional citation context not shown here]
J.R.B. Cockett and T. Fukushima. About charity. Technical Report 92/480/18, Dep. Comp. Sci., Univ. Calgary, 1992.
....some types X and Y then a dummy constructor must be introduced to distinguish them. The other method is to generate the mapping algorithm automatically, from the structure of the functor. This results in a small loss of flexibility, but saves the user from supplying repetitious algorithms. Charity [CF92] encodes this directly. Jeuring [Jeu95] uses a pre processor to determine the appropriate Haskell code for mapping and other polytypic operations. Intensional polymorphism [HM95] is a general technique for describing type dependent operations in an extension of ML, designed to obtain more ....
J.R.B. Cockett and T. Fukushima. About charity. Technical Report 92/480/18, University of Calgary, 1992.
....recursion, there has long been a tension between the structure provided by types based on well founded induction and the freedom permitted by types based on general recursion. Very few languages outside of purely theoretical studies have chosen a strictly inductive system (one exception is charity [CF92]) partly because the logical price to be paid for ensuring that all recursion is well founded is the necessity that all computations terminate, hence the language cannot be Turing equivalent. On the other hand, the prevalence of inductively defined structures in computer science makes it natural ....
R. Cockett and T. Fukushima. About CHARITY. Technical Report 92/480/18, University of Calgary, June 1992.
.... ADL is a new language based on work in the functional programming and categorical programming paradigms [31, 32, 37] Specifically, it builds on the calculational style of programming called Squigol [11, 12, 39] and the categorical programming models of Hagino [27] and of Cockett s Charity group [18, 19]. ADL extends both of its predecessors, bringing the exponential types of functional programming to the categorical languages and the rich variety of algebras in the categorical framework to the functional community. The key properties of ADL that enable many of the transformations and analyses ....
J. R. B. Cockett. About Charity. Technical Report 92/480/18, University of Calgary, June 1992.
....recursion, there has long been a tension between the structure provided by types based on well founded induction and the freedom permitted by types based on general recursion. Very few languages outside of purely theoretical studies have chosen a strictly inductive system (one exception is charity [CF92]) partly because the logical price to be paid for ensuring that all recursion is well founded is the necessity that all computations terminate, hence the language cannot be Turingequivalent. On the other hand, the prevalence of inductively defined structures in computer science makes it natural ....
R. Cockett and T. Fukushima. About CHARITY. Technical Report 92/480/18, University of Calgary, June 1992.
....the latter vary from visitor to visitor [13] The analogy with mapping becomes clearer, as the visitor corresponds to the function being mapped, whose application is controlled by the class. The analogous functional approach is captured in PolyP [4] which improves on the earlier work in Charity [2]. The compiler determines the type, and uses this information to specialise the map algorithm automatically. The functional approach is a little smoother here, because the limited set of combinators used all have standard definitions, so that there is no need to supply explicit accept methods. A ....
J.R.B. Cockett and T. Fukushima. About Charity. Technical Report 92/480/18, University of Calgary, 1992.
....map means that its type can be checked, but the algorithm used to implement it must depend on the type, so that the polymorphism is ad hoc, rather than parametric. If map is supported through type classes, as in Haskell [HPJW92] and Gofer [Jon94] the algorithm is supplied by the user. In Charity [CF92] the algorithm is inferred automatically from the type. A parametrically polymorphic version of map (and of fold) has been implemented in P2 [Jay95] for the polynomial types (built using products and sums) and their fixpoints, such as lists and trees. A language for all inductive types, such as ....
J.R.B. Cockett and T. Fukushima. About charity. Technical Report 92/480/18, University of Calgary, 1992.
.... (particularly in functional programming) As a consequence of the properties of initiality finality in the category of algebras coalgebras it is possible to derive general recursive functionals for datatypes, such as catamorphism [MFP91] primitive recursion [Geu92] or even case analysis [CF92] (and their duals) Programming with a fixed set of recursive functionals derived from type definitions leads to a structural programming discipline which can be exploited to facilitate program calculation. By initiality or finality one can state calculational laws for recursive functionals to be ....
....supported by a DAAD scholarship. y Fachbereich Informatik, Technische Hochschule Darmstadt, Magdalenenstr. 11c, 64289 Darmstadt, Germany; pardo informatik.th darmstadt.de The theory of strong datatypes has been used as the basis for the design of the (categorical) programming language charity [CF92]. However, a calculational theory for functionals on strong datatypes has still remained undeveloped. In this light, our main contribution consists of the identification of the relevant calculational properties for fold. Following a dual reasoning it is easy to achieve the derivation of similar ....
[Article contains additional citation context not shown here]
R. Cockett and T. Fukushima. About Charity. Technical Report 92/480/18, University of Calgary, June 1992.
....over lists called foldr whose type is (A B B) B [A] B : so that lsum = foldr 0. Similar combinators could be introduced for other inductive types, each with their own evaluation mechanism, but their underlying unity would not be revealed this way. The language Charity (Cockett and Fukushima, [2]) takes a different approach to the problem. There fold applies to arbitrary inductive types, but is treated as a term constructor, rather than as a term in its own right. That is, an algorithm for fold g is inferred from that of g. Thus, the use of folding has been simplified by automating its ....
J.R.B. Cockett and T. Fukushima. About charity. Technical Report 92/480/18, University of Calgary, 1992.
....whole list, where listmap is defined by listmap f nil = nil listmap f cons(h; t) cons(f h; listmap f t) The mapping of f across a binary tree requires a different pattern matching algorithm, with actions on leaves and nodes. The first attempt to regularise this situation was made in Charity [2]. Each data type constructor F , used to construct, say, a new tree type, induced the compiler to construct code for a suite of combinators, such as map F for the corresponding data structures, sparing the programmer from writing the patternmatching definitions themselves, at the cost of writing ....
J.R.B. Cockett and T. Fukushima. About Charity. Technical Report 92/480/18, University of Calgary, 1992.
....like map definitions (or functoriality) and (co)inductive proof principles. In practice the available (theoretical) possibilities are not yet fully exploited by such tools. The concepts of initial algebra and terminal coalgebra form the basis for the experimental programming language charity [5, 4]. It exploits initiality and terminality as the explicit definition schemas and demonstrates the remarkable power of these notions. charity only involves a term language for writing programs, but no logic to reason about these programs. It is the aim of this paper to contribute to the logical ....
J.R.B. Cockett and T. Fukushima. About charity. Technical Report 92/480/18, Dep. Comp. Sci., Univ. Calgary, 1992.
....Appeared in Proc. 6th International Conference on Category Theory and Computer Science. Springer LNCS953, 1995 Abstract. We give two categorical programming languages with variable arrows and associated abstraction reduction mechanisms, which extend the possibility of categorical programming [Hag87, CF92] in practice. These languages are complementary to each other one of them provides a first order programming style whereas the other does higherorder and are children of the simply typed lambda calculus in the sense that we can decompose typed lambda calculus into them and, conversely, the ....
....can be decomposed into linear calculus and linear i calculus, in the similar manner as the non linear case. However, it seems not so obvious to relate linear logic and our decomposition; how can the linearity of these calculi be captured in terms of polynomial categories A final remark: Charity [CF92] has been developed on the foundation of distributive category and categorical data types with tensorial strength [CS91] and shares many things with our contextual calculus. Indeed, a contextually complete cartesian category with coproducts is distributive (since left adjoints preserve colimits) ....
J. R. B. Cockett and T. Fukushima, About Charity. Technical Report 92/480/18, University of Calgary, 1992.
....of coalgebraic data types more generally, and that it will have an influence on future languages for programming and reasoning. When these languages are equipped with definition mechanisms both for algebraic and for coalgebraic data types (like in the experimental programming language charity [CF92, CS95] then one can use (and reason about) coalgebraic data structures like trees with infinitely many branches, and possibly infinite depth with the same ease as algebraic structures like finitely branching trees. What is useful to have is a language which does not only provide users with ....
....refinement lemma then states that the existence of a refinement implies trace inclusion. This is an important proof method because local reasoning is sufficient for a refinement proof. The refinement lemma is a (nontrivial) illustration for the use of filtering and mapping of sequences. charity [CF92, CS95] is a programming language which is functional in style and is solely based on induction for (initial) datatypes and coinduction for (final) codatatypes. A codatatype for sequences supports definitions in the style of coreduce. The second challenge we briefly discuss in this section ....
[Article contains additional citation context not shown here]
J.R.B. Cockett and T. Fukushima. About charity. Technical Report 92/480/18, Dep. Comp. Sci., Univ. Calgary, 1992.
....say Gofer [Jon95] requires that the user supply the mapping algorithm, which is then stored in a dictionary. The polytypic approach of PolyP introduces a class of regular functors corresponding to inductive types, for which the mapping algorithm can be inferred, rather like the language Charity [CF92] but with type inference. The functors are constructed from types by the functorOf operation. Shape polymorphic programming [JC94, Jay95b] also supports functor quantification to obtain the same benefits, but arrived at from a different perspective. If F is a unary functor which is shapely over ....
J.R.B. Cockett and T. Fukushima. About charity. Technical Report 92/480/18, University of Calgary, 1992.
.... dual result for coalgebras is investigated in [GS98, Ro s98] Coalgebras and data type theory Early work on using coalgebras in data type theory to capture in nite data structures occurs in [AM82, Hag87, Hag89] The experimental programming language Charity only contains algebras and coalgebras [CF92] Programs can be constructed via various laws for initial algebras and nal coalgebras, as studied e.g. in [MFP91, Par98] As an example, the theory of the data type of both nite and in nite sequences is developed on a coalgebraic basis in [HJ99a] Sometimes, initial algebra and nal coalgebra ....
J.R.B. Cockett and T. Fukushima. About Charity. Technical Report 92/480/18, Dep. Comp. Sci., Univ. Calgary, 1992.
Online articles have much greater impact More about CiteSeer.IST Add search form to your site Submit documents Feedback
CiteSeer.IST - Copyright Penn State and NEC