Controlling Copatterns: There and Back Again (Extended Version)
Author:
- Paul DownenPDPaul Downen
Preprint
Abstract
Copatterns give functional programs a flexible mechanism for responding to their context, and composition can greatly enhance their expressiveness. However, that same expressive power makes it harder to precisely specify the behavior of programs. Using Danvy's functional and syntactic correspondence between different semantic artifacts, we derive a full suite of semantics for copatterns, twice. First, a calculus of monolithic copatterns is taken on a journey from small-step operational semantics to abstract machine to continuation-passing style. Then within continuation-passing style, we refactor the semantics to derive a more general calculus of compositional copatterns, and take the return journey back to derive the other semantic artifacts in reverse order.Keywords
All Related Versions
- Version 1, 2025-08-17, ArXiv
- Published version: , 1.
This publication has 27 references indexed in Scilit:
- Unnesting of Copatterns2014
- On inter-deriving small-step and big-step semantics: A case study for storeless call-by-need evaluationTheoretical Computer Science, 2012
- Classical Call-by-Need Sequent Calculi: The Unity of Semantic ArtifactsLecture Notes in Computer Science, 2012
- A Dynamic Interpretation of the CPS Hierarchy2012
- Inter-deriving semantic artifacts for object-oriented programmingJournal of Computer and System Sciences, 2010
- Defunctionalized Interpreters for Call-by-Need EvaluationLecture Notes in Computer Science, 2010
- On the equivalence between small-step and big-step abstract machines: a simple application of lightweight fusionInformation Processing Letters, 2008
- A syntactic correspondence between context-sensitive calculi and abstract machinesTheoretical Computer Science, 2007
- Answer Type Polymorphism in Call-by-Name Continuation PassingLecture Notes in Computer Science, 2004
- A Sound and Complete CPS-Translation for λμ-CalculusLecture Notes in Computer Science, 2003