Results 1 
7 of
7
Programming monads operationally with Unimo
 In ICFP
, 2006
"... Monads are widely used in Haskell for modeling computational effects, but defining monads remains a daunting challenge. Since every part of a monad’s definition depends on its computational effects, programmers cannot leverage the common behavior of all monads easily and thus must build from scratch ..."
Abstract

Cited by 13 (2 self)
 Add to MetaCart
(Show Context)
Monads are widely used in Haskell for modeling computational effects, but defining monads remains a daunting challenge. Since every part of a monad’s definition depends on its computational effects, programmers cannot leverage the common behavior of all monads easily and thus must build from scratch each monad that models a new computational effect. I propose the Unimo framework which allows programmers to define monads and monad transformers in a modular manner. Unimo contains a heavily parameterized observer function which enforces the monad laws, and programmers define a monad by invoking the observer function with arguments that specify the computational effects of the monad. Since Unimo provides the common behavior of all monads in a reusable form, programmers no longer need to rebuild the semantic boilerplate for each monad and can instead focus on the more interesting and rewarding task of modeling the desired computational effects.
Reflection without Remorse Revealing a hidden sequence to speed up monadic reflection
"... A series of list appends or monadic binds for many monads performs algorithmically worse when leftassociated. Continuationpassing style (CPS) is wellknown to cure this severe dependence of performance on the association pattern. The advantage of CPS dwindles or disappears if we have to examine o ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
(Show Context)
A series of list appends or monadic binds for many monads performs algorithmically worse when leftassociated. Continuationpassing style (CPS) is wellknown to cure this severe dependence of performance on the association pattern. The advantage of CPS dwindles or disappears if we have to examine or modify the intermediate result of a series of appends or binds, before continuing the series. Such examination is frequently needed, for example, to control search in nondeterminism monads. We present an alternative approach that is just as general as CPS but more robust: it makes series of binds and other such operations efficient regardless of the association pattern – and also provides efficient access to intermediate results. The key is to represent such a conceptual sequence as an efficient sequence data structure. Efficient sequence data structures from the literature are homogeneous and cannot be applied as they are in a typesafe way to series of monadic binds. We generalize them to type aligned sequences and show how to construct their (assuredly orderpreserving) implementations. We demonstrate that our solution solves previously undocumented, severe performance problems in iteratees, LogicT transformers, free monads and extensible effects. Categories and Subject Descriptors D.3.2 [Programming Lan
Parse Your Options
, 2013
"... We describe the development of a couple of combinators which can be used to run applicative style parsers in an interleaved way. In the presentation we advocate a scheme for choosing identifier names which clearly shows the types of the values involved, and how to compose them into the desired resul ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
(Show Context)
We describe the development of a couple of combinators which can be used to run applicative style parsers in an interleaved way. In the presentation we advocate a scheme for choosing identifier names which clearly shows the types of the values involved, and how to compose them into the desired result. We finish with describing how the combinators can be used to parse command line arguments and files containing options. 1
Skeletons and the Anatomy of Monads
, 2006
"... Monads are used heavily in Haskell for supporting computational effects, and the language offers excellent support for defining monadic computations. Unfortunately, defining a monad remains a difficult challenge. There are no libraries that a programmer can use to define a monad that is not a compos ..."
Abstract
 Add to MetaCart
Monads are used heavily in Haskell for supporting computational effects, and the language offers excellent support for defining monadic computations. Unfortunately, defining a monad remains a difficult challenge. There are no libraries that a programmer can use to define a monad that is not a composition of existing monad transformers; therefore every such effort must start from scratch despite that all monads share the same structure and need to satisfy the same minimum set of properties. I propose
General Terms Design, Languages
"... Monads are widely used in Haskell for modeling computational effects, but defining monads remains a daunting challenge. Since every part of a monad’s definition depends on its computational effects, programmers cannot leverage the common behavior of all monads easily and thus must build from scratch ..."
Abstract
 Add to MetaCart
(Show Context)
Monads are widely used in Haskell for modeling computational effects, but defining monads remains a daunting challenge. Since every part of a monad’s definition depends on its computational effects, programmers cannot leverage the common behavior of all monads easily and thus must build from scratch each monad that models a new computational effect. I propose the Unimo framework which allows programmers to define monads and monad transformers in a modular manner. Unimo contains a heavily parameterized observer function which enforces the monad laws, and programmers define a monad by invoking the observer function with arguments that specify the computational effects of the monad. Since Unimo provides the common behavior of all monads in a reusable form, programmers no longer need to rebuild the semantic boilerplate for each monad and can instead focus on the more interesting and rewarding task of modeling the desired computational effects.
Kan Extensions for Program Optimisation Or: Art and Dan Explain an Old Trick
"... Abstract. Many program optimisations involve transforming a program in direct style to an equivalent program in continuationpassing style. This paper investigates the theoretical underpinnings of this transformation in the categorical setting of monads. We argue that socalled absolute Kan Extens ..."
Abstract
 Add to MetaCart
(Show Context)
Abstract. Many program optimisations involve transforming a program in direct style to an equivalent program in continuationpassing style. This paper investigates the theoretical underpinnings of this transformation in the categorical setting of monads. We argue that socalled absolute Kan Extensions underlie this program optimisation. It is known that every Kan extension gives rise to a monad, the codensity monad, and furthermore that every monad is isomorphic to a codensity monad. The end formula for Kan extensions then induces an implementation of the monad, which can be seen as the categorical counterpart of continuationpassing style. We show that several optimisations are instances of this scheme: Church representations and implementation of backtracking using success and failure continuations, among others. Furthermore, we develop the calculational properties of Kan extensions, powers and ends. In particular, we propose a twodimensional notation based on string diagrams that aims to support effective reasoning with Kan extensions.