Artículo
Functional pearl: A smart view on datatypes
Fecha de publicación:
08/2015
Editorial:
Association for Computing Machinery
Revista:
Proceedings of the ACM SIGPLAN International Conference on Functional Programming, ICFP
ISSN:
0362-1340
Idioma:
Inglés
Tipo de recurso:
Artículo publicado
Clasificación temática:
Resumen
Left-nested list concatenations, left-nested binds on the free monad, and left-nested choices in many non-determinism monads have an algorithmically bad performance. Can we solve this problem without losing the ability to pattern-match on the computation? Surprisingly, there is a deceptively simple solution: use a smart view to pattern-match on the datatype. We introduce the notion of smart view and show how it solves the problem of slow leftnested operations. In particular, we use the technique to obtain fast and simple implementations of lists, of free monads, and of two non-determinism monads.
Palabras clave:
Data Structure
,
List
,
Monad
,
Monadplus
Archivos asociados
Licencia
Identificadores
Colecciones
Articulos(CIFASIS)
Articulos de CENTRO INT.FRANCO ARG.D/CS D/L/INF.Y SISTEM.
Articulos de CENTRO INT.FRANCO ARG.D/CS D/L/INF.Y SISTEM.
Citación
Jaskelioff, Mauro Javier; Rivas Gadda, Exequiel Matías; Functional pearl: A smart view on datatypes; Association for Computing Machinery; Proceedings of the ACM SIGPLAN International Conference on Functional Programming, ICFP; 2015-August; 8-2015; 355-361
Compartir
Altmétricas