Results 1 -
5 of
5
Comparing Datatype Generic Libraries In Haskell
- J. FUNCTIONAL PROGRAMMING
, 2009
"... Datatype-generic programming is about defining functions that depend on the structure, or “shape”, of datatypes. It has been around for more than 10 years, and a lot of progress has been made, in particular in the lazy functional programming language Haskell. There are more than 10 proposals for gen ..."
Abstract
- Add to MetaCart
Datatype-generic programming is about defining functions that depend on the structure, or “shape”, of datatypes. It has been around for more than 10 years, and a lot of progress has been made, in particular in the lazy functional programming language Haskell. There are more than 10 proposals for generic programming libraries or language extensions for Haskell. In this paper we compare and characterise the many generic programming libraries for Haskell. To that end, we introduce a set of criteria and develop a generic programming benchmark: a set of characteristic examples testing various facets of datatype-generic programming. We have implemented the benchmark for ten existing Haskell generic programming libraries and present the evaluation of the libraries. The comparison is useful for reaching a common standard for generic programming, but also for a programmer who has to choose a particular approach for datatype-generic programming.
Reusable Model Transformations
- SOFTWARE AND SYSTEM MODELING
"... Model transformations written for an input metamodel may often apply to other metamodels that share similar concepts. For example, a transformation written to refactor Java models can be applicable to refactoring UML class diagrams as both languages share concepts such as classes, methods, attribut ..."
Abstract
- Add to MetaCart
Model transformations written for an input metamodel may often apply to other metamodels that share similar concepts. For example, a transformation written to refactor Java models can be applicable to refactoring UML class diagrams as both languages share concepts such as classes, methods, attributes, inheritance. Deriving motivation from this example, we present an approach to make model transformations reusable such that they function correctly across several similar metamodels. Our approach relies on these principal steps: (1) We analyze a transformation to obtain an effective subset of used concepts. We prune the input metamodel of the transformation to obtain an effective input metamodel containing the effective subset. The effective input metamodel represents the true input domain of transformation. (2) We adapt a target input metamodel by weaving it with aspects such as properties derived from the effective input metamodel to ultimately make it a subtype of the effective input metamodel. The subtype property ensures that the transformation can process models conforming to the target input metamodel without any change in the transformation itself. We validate our approach by adapting well-known refactoring transformations (Encapsulate Field, Move Method, and Pull Up Method) written for an in-house domain-specific modelling language (DSML) to three different industry standard metamodels (Java, MOF, and UML).
Datatype Generic Programming in Java Author: Ingmar van der Steen
"... The purpose of this study was to investigate if we could implement a datatypegeneric-programming (DGP) library in the OO language Java. DGP is a form of programming in which functionality is written only once and this functionality is reused for arbitrary classes. A DG method captures the pattern th ..."
Abstract
- Add to MetaCart
The purpose of this study was to investigate if we could implement a datatypegeneric-programming (DGP) library in the OO language Java. DGP is a form of programming in which functionality is written only once and this functionality is reused for arbitrary classes. A DG method captures the pattern that exists in ad-hoc implementations of the same functionality for these classes. Being able to write a DG method releases the burden of writing ad-hoc code for each individual class for which we want to have this functionality. Another aim was to find out if we could make this library modular and extensible. Users of this library could then implement new DG methods and extend these methods in a modular fashion. In order to implement this library we tried to reuse the concepts of view and runtime-type-representation (RTR) from DGP libraries written in the functional programming language Haskell. Our library intensively used the Java generics mechanism to be able to adopt these concepts and be able to
Under consideration for publication in J. Functional Programming 1 Comparing Datatype-Generic Libraries
, 924
"... Datatype-generic programming is parametrizing programs by the structure, or “shape ” of datatypes, letting us write, for example, generic traversal or pretty-printing once and apply them to any data type whose shape we can represent. Although more than two decades old, the field has been vigorously ..."
Abstract
- Add to MetaCart
Datatype-generic programming is parametrizing programs by the structure, or “shape ” of datatypes, letting us write, for example, generic traversal or pretty-printing once and apply them to any data type whose shape we can represent. Although more than two decades old, the field has been vigorously growing in recent years, particularly in Haskell. There are more than ten datatype-generic programming libraries in Haskell, not counting proposed language extensions. The proliferation of the libraries poses the problem of comparing them, to help the users choose the right library for their tasks and to attempt to unify some of them. In this paper we develop an extensive test suite for comparing datatype-generic libraries in a typed functional language. We introduce a broad set of criteria and develop a collection of characteristic examples covering most of the facets of datatype-generic programming. We have implemented the examples for ten existing Haskell generic programming libraries and report for the first time the comprehensive evaluation of the libraries against the broad common standard. ZU064-05-FPR ComparingJournal 21 June 2011 16:28 2 Rodriguez Yakushev et al. 1
Software and System Modeling manuscript No. (will be inserted by the editor) Reusable Model Transformations
, 2010
"... Abstract Model transformations written for an input metamodel may often apply to other metamodels that share similar concepts. For example, a transformation written to refactor Java models can be applicable to refactoring UML class diagrams as both languages share concepts such as classes, methods, ..."
Abstract
- Add to MetaCart
Abstract Model transformations written for an input metamodel may often apply to other metamodels that share similar concepts. For example, a transformation written to refactor Java models can be applicable to refactoring UML class diagrams as both languages share concepts such as classes, methods, attributes, inheritance. Deriving motivation from this example, we present an approach to make model transformations reusable such that they function correctly across several similar metamodels. Our approach relies on these principal steps: (1) We analyze a transformation to obtain an effective subset of used concepts. We prune the input metamodel of the transformation to obtain an effective input metamodel containing the effective subset. The effective input metamodel represents the true input domain of transformation. (2) We adapt a target input metamodel by weaving it with aspects such as properties derived from the effective input metamodel to ultimately make it a subtype of the effective input metamodel. The subtype property ensures that the transformation can process models conforming to the target input metamodel without any change in the transformation itself. We validate our approach by adapting well-known refactoring transformations (Encapsulate Field, Move Method, and Pull Up Method) written for an in-house domain-specific modelling language (DSML) to three different industry standard metamodels (Java, MOF, and UML).

