A pattern for almost homomorphic functions

  • Authors:
  • Nicolas Frisby;Andy Gill;Perry Alexander

  • Affiliations:
  • University of Kansas, Lawrence, KS, USA;University of Kansas, Lawrence, KS, USA;University of Kansas, Lawrence, KS, USA

  • Venue:
  • Proceedings of the 8th ACM SIGPLAN workshop on Generic programming
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

Modern type systems present the programmer with a trade-off between correctness and code complexity--more precise, or exact, types that allow only legal values prevent runtime errors while less precise types enable more reuse. Unfortunately, the software engineering benefits of reuse and avoiding duplicate code currently outweigh assurance gains of exact types. We factor out a pattern common in conversions that result from using exact types as a reusable function, extending existing generic programming techniques to avoid code duplication and enable reuse.