• Home
  • Search
  • Generic programming with combinators and objects
  • Cite Icon1
  • https://doi.org/10.17586/2226-1494-2021-21-5-720-726Copy DOI Icon

Generic programming with combinators and objects

  • Abstract
  • Literature Map
  • References
  • Citations
  • Similar Papers
Abstract

The generic programming approach is popular in functional languages (for example, OCaml, Haskell). In essence, it is a compile-time generation of code that performs transformations of user-defined data types. The generated code can carry out various kinds of transformations of the values. Usually, transformations are represented as functions that implement algorithms of transformation. New transformations could be built from these transformation functions and user-defined ones. The representation based on functions has a downside: functions behave as final representations, and hence it is not possible to modify the behavior of the already built function. If the current set of transformations does not suit well, software developers are obliged to write a completely distinct transformation, even in the case when the new transformation is almost identical to the existing one. This work proposes to build transformations that are extensible after construction. The object-oriented programming paradigm will be followed, transformations will be represented not as functions but as objects. Instead of calling a transformation function, one of the object’s methods will be called. The transformation itself will be split into methods. The extensibility is supported by adding new methods and overriding existing ones. In this paper, the authors propose an approach to represent transformations as objects in the OCaml functional programming language. Every alternative in data type definition has a corresponding object method. This design allows the construction of many distinct transformations. The cases where too many methods are not desirable are also discussed. The method is applicable to represent extensible transformations for polymorphic variant data types in OCaml when other methods fail to do it. The method is not bound to any particular domain. It allows the creation of extensible transformations in OCaml. It could be ported to other functional languages supporting object-oriented programming.

Similar Papers
  • Research Article
  • Citations14

Should ML be Object-Oriented?

  • Jul 01, 2002
  • Formal Aspects of Computing
  • David Macqueen
  • Supplementary Content

Co-Contextual Type Systems: Contextless Deductive Reasoning for Correct Incremental Type Checking

  • Mar 02, 2020
  • TUbilio (Technical University of Darmstadt)
  • Edlira Kuci
  • Book Chapter
  • Citations3

Typed object-oriented functional programming with late binding

  • Jan 01, 1996
  • Zhenyu Qian +1
  • Conference Article
  • Citations1

Developing a monadic type checker for an object-oriented language: an experience report

  • Oct 20, 2019
  • Elias Castegren +1
  • PDF
  • Research Article
  • Citations1

Artificial Intelligence in the American Healthcare Industry: Looking Forward to 2030

  • Oct 06, 2022
  • Journal of Medical Research and Surgery
  • Federico R Tewes
  • Book Chapter
  • Citations8

Introducing Constraint Functional Logic Programming

  • Jan 01, 1992
  • John Darlington +2
  • Conference Article
  • Citations5

Monte Carlo simulation of photon migration in turbid random media based on the object-oriented programming paradigm

  • Feb 10, 2011
  • Proceedings of SPIE, the International Society for Optical Engineering/Proceedings of SPIE
  • Alex Doronin +1
  • Journal Issue

Proceedings Second Workshop on Trends in Functional Programming In Education

  • Dec 08, 2013
  • Electronic Proceedings in Theoretical Computer Science
  • Philip K.F Hölzenspies
  • Research Article
  • Citations1

Implementing functional languages on object-oriented virtual machines

  • Jan 01, 2004
  • IEE Proceedings - Software
  • N Perry +1
  • Conference Article
  • Citations1

General-purpose multiparadigm programming languages: an enabling technology for constructing complex systems

  • Jan 01, 1995
  • T.A Budd +2
  • Research Article
  • Citations3

Experience of building an architecture-based generator using GenVoca for distributed systems

  • May 31, 2009
  • Science of Computer Programming
  • Chung-Horng Lung +3
  • Book Chapter

Safe and Familiar Multi-core Programming by Means of a Hybrid Functional and Imperative Language

  • Jan 01, 2010
  • Ronald Veldema +1
  • Book Chapter
  • Citations1

LAMBDALG: Higher order algebraic specification language

  • Jan 01, 1993
  • Yexuan Gui +1
  • Single Report
  • Citations3

Fully Generic Programming Over Closed Universes of Inductive-Recursive Types

  • Jan 01, 2000
  • Larry Diehl
  • Research Article
  • Citations2

Mapeo de objetos a través de un motor de datos NOSQL, caso de estudio: framework para desarrollo de aplicaciones web (Mapping objects through a data motor NoSQL case study: framework for web applications development)

  • Jan 11, 2016
  • Ingeniería Investigación y Desarrollo
  • Roger Calderon Moreno +1
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.