CIFASIS   20631
CENTRO INTERNACIONAL FRANCO ARGENTINO DE CIENCIAS DE LA INFORMACION Y DE SISTEMAS
Unidad Ejecutora - UE
artículos
Título:
Functional pearl: a smart view on datatypes
Autor/es:
MAURO JASKELIOFF; EXEQUIEL RIVAS
Revista:
ACM SIGPLAN NOTICES
Editorial:
ASSOC COMPUTING MACHINERY
Referencias:
Lugar: New York - USA; Año: 2015 vol. 50 p. 355 - 361
ISSN:
0362-1340
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 left-nested operations. In particular, we use the technique to obtain fast and simple implementations of lists, of free monads, and of two non-determinism monads.