Results 11 - 20
of
50
Taming Effects with Monadic Typing
, 1999
"... The familiar Hindley-Milner type system of the ML language family is extended with monad annotations to account for possible side effects of expression evaluation. This also allows effects to be effectively encapsulated by lexical scopes, with enforcement provided by type checking. A type-and-effect ..."
Abstract
-
Cited by 10 (0 self)
- Add to MetaCart
The familiar Hindley-Milner type system of the ML language family is extended with monad annotations to account for possible side effects of expression evaluation. This also allows effects to be effectively encapsulated by lexical scopes, with enforcement provided by type checking. A type-and-effects analysis supports type inference. Type soundness and completeness theorems establish the coherence of monadic type inference with the reference semantics of a small ML-style language. 1 Introduction Modern functional languages such as Haskell, Standard ML, CAML and Clean have evolved into wide spectrum programming languages through the addition of imperative features and foreign-language interfaces to a purely functional core. This evolution has been necessary to make these languages practical vehicles for the design and implementation of software systems but it has impaired our ability to reason about and formally manipulate programs. When evaluation of an expression may produce a side ...
Monads for Natural Language Semantics
"... Accounts of semantic phenomena often involve extending types of meanings and revising composition rules at the same time. The concept of monads allows many such accounts---for intensionality, variable binding, quantification and focus---to be stated uniformly and compositionally. ..."
Abstract
-
Cited by 10 (0 self)
- Add to MetaCart
Accounts of semantic phenomena often involve extending types of meanings and revising composition rules at the same time. The concept of monads allows many such accounts---for intensionality, variable binding, quantification and focus---to be stated uniformly and compositionally.
Value Recursion in Monadic Computations
- OGI School of Science and Engineering, OHSU
, 2002
"... viii 1 ..."
Prolog's Control Constructs in a Functional . . .
- INTERNATIONAL JOURNAL OF FOUNDATIONS OF COMPUTER SCIENCE
"... The purpose of this article is twofold. First, we show that Prolog's control constructs can be smoothly integrated into a functional language like Haskell. The resulting `language', termed embedded Prolog, incorporates many of the features prescribed by the Prolog ISO standard: control constructs ..."
Abstract
-
Cited by 10 (5 self)
- Add to MetaCart
The purpose of this article is twofold. First, we show that Prolog's control constructs can be smoothly integrated into a functional language like Haskell. The resulting `language', termed embedded Prolog, incorporates many of the features prescribed by the Prolog ISO standard: control constructs including the cut, all solution collecting functions, and error handling facilities. Embedded Prolog lacks some concepts such as logical variables but it inherits all of Haskell's strengths, eg static polymorphic typing, higher order functions etc. Technically, the integration is achieved using monads and monad transformers. One of the main innovations is the de nition of a backtracking monad transformer, which allows us to combine backtracking with exception handling and interaction. Second, we work towards an axiomatization of the operations, through which the computational features are accessed. Equations are used to lay down the meaning of the various operations and their interrelations enabling the programmer to reason about programs in a simple calculational style. The axiomatization is applied to show that each nite computation has a simple canonical form.
Promotional Transformation on Monadic Programs
, 1995
"... this paper, we propose a new theory on monadic catamorphism bymoving Fokkinga's assumption on the monad to the condition of a map between monadic algebras so that our theory is valid for arbitrary monads including, for example, the state monad that is not allowed in Fokkinga's theory. Our theory cov ..."
Abstract
-
Cited by 9 (0 self)
- Add to MetaCart
this paper, we propose a new theory on monadic catamorphism bymoving Fokkinga's assumption on the monad to the condition of a map between monadic algebras so that our theory is valid for arbitrary monads including, for example, the state monad that is not allowed in Fokkinga's theory. Our theory covers Fokkinga's as a special case. Moreover, Meijer and Jeuring's informal transformation rules of monadic programs in their case study is actually an instance of our general promotion theorem.
Monads and Modularity
"... This paper argues that the core of modularity problems is an understanding of how individual components of a large system interact with each other, and that this interaction can be described by a layer structure. We propose a uniform treatment of layers based upon the concept of a monad. The combina ..."
Abstract
-
Cited by 7 (5 self)
- Add to MetaCart
This paper argues that the core of modularity problems is an understanding of how individual components of a large system interact with each other, and that this interaction can be described by a layer structure. We propose a uniform treatment of layers based upon the concept of a monad. The combination of different systems can be described by the coproduct of monads.
Recursion is a Computational Effect
, 2000
"... In a recent paper, Launchbury, Lewis, and Cook observe that some Haskell applications could benefit from a combinator mfix for expressing recursion over monadic types. We investigate three possible definitions of mfix and implement them in Haskell. Like traditional fixpoint operators, there are ..."
Abstract
-
Cited by 7 (1 self)
- Add to MetaCart
In a recent paper, Launchbury, Lewis, and Cook observe that some Haskell applications could benefit from a combinator mfix for expressing recursion over monadic types. We investigate three possible definitions of mfix and implement them in Haskell. Like traditional fixpoint operators, there are two approaches to the definition of mfix: an unfolding one based on mathematical semantics, and an updating one based on operational semantics. The two definitions are equivalent in pure calculi but have different behaviors when used within monads. The unfolding version can be easily defined in Haskell if one restricts fixpoints to function types. The updating version is much more challenging to define in Haskell despite the fact that its definition is straightforward in Scheme. After studying the Scheme definition in detail, we mirror it in Haskell using the primitive unsafePerformIO. The resulting definition of mfix appears to work well but proves to be unsafe, in the sense that i...
Using Catamorphisms, Subtypes and Monad Transformers for Writing Modular Functional Interpreters.
, 1995
"... When writing functional interpreters, there are two things which need to be taken care of when having modularity in mind: syntax and semantics. Previous papers have presented methods, based on subtypes and monad transformers, for dealing with semantics. This paper combines these methods with a metho ..."
Abstract
-
Cited by 7 (0 self)
- Add to MetaCart
When writing functional interpreters, there are two things which need to be taken care of when having modularity in mind: syntax and semantics. Previous papers have presented methods, based on subtypes and monad transformers, for dealing with semantics. This paper combines these methods with a method, based on catamorphisms, for dealing with syntax. Subtypes, monad transformers and catamorphisms make it possible to write library code which can be used for building functional interpreters which are composed of reusable components.
Four Concurrency Primitives for Haskell
- In Proc. Haskell Workshop
, 1995
"... . A monad for concurrent programming that is suitable for being built into Haskell is presented. The monad consists of only four primitives with a very simple semantics. A number of examples demonstrate that monads encapsulating other, more sophisticated communication paradigms known from concurr ..."
Abstract
-
Cited by 7 (0 self)
- Add to MetaCart
. A monad for concurrent programming that is suitable for being built into Haskell is presented. The monad consists of only four primitives with a very simple semantics. A number of examples demonstrate that monads encapsulating other, more sophisticated communication paradigms known from concurrent functional languages such as Concurrent ML, Facile, and Erlang can be naturally and systematically constructed from the built-in monad in a purely functional way. The paper argues that minimizing the number and complexity of the concurrency primitives and maximizing the use of purely functional abstractions in the design of concurrent languages helps to remedy a recurrent dilemma, namely, how to keep the language small and rigorously defined, yet to provide the programmer with all the communication constructs required. An interleaving implementation of the monad has been built by extending Mark Jones's Gofer environment to handle the concurrency primitives. All programs presented ...
Defining and Implementing Closed, Domain-Specific Languages
- Invited talk at the Workshop on Semantics, Applications and Implementation of Program Generation (SAIG
, 2000
"... A closed domain-speci c language (DSL) is a standalone, declarative language that cannot easily be embedded into an existing, wide-spectrum programming language as a library of combinators. It requires an independent implementation. We advocate defining the semantics of a closed DSL in terms of a un ..."
Abstract
-
Cited by 6 (0 self)
- Add to MetaCart
A closed domain-speci c language (DSL) is a standalone, declarative language that cannot easily be embedded into an existing, wide-spectrum programming language as a library of combinators. It requires an independent implementation. We advocate defining the semantics of a closed DSL in terms of a universal set of semantics combinators which form a structure algebra over a suitable domain. By exchanging the domain of this algebra for a domain of abstract machine states, we automatically derive an implementation of the DSL in terms of byte code instructions for an abstract machine. The correctness of this implementation is proved by showing coherence of the operational, abstract machine semantics with the denotational semantics. The technique is illustrated in implementing a DSL for pretty printing.

