Filters








1,572 Hits in 3.3 sec

A monadic framework for delimited continuations

R. KENT Dyvbig, SIMON PEYTON JONES, AMR SABRY
2007 Journal of functional programming  
This results in a monadic framework for typed and encapsulated delimited continuations, which we design and implement as a Haskell library.  ...  Delimited continuations are more expressive than traditional abortive continuations and they apparently require a framework beyond traditional continuation-passing style (CPS).  ...  We would also like to thank Eugenio Moggi for critical comments on an attempted type system for tracking dangling prompts.  ... 
doi:10.1017/s0956796807006259 fatcat:mmkuafpinbgptihr4wow7frz7e

A generic framework for specialization (abridged version) [chapter]

Peter Thiemann
1998 Lecture Notes in Computer Science  
The framework provides the infrastructure for specializing higher-order programs with computational effects specified through a monad.  ...  We present a generic framework for specifying and implementing offline partial evaluators.  ...  for the lambda calculus (Sec. 6), a combination of the continuation monad and the store monad yields a specializer for core ML with references (Sec. 7), a combination of the continuation monad and the  ... 
doi:10.1007/bfb0053576 fatcat:lcfspj4n65ap7nayqcau4b5bsm

A Dynamic Continuation-Passing Style for Dynamic Delimited Continuations

Dariusz Biernacki, Olivier Danvy, Kevin Millikin
2006 BRICS Report Series  
We show that the notion of computation induced by dynamic CPS takes the form of a continuation monad with a recursive answer type and we present a new simulation of dynamic delimited continuations in terms  ...  We put a pre-existing definitional abstract machine for dynamic delimited continuations in defunctionalized form, and we present the consequences of this adjustment.  ...  Acknowledgments: We are grateful to Mads Sig Ager, Ma lgorzata Biernacka, Julia Lawall, Kristian Støvring, and the anonymous reviewers for their comments.  ... 
doi:10.7146/brics.v13i15.21920 fatcat:ysuhgobz5rhvhc673cuqlwhfue

A Contextual Reconstruction of Monadic Reflection

Toru Kawata, Michael Wagner
2018 Annual Conference for Computer Science Logic  
Our reconstruction of monadic reflection opens up a path for investigation of delimited continuations with familiar monadic language.  ...  Next, moving focus to delimited continuations, we present a macro definition of shift/reset by monadic reflection.  ...  delimited continuations through the lens of monadic reflection, obtaining a better understanding of delimited continuations.  ... 
doi:10.4230/lipics.csl.2018.27 dblp:conf/csl/Kawata18 fatcat:mptbox3borfz7mvrz73kpfcgli

Capturing the Future by Replaying the Past [article]

James Koppel, Gabriel Scherer, Armando Solar-Lezama
2018 arXiv   pre-print
Along the way, we explain delimited continuations and monadic reflection, show how the Filinski construction lets thermometer continuations express any monadic effect, share an elegant special-case for  ...  Delimited continuations are the mother of all monads!  ...  CONCLUSION Filinski's original construction of monadic re ection from delimited continuations, and delimited continuations from normal continuations plus state, provided a new way to program for the small  ... 
arXiv:1710.10385v2 fatcat:ciq6xqrbwzhxhhb5i56gv55yey

Capturing the future by replaying the past (functional pearl)

James Koppel, Gabriel Scherer, Armando Solar-Lezama
2018 Proceedings of the ACM on Programming Languages  
Along the way, we explain delimited continuations and monadic re ection, show how the Filinski construction lets thermometer continuations express any monadic e ect, share an elegant special-case for nondeterminism  ...  Delimited continuations are the mother of all monads!  ...  CONCLUSION Filinski's original construction of monadic re ection from delimited continuations, and delimited continuations from normal continuations plus state, provided a new way to program for the small  ... 
doi:10.1145/3236771 dblp:journals/pacmpl/KoppelSS18 fatcat:ftrkiuhmbrdq5erugdhcczq45e

Implementing first-class polymorphic delimited continuations by a type-directed selective CPS-transform

Tiark Rompf, Ingo Maier, Martin Odersky
2009 SIGPLAN notices  
We describe the implementation of first-class polymorphic delimited continuations in the programming language Scala.  ...  To tackle the problem of implementing first-class continuations under the adverse conditions brought upon by the Java VM, we employ a selective CPS transform, which is driven entirely by effect-annotated  ...  Acknowledgments We would like to thank Philipp Haller for suggesting the use of proceed to make Scala actors continuation aware.  ... 
doi:10.1145/1631687.1596596 fatcat:46levrwjozbyhpmr6qmq3e3bem

Implementing first-class polymorphic delimited continuations by a type-directed selective CPS-transform

Tiark Rompf, Ingo Maier, Martin Odersky
2009 Proceedings of the 14th ACM SIGPLAN international conference on Functional programming - ICFP '09  
We describe the implementation of first-class polymorphic delimited continuations in the programming language Scala.  ...  To tackle the problem of implementing first-class continuations under the adverse conditions brought upon by the Java VM, we employ a selective CPS transform, which is driven entirely by effect-annotated  ...  Acknowledgments We would like to thank Philipp Haller for suggesting the use of proceed to make Scala actors continuation aware.  ... 
doi:10.1145/1596550.1596596 dblp:conf/icfp/RompfMO09 fatcat:z44qbxwb65enlmzzrkhkjzk5ou

Memoisation: Purely, Left-recursively, and with (Continuation Passing) Style [article]

Samer Abdallah
2017 arXiv   pre-print
A notable exception is Johnson's (1995) continuation passing approach in Scheme. This, however, relies on mutation of a memo table data structure and coding in explicit continuation passing style.  ...  We show how Johnson's approach can be implemented purely functionally in a modern, strongly typed functional language (OCaml), presented via a monadic interface that hides the implementation details, yet  ...  A Implementation of supporting modules To implement MONADREF without using OCaml mutable references, we use a state monad where the state is a polymorphic key-value store implemented using the BatMap functor  ... 
arXiv:1707.04724v1 fatcat:bm47jyil7vg7haun7rkplxn22y

Backtracking, interleaving, and terminating monad transformers

Oleg Kiselyov, Chung-chieh Shan, Daniel P. Friedman, Amr Sabry
2005 SIGPLAN notices  
We present a library for adding backtracking computations to any Haskell monad.  ...  We present two implementations of the library: one using success and failure continuations; and the other using control operators for manipulating delimited continuations.  ...  We have described two implementations of the transformer, a CPS one with two continuations, and a direct-style one based on a Haskell library of delimited continuations [6] .  ... 
doi:10.1145/1090189.1086390 fatcat:bvj5df5d4ngzni2yti3nmm6s7i

Backtracking, interleaving, and terminating monad transformers

Oleg Kiselyov, Chung-chieh Shan, Daniel P. Friedman, Amr Sabry
2005 Proceedings of the tenth ACM SIGPLAN international conference on Functional programming - ICFP '05  
We present a library for adding backtracking computations to any Haskell monad.  ...  We present two implementations of the library: one using success and failure continuations; and the other using control operators for manipulating delimited continuations.  ...  We have described two implementations of the transformer, a CPS one with two continuations, and a direct-style one based on a Haskell library of delimited continuations [6] .  ... 
doi:10.1145/1086365.1086390 dblp:conf/icfp/KiselyovSFS05 fatcat:rrj7l74qwrcpjcfiwev6tds4ey

Heuristics Entwined with Handlers Combined

Tom Schrijvers, Nicolas Wu, Benoit Desouter, Bart Demoen
2014 Proceedings of the 16th International Symposium on Principles and Practice of Declarative Programming - PPDP '14  
Our solution is not restricted to a functional model: we show how to implement this technique as a library in Prolog by means of delimited continuations. • We show how to obtain modular search heuristics  ...  We do so by starting from a functional specification of Prolog based on monads, and extend this with the effect handlers approach to capture the dynamic search tree as syntax.  ...  Acknowledgments We are grateful to the members of IFIP WG 2.1 for feedback on this work, to Olivier Danvy for discussions about delimited continuations, and to Ralf Hinze for his detailed comments on an  ... 
doi:10.1145/2643135.2643145 dblp:conf/ppdp/SchrijversWDD14 fatcat:j7wsvb2oevb6jl24rn3xpfxjv4

On the expressive power of user-defined effects: effect handlers, monadic reflection, delimited control

Yannick Forster, Ohad Kammar, Sam Lindley, Matija Pretnar
2017 Proceedings of the ACM on Programming Languages  
For each calculus, we present syntax, operational semantics, a natural type-and-effect system, and, for effect handlers and monadic reflection, a set-theoretic denotational semantics.  ...  We compare the expressive power of three programming abstractions for user-defined computational effects: Plotkin and Pretnar's effect handlers, Filinski's monadic reflection, and delimited control without  ...  By composing our translation from effect handlers to delimited continuations with a CPS translation for delimited continuations Hillerström et al. [2017] derived a CPS translation for effect handlers  ... 
doi:10.1145/3110257 dblp:journals/pacmpl/0002KLP17 fatcat:26dm2333znhmfjn223p5vtxrb4

On the expressive power of user-defined effects: Effect handlers, monadic reflection, delimited control

YANNICK FORSTER, OHAD KAMMAR, SAM LINDLEY, MATIJA PRETNAR
2019 Journal of functional programming  
For each calculus, we present syntax, operational semantics, a natural type-and-effect system, and, for effect handlers and monadic reflection, a set-theoretic denotational semantics.  ...  AbstractWe compare the expressive power of three programming abstractions for user-defined computational effects: Plotkin and Pretnar's effect handlers, Filinski's monadic reflection, and delimited control  ...  By composing our translation from effect handlers to delimited continuations with a CPS translation for delimited continuations Hillerström et al. [2017] derived a CPS translation for effect handlers  ... 
doi:10.1017/s0956796819000121 fatcat:4lvaaamf6ffxbb6i26kkia5mjq

An Operational Investigation of the CPS Hierarchy [chapter]

Olivier Danvy, Zhe Yang
1999 Lecture Notes in Computer Science  
We relate it to the traditional CPS transformation and we use it to account for the control operator shift and the control delimiter reset operationally.  ...  We then transcribe the resulting continuation semantics in ML, thus obtaining a native and modular implementation of the entire hierarchy.  ...  Thanks are due to Andrzej Filinski, Julia Lawall, and the anonymous referees for comments on an earlier version of this article.  ... 
doi:10.1007/3-540-49099-x_15 fatcat:atjyhs4o2ndmteqoufof3zcriy
« Previous Showing results 1 — 15 out of 1,572 results