Results 21  30
of
50
Monads, Shapely Functors and Traversals
, 1999
"... This paper demonstrates the potential for combining the polytypic and monadic programming styles, by introducing a new kind of combinator, called a traversal. The natural setting for dening traversals is the class of shapely data types. This result reinforces the view that shapely data types form a ..."
Abstract

Cited by 4 (0 self)
 Add to MetaCart
This paper demonstrates the potential for combining the polytypic and monadic programming styles, by introducing a new kind of combinator, called a traversal. The natural setting for dening traversals is the class of shapely data types. This result reinforces the view that shapely data types form a natural domain for polytypism: they include most of the data types of interest, while to exceed them would sacrice a very smooth interaction between polytypic and monadic programming. Keywords: functional/monadic/polytypic programming, shape theory. 1 Introduction Monadic programming has proved itself extremely useful as a means of encapsulating state and other computational eects in a functional programming setting (see e.g. [12,14]). Recently, interactions between monads and data structures have been studied as a further way for structuring programs. Initially focusing on lists, the studies have been extended to the class of regular datatypes (see e.g. [4,11,1]), with the aim to embo...
PolyLib  a library of polytypic functions
 In Workshop on Generic Programming (WGP'98), Marstrand
, 1998
"... This paper describes the polytypic functions in PolyLib, motivates their presence in the library, and gives a rationale for their design. Thus we hope to share our experience with other researchers in the field. We will assume the reader has some familiarity with the field of polytypic programming. ..."
Abstract

Cited by 4 (0 self)
 Add to MetaCart
(Show Context)
This paper describes the polytypic functions in PolyLib, motivates their presence in the library, and gives a rationale for their design. Thus we hope to share our experience with other researchers in the field. We will assume the reader has some familiarity with the field of polytypic programming. Of course, a library is an important part of a programming language. Languages like Java, Delphi, Perl and Haskell are popular partly because of their useful and extensive libraries. For a polytypic programming language it is even more important to have a clear and welldesigned library: writing polytypic programs is difficult, and we do not expect many programmers to write polytypic programs. On the other hand, many programmers use polytypic programs such as parser generators, equality functions, etc. This is a first attempt to describe the library of PolyP; we expect that both the form and content of this description will change over time. One of the goals of this paper is to obtain feedback on the library design from other researchers working within the field. At the moment the library only contains the basic
Short Cut Fusion of Recursive Programs with Computational Effects
 SYMPOSIUM ON TRENDS IN FUNCTIONAL PROGRAMMING 2008 (TFP'08)
, 2008
"... Fusion is the process of improving the efficiency of modularly constructed programs by transforming them into monolithic equivalents. This paper defines a generalization of the standardbuild combinator which expresses uniform production of functorial contexts containing data of inductive types. It a ..."
Abstract

Cited by 3 (1 self)
 Add to MetaCart
Fusion is the process of improving the efficiency of modularly constructed programs by transforming them into monolithic equivalents. This paper defines a generalization of the standardbuild combinator which expresses uniform production of functorial contexts containing data of inductive types. It also proves correct a fusion rule which generalizes thefold/build andfold/buildp rules from the literature, and eliminates intermediate data structures of inductive types without disturbing the contexts in which they are situated. An important special case arises when this context is monadic. When it is, a second rule for fusing combinations of producers and consumers via monad operations, rather than via composition, is also available. We give examples illustrating both rules, and consider their coalgebraic duals as well.
Deriving animations from recursive definitions
 In Draft Proceedings of the 14th International Workshop on the Implementation of Functional Languages (IFL’02
, 2002
"... Abstract. This paper describes a generic method to derive an animation from a recursive definition, with the objective of debugging and understanding this definition by expliciting its control structure. This method is based on a well known algorithm of factorizing a recursive function into the comp ..."
Abstract

Cited by 3 (2 self)
 Add to MetaCart
(Show Context)
Abstract. This paper describes a generic method to derive an animation from a recursive definition, with the objective of debugging and understanding this definition by expliciting its control structure. This method is based on a well known algorithm of factorizing a recursive function into the composition of the producer and the consumer of its call tree. We developed a systematic method to transform both the resulting functions in order to draw the tree step by step. The theory of data types as fixed points of functors, generic recursion patterns, and monads, are fundamental to our work and are briefly presented. Using polytypic implementations of monadic recursion patterns and an application to manipulate and generate graph layouts we developed a prototype that, given a recursive function written in a subset of Haskell, returns a function whose execution yields the desired animation. 1
Weaving generic programming and traversal performance
 In AOSD ’10
, 2010
"... Developing complex software requires that functions be implemented over a variety of recursively defined data structures. While the design (and modeling) of structures is itself difficult, complex data can require even more complex functions. In this paper, we introduce a declarative form of travers ..."
Abstract

Cited by 2 (2 self)
 Add to MetaCart
(Show Context)
Developing complex software requires that functions be implemented over a variety of recursively defined data structures. While the design (and modeling) of structures is itself difficult, complex data can require even more complex functions. In this paper, we introduce a declarative form of traversalbased generic programming that modularizes functions over a structure using functionobjects. Our approach is supported by a library and set of generative tools, collectively called DemeterF, which are used to implement modular, adaptive functions. While our traversals support highlevel abstractions resulting in modular and extensible functions, we retain genericity, flexibility and performance through traversal generation and inlining.
Functors, Types and Shapes
 Chalmers University of Technology
, 1999
"... r goals of generic programming. However, in pointing out minor differences, let us not forget the overwhelming unity of purpose that brings us together. FML supports a kind of functors F; G, as well as of types ø and type schema oe. The full type system is given by F; G ::= U j C j \Pi m i j F hG ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
(Show Context)
r goals of generic programming. However, in pointing out minor differences, let us not forget the overwhelming unity of purpose that brings us together. FML supports a kind of functors F; G, as well as of types ø and type schema oe. The full type system is given by F; G ::= U j C j \Pi m i j F hGi n j ¯ m F ø ::= X j F (ø) j ø 1 ! ø 2 oe ::= ø j 8U : m:oe j 8X : T:oe : Each functor F has an arity m (written F : m), which indicates the number of type arguments it takes. The functors include variables U and constants<F29.8
Outofcore Functional Programming with Typebased Primitives
 In Proceedings of the 2nd International Workshop on Practical Aspects of Declarative Languages
, 2000
"... . We formulate and experiment with typebased primitives (such as fold and unfold operations) for outofcore processing of functional data structures. We follow the view that recursive data types are fixed points of polynomial type constructors. This view leads to a clear separation of the sema ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
(Show Context)
. We formulate and experiment with typebased primitives (such as fold and unfold operations) for outofcore processing of functional data structures. We follow the view that recursive data types are fixed points of polynomial type constructors. This view leads to a clear separation of the semantics and the implementations of recursive data types. We provide monadic implementations of the typebased primitives so that the intermediate data structures used for the executions of the primitives can be placed in outofcore storage. The parametric module facility of Objective Caml is further used to package the outofcore implementations. The resulting outofcore user code retains the same program structure of the incore user code and can be as elegant. 1 Motivation In programming languages supporting automatic memory management, a program need not explicitly request storage for data during the execution. The runtime system allocates space for new data, and reclaims space ...
Strategy Application, Observability, and the Choice Combinator. Sandia
"... In many strategic systems, the choice combinator provides a powerful mechanism for controlling the application of rules and strategies to terms. The ability of the choice combinator to exercise control over rewriting is based on the premise that the success and failure of strategy application can be ..."
Abstract

Cited by 1 (1 self)
 Add to MetaCart
In many strategic systems, the choice combinator provides a powerful mechanism for controlling the application of rules and strategies to terms. The ability of the choice combinator to exercise control over rewriting is based on the premise that the success and failure of strategy application can be observed. In this paper we present a higherorder strategic framework with the ability to dynamically construct strategies containing the choice combinator. To this framework, a combinator called hide is introduced that prevents the successful application of a strategy from being observed by the choice combinator. We then explore the impact of this new combinator on a realworld problem involving a restricted implementation of the Java Virtual Machine.
A.: Shortcut fusion of monadic programs
 J. of Univ. Comput. Sci
, 2008
"... Abstract: Functional programs often combine separate parts of the program using intermediate data structures for communicating results. Programs so defined are easier to understand and maintain, but suffer from inefficiency problems due to the generation of those data structures. In response to this ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
Abstract: Functional programs often combine separate parts of the program using intermediate data structures for communicating results. Programs so defined are easier to understand and maintain, but suffer from inefficiency problems due to the generation of those data structures. In response to this problematic, some program transformation techniques have been studied with the aim to eliminate the intermediate data structures that arise in function compositions. One of these techniques is known as shortcut fusion. This technique has usually been studied in the context of purely functional programs. In this work we propose an extension of shortcut fusion that is able to eliminate intermediate data structures generated in the presence of monadic effects. The extension to be presented can be uniformly defined for a wide class of data types and monads.
Minimizing Monad Comprehensions
, 2011
"... Monad comprehensions are by now a mainstay of functional programming languages. In this paper we develop a theory of semantic optimization for monad comprehensions that goes beyond rewriting using the monad laws. A monadwithzero comprehension do x ← X; y ← Y; if P (x, y) then return F (x, y) else ..."
Abstract

Cited by 1 (1 self)
 Add to MetaCart
Monad comprehensions are by now a mainstay of functional programming languages. In this paper we develop a theory of semantic optimization for monad comprehensions that goes beyond rewriting using the monad laws. A monadwithzero comprehension do x ← X; y ← Y; if P (x, y) then return F (x, y) else zero can be rewritten, so as to minimize the number of ← bindings, using constraints that are known to hold of X and Y. The soundness of this technique varies from monad to monad, and we characterize its soundness for monads expressible in functional programming languages by generalizing classical results from relational database theory. This technique allows the optimization of a wide class of languages, ranging from largescale dataparallel languages such as DryadLINQ and Data Parallel Haskell to probabilistic languages such as IBAL and functionallogical languages like Curry.