2007 · 11 citations · 9 references
ComputingComputer ScienceFormal MethodsProgramming LanguagesSyntaxAbstract Syntax TreesData TypesData-flow AnalysisFunctional ProgrammingIntermediate RepresentationType SystemsPolymorphic Type SystemsPolymorphic TypesSoftware ComponentsType ClassesType ConstructorsType-level Programming
Abstract. We define a mapping from generic Haskell specifications to C++ with concepts, a recent extension to C++, that can ultimately be automated. More specifically, we provide a translation from Haskell multiparameter type classes with functional dependencies to ConceptC++. Our translation consists of three major parts: the division of Haskell class variables into ConceptC++ concept parameters and associated types, the corresponding division of superclasses in the context of a type class, and the linearization of Haskell ASTs to the concrete syntax of ConceptC++. We also discuss cases in which there is no single correct translation from classes with functional dependencies to concepts. Our translation handles these cases in a reasonable way and is well-defined for the cases most common in practice. The translation is motivated by an ongoing project for distributed adaptive finite volume methods, in which software components are modeled in Haskell and implemented in C++.
9
How to make ad-hoc polymorphism less ad hoc
Philip Wadler, Stephen Blott · 1989 · 770 citations · Full text
Manuel M. T. Chakravarty, Gabriele Keller, Simon Peyton Jones · 2005 · 223 citations
Douglas Gregor, Jaakko Järvi, Jeremy G. Siek et al. · 2006 · 194 citations
A comparative study of language support for generic programming
Ronald Garcia, Jaakko Järvi, Andrew Lumsdaine et al. · 2003 · 148 citations
Gabriel Dos Reis, Bjarne Stroustrup · 2006 · 87 citations