06.03.2014 Views

Book of Abstracts - IRIT

Book of Abstracts - IRIT

Book of Abstracts - IRIT

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Copatterns: Programming Infinite Structures<br />

by Observations<br />

Andreas Abel<br />

Institut für Informatik, Ludwig-Maximilians-Universität München<br />

Oettingenstr. 67, D-80538 München, DEUTSCHLAND<br />

Inductive datatypes provide mechanisms to define finite data such as finite lists and trees<br />

via constructors and allow programmers to analyze and manipulate finite data via pattern<br />

matching. In this talk, we present a dual approach for working with infinite data structures<br />

such as streams. Infinite data inhabits coinductive datatypes which denote greatest fixpoints.<br />

Unlike finite data which is defined by constructors we define infinite data by observations.<br />

Dual to pattern matching, a tool for analyzing finite data, we develop the concept <strong>of</strong> copattern<br />

matching, which allows us to synthesize infinite data. This leads to a symmetric language<br />

design where pattern matching on finite and infinite data can be mixed.<br />

We present a core language for programming with infinite structures by observations together<br />

with its operational semantics based on (co)pattern matching and describe coverage <strong>of</strong><br />

copatterns. Our language naturally supports both call-by-name and call-by-value interpretations<br />

and can be seamlessly integrated into existing languages like Haskell and ML. We prove<br />

type soundness for our language and sketch how copatterns open new directions for solving<br />

problems in the interaction <strong>of</strong> coinductive and dependent types.<br />

This is joint work with Brigitte Pientka, David Thibodeau, and Anton Setzer [1].<br />

References<br />

[1] Andreas Abel, Brigitte Pientka, David Thibodeau, and Anton Setzer. Copatterns: Programming<br />

infinite structures by observations. In Roberto Giacobazzi and Radhia Cousot, editors, The 40th<br />

Annual ACM SIGPLAN-SIGACT Symposium on Principles <strong>of</strong> Programming Languages, POPL’13,<br />

Rome, Italy, January 23 - 25, 2013, pages 27–38. ACM Press, 2013.<br />

14

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!