Detalle del congreso

Autores: Guido Martínez; Mauro Jaskelioff; Guido De Luca.

Resumen: Mathematical concepts such as monads, functors, monoids,and semigroups are expressed in Haskell as typeclasses.Therefore, in order to exploit relations such as ?every monadis a functor?, and ?every monoid is a semigroup?, we need tobe able to also express relations between typeclasses.Currently, the only way to do so is using superclasses.However, superclasses can be problematic due to their closednature. Adding a superclass implies modifying the subclass?definition, which is either impossible if one does not ownsuch code, or painful as it requires cascading changes andthe introduction of boilerplate throughout the codebase.In this article, we introduce class morphisms, a way torelate classes in an open fashion, without changing class definitions. We show how class morphisms improve the expressivity, conciseness, and maintainability of code. Further, weshow how to implement them while maintaining canonicityand coherence, two key properties of the Haskell type system.Extending a typechecker with class morphisms amounts toadding an elaboration phase and is an unintrusive change.We back this claim with a prototype extension of GHC.

Tipo de reunión: Simposio.

Tipo de trabajo: Artículo Completo.

Producción: Improving Typeclass Relations by Being Open.

Reunión científica: Haskell Symposium 2018.

Lugar: St. Louis, MO.

Institución organizadora: ACM-SIGPLAN.

Publicado: Sí

Lugar publicación: St. Louis, MO

Mes de reunión: 9

Página web: aquí