Academia.edu no longer supports Internet Explorer.
To browse Academia.edu and the wider internet faster and more securely, please take a few seconds to upgrade your browser.
2012
…
181 pages
1 file
In Haskell, there is a clear distinction between values, types, and kinds. Values are built with constructors, such as True, which we colour in blue; we do not colour numerals, characters, or strings: Just 3, (Right 'p' Left "abc"). Datatypes, type synonyms, type variables, indexed families, and type classes are coloured in orange: Bool, Show α ⇒ Show [ α ], type family PF α. Kinds and kind variables are coloured in green: , → , Constraint. For simplicity we do not colour the arrow operator, as it can appear at different levels. Agda code The distinction between values and types is less clear in Agda. Our convention is to use blue for constructors (e.g. refl), orange for identifiers of type Set (e.g. _≡_), and green for identifiers of type Set 1 or (for simplicity) higher (e.g. Set). 2.2.3 Isomorphisms We have mentioned that some types are equivalent to others without formally defining this equivalence. When we say two types are equivalent we mean that they are isomorphic. The concept of isomorphism can be succinctly summarised as an Agda record type:
2003
Generic programming aims at making programming more effective by making it more general. Generic programs often embody non-traditional kinds of polymorphism. Generic Haskell is an extension of Haskell [38] that supports the construction of generic programs. Generic Haskell adds to Haskell the notion of structural polymorphism, the ability to define a function (or a type) by induction on the structure of types. Such a function is generic in the sense that it works not only for a specific type but for a whole class of types.
2007
The last decade has seen a number of approaches to datatype-generic programming: PolyP, Functorial ML,'Scrap Your Boilerplate', Generic Haskell,'Generics for the Masses', and so on. The approaches vary in sophistication and target audience: some propose full-blown programming languages, some suggest libraries, some can be seen as categorical programming methods. In these lecture notes we compare the various approaches to datatype-generic programming in Haskell.
2005
The more expressive a type system, the more type information has to be provided in a program. Having to provide a type is sometimes a pain, but lacking expressivity is often even worse. There is a continuous struggle between expressivity and (type-) verbosity. However, even very expressive type systems allow type inference for parts of a program. Generic Haskell is an extension of Haskell that supports defining generic functions. Generic Haskell assumes that the type of a generic function is explicitly specified.
We present a simple way to program typed abstract syntax in a lan - guage following a Hindley - Milner typing discipline, such as Haskell and ML, and we apply it to automate two proofs about normalization func - tions as embodied in type - directed partial evaluation for the simply typed lambda calculus: normalization functions (1) preserve types and (2) yield long beta - eta normal forms
2011
Abstract Generic Haskell is an extension of Haskell that supports datatype generic programming. The central idea of Generic Haskell is to interpret a type by a function, the so-called instance of a generic function at that type. Since types in Haskell include parametric types such as' list of', Generic Haskell represents types by terms of the simply-typed lambda calculus.
We present a simple way to program typed abstract syntax in a language following a Hindley-Milner typing discipline, such as Haskell and ML, and we apply it to automate two proofs about normalization functions as embodied in type-directed partial evaluation for the simply typed lambda calculus: normalization functions (1) preserve types and (2) yield long beta-eta normal forms.
The more expressive a type system, the more type infor- mation has to be provided in a program. Having to provide a type is sometimes a pain, but lacking expressivity is often even worse. There is a continuous struggle between expressivity and (type-)verbosity. How- ever, even very expressive type systems allow type inference for parts of a program. Generic Haskell is an extension of Haskell that supports defin- ing generic functions. Generic Haskell assumes that the type of a generic function is explicitly specified. This is often no problem, but sometimes it is rather painful to have to specify a type - in particular for generic functions with many dependencies - and sometimes the specified type can be generalized. In this paper, we identify three type inference prob- lems specific to generic functions, and present (partial) solutions to each of them.
Generic Programming, 2003
2015
Constructive t ype theories, such as that of Martin-L of, allow program construction and veri cation to take place within a single system: proofs may be read as programs and propositions as types. However, parts of proofs may be seen to be irrelevant from a computational viewpoint. We show h o w a form of abstract interpretation may be used to detect computational redundancy in a functional language based upon Martin-L of's type theory. T h us, without making any alteration to the system of type theory itself, we present a n automatic way of discovering and removing such redundancy. We also note that the strong normalisation property o f t ype theory means that proofs of correctness of the abstract interpretation are simpler, being based upon a set-theoretic rather than a domain-theoretic semantics.
2020
We present a domain interpretation of the simply typed and the untyped lambda calculus. The interpretations are constructed using the notion of category with families, with added structure. Specifically, for the simply typed case we construct a simply typed category with families of (a version of) neighborhood systems with structures supporting binary product types and function types. For the untyped case, we construct a unityped category with families of neighborhood systems, with added lambda structure. The work is completely formalized in the dependently typed programming language and proof assistant Agda. The categories with families with added structure are formalized as records and then instantiated with neighborhood systems as objects and approximable mappings as morphisms. In constructing the appropriate neighborhood system for the untyped model, we make use of Agda's sized types; this feature enables us to prove transitivity of the ordering relation between untyped neighborhoods.
Loading Preview
Sorry, preview is currently unavailable. You can download the paper by clicking the button above.
Computer Languages, 1990
ACM SIGPLAN …, 2009
Fundamenta Informaticae, 1995
ACM SIGPLAN Notices, 1976