## Type Fusion

Citations: | 2 - 0 self |

### BibTeX

@MISC{Hinze_typefusion,

author = {Ralf Hinze},

title = {Type Fusion},

year = {}

}

### OpenURL

### Abstract

Fusion is an indispensable tool in the arsenal of techniques for program derivation. Less well-known, but equally valuable is type fusion, which states conditions for fusing an application of a functor with an initial algebra to form another initial algebra. We provide a novel proof of type fusion based on adjoint folds and discuss several applications: type firstification, type specialisation and tabulation. 1.

### Citations

696 |
The art of computer programming., volume 3: Sorting and searching
- Knuth
- 1974
(Show Context)
Citation Context ...urrying is the only adjunction considered. The author is not aware of any other published applications of type fusion. Finite versions of memo tables are known as tries or digital search trees. Knuth =-=[13]-=- attributes the idea of a trie to Thue [17]. Connelly and Morris [5] formalised the concept of a trie in a categorical setting: they showed that a trie is a functor and that the corresponding look-up ... |

152 | Categories for the Working Mathematician, Graduate Texts - MacLane - 1971 |

119 |
Über die gegenseitige Lage gleicher Teile gewisser Zeichenreihen, Norske vid
- Thue
- 1912
(Show Context)
Citation Context ...The author is not aware of any other published applications of type fusion. Finite versions of memo tables are known as tries or digital search trees. Knuth [13] attributes the idea of a trie to Thue =-=[17]-=-. Connelly and Morris [5] formalised the concept of a trie in a categorical setting: they showed that a trie is a functor and that the corresponding look-up function is a natural transformation. The a... |

80 |
Categories for Types
- Crole
- 1993
(Show Context)
Citation Context ... | 1 | + | × | µ The kinds of the constants are fixed as follows. 0, 1 : ∗ +, × : ∗ ⇾ (∗ ⇾ ∗) µ : (∗ ⇾ ∗) ⇾ ∗ The interpretation of this calculus in a cartesian closed category is completely standard =-=[6]-=-. We provide, in fact, two interpretations, one for the types of keys and one for the types of memo tables, and then relate the two, showing that the latter interpretation is a tabulation of the forme... |

54 |
98 Language and Libraries
- Haskell
- 2003
(Show Context)
Citation Context ...he fusion law for fusing an arrow with a fold to form another fold. h · ⦇f ⦈ = ⦇g⦈ ⇐= h · f = g · F h (3) Initial algebras provide semantics for recursive datatypes as found, for instance, in Haskell =-=[16]-=-. The following example illustrates the approach. In fact, Haskell is expressive enough to replay the development within the language. Example 2.1 Consider the datatype Stack, which models stacks of n... |

52 |
A fixpoint theorem for complete categories
- Lambek
- 1968
(Show Context)
Citation Context ...ts, no coproducts, hence the terms memo table and tabulation. 7. Related work The initial algebra approach to the semantics of datatypes originates in the work of Lambek on fixed points in categories =-=[14]-=-. Lambek suggests that lattice theory provides a fruitful source of inspiration for results in category theory. This viewpoint was taken up by Backhouse et al. [3], who generalise a number of lattice-... |

34 | Generalised folds for nested datatypes - Bird, Paterson - 1999 |

31 | Generalizing generalized tries
- Hinze
(Show Context)
Citation Context ...y showed that a trie is a functor and that the corresponding look-up function is a natural transformation. The author gave a polytypic definition of tries and memo tables using type-indexed datatypes =-=[9, 10]-=-, which Section 6 puts on a sound theoretical footing. The insight that a function from an inductive type is tabulated by a coinductive type is due to Altenkirch [1]. The paper also mentions fusion as... |

13 | An extensional characterization of lambda-lifting and lambda-dropping
- Danvy
- 1998
(Show Context)
Citation Context ...ist Nat ∼ = Stack. (15) The isomorphism is non-trivial, as both types are recursively defined. The transformation of List Nat into Stack can be seen as an instance of firstification [12] or λdropping =-=[7]-=- on the type level: a fixed point of a higherorder functor is reduced to a fixed-point of a first-order functor. Perhaps surprisingly, we can fit the isomorphism into the framework of type fusion. To ... |

13 | Memo functions, polytypically
- Hinze
- 2000
(Show Context)
Citation Context ...y showed that a trie is a functor and that the corresponding look-up function is a natural transformation. The author gave a polytypic definition of tries and memo tables using type-indexed datatypes =-=[9, 10]-=-, which Section 6 puts on a sound theoretical footing. The insight that a function from an inductive type is tabulated by a coinductive type is due to Altenkirch [1]. The paper also mentions fusion as... |

12 | Representations of first order function types as terminal coalgebras
- Altenkirch
- 2001
(Show Context)
Citation Context ...s using type-indexed datatypes [9, 10], which Section 6 puts on a sound theoretical footing. The insight that a function from an inductive type is tabulated by a coinductive type is due to Altenkirch =-=[1]-=-. The paper also mentions fusion as a way of proving tabulation correct, but doesn’t spell out the details. (Altenkirch attributes the idea to Backhouse.) Adjoint folds and unfolds were introduced in ... |

11 |
A generalization of the trie data structure
- Connelly, Morris
- 1995
(Show Context)
Citation Context ... any other published applications of type fusion. Finite versions of memo tables are known as tries or digital search trees. Knuth [13] attributes the idea of a trie to Thue [17]. Connelly and Morris =-=[5]-=- formalised the concept of a trie in a categorical setting: they showed that a trie is a functor and that the corresponding look-up function is a natural transformation. The author gave a polytypic de... |

9 |
der Woude, J.: Category theory as coherently constructive lattice theory
- Backhouse, Bijsterveld, et al.
- 1994
(Show Context)
Citation Context ...ersely, an order-theoretic proof can be seen as a typing derivation — we only have to provide witnesses for the types. Category theory has been characterised as coherently constructive lattice theory =-=[2]-=-, and to generalise an order-theoretic result we additionally have to establish the required coherence conditions. Continuing the example, to prove F (µF) ∼ = µF we must show that in · ⦇F in⦈ = id, in... |

8 |
Type specialisation for the λ-calculus; or, a new paradigm for partial evaluation based on type inference
- Hughes
(Show Context)
Citation Context ..., we expect that List Nat ∼ = Stack. (15) The isomorphism is non-trivial, as both types are recursively defined. The transformation of List Nat into Stack can be seen as an instance of firstification =-=[12]-=- or λdropping [7] on the type level: a fixed point of a higherorder functor is reduced to a fixed-point of a first-order functor. Perhaps surprisingly, we can fit the isomorphism into the framework of... |

5 | Parametric datatype-genericity
- Gibbons, Paterson
- 2009
(Show Context)
Citation Context ..., then ⦇f ⦈ · µβ = ⦇f · β⦈. Preservation of composition is an immediate consequence of this law (set f := in · α). For reasons of space, we only sketch the syntax and semantics of the Λ-calculus, see =-=[8]-=- for a more leisurely exposition. Its raw syntax is given below. κ ::= ∗ | κ ⇾ κ T ::= C | X | T T | Λ X . T C ::= 0 | 1 | + | × | µ The kinds of the constants are fixed as follows. 0, 1 : ∗ +, × : ∗ ... |

4 |
der Woude. Categorical fixed point calculus
- Backhouse, Bijsterveld, et al.
- 1995
(Show Context)
Citation Context ...urther prerequisite: L has to be a left adjoint. We show that this condition arises naturally as a consequence of defining the arrows witnessing the isomorphism. Type fusion has been described before =-=[3]-=-, but we believe that it deserves to be better known. We provide a novel proof of type fusion based on adjoint folds [11], which gives a simple formula for the aforementioned isomorphisms. We illustra... |

4 | Coding Recursion á la Mendler (extended abstract
- Uustalu, Vene
- 1999
(Show Context)
Citation Context ...on 2.2.1) and then generalise to arbitrary adjunctions (Section 2.2.2). 2.2.1 Mendler-style fixed-point equations For the identity adjunction, adjoint folds specialise to socalled Mendler-style folds =-=[18]-=-. The proof of uniqueness makes essential use of the fact that the type of the base function ∀X ∈ D . C(X , B) → C(F X , B) is isomorphic to the type C(F B, B), the arrow part of an F-algebra. C(F B, ... |

2 |
Adjoint Folds and Unfolds
- Hinze
(Show Context)
Citation Context ...ng the arrows witnessing the isomorphism. Type fusion has been described before [3], but we believe that it deserves to be better known. We provide a novel proof of type fusion based on adjoint folds =-=[11]-=-, which gives a simple formula for the aforementioned isomorphisms. We illustrate the versatility of type fusion through a variety of applications relevant to programming: • type firstification: a fix... |