Results 1 
8 of
8
HigherOrder Functional Reactive Programming in Bounded Space
"... Functional reactive programming (FRP) is an elegant and successful approach to programming reactive systems declaratively. The high levels of abstraction and expressivity that make FRP attractive as a programming model do, however, often lead to programs whose resource usage is excessive and hard to ..."
Abstract

Cited by 4 (1 self)
 Add to MetaCart
Functional reactive programming (FRP) is an elegant and successful approach to programming reactive systems declaratively. The high levels of abstraction and expressivity that make FRP attractive as a programming model do, however, often lead to programs whose resource usage is excessive and hard to predict. In this paper, we address the problem of space leaks in discretetime functional reactive programs. We present a functional reactive programming language that statically bounds the size of the dataflow graph a reactive program creates, while still permitting use of higherorder functions and highertype streams such as streams of streams. We achieve this with a novel linear type theory that both controls allocation and ensures that all recursive definitions are wellfounded. We also give a denotational semantics for our language by combining recent work on metric spaces for the interpretation of higherorder causal functions with lengthspace models of spacebounded computation. The resulting category is doubly closed and hence forms a model of the logic of bunched implications.
Pure type systems with corecursion on streams From finite to infinitary normalisation
 IN ICFP
, 2012
"... In this paper, we use types for ensuring that programs involving streams are wellbehaved. We extend pure type systems with a type constructor for streams, a modal operator next and a fixed point operator for expressing corecursion. This extension is called Pure Type Systems with Corecursion (CoPTS) ..."
Abstract

Cited by 3 (2 self)
 Add to MetaCart
In this paper, we use types for ensuring that programs involving streams are wellbehaved. We extend pure type systems with a type constructor for streams, a modal operator next and a fixed point operator for expressing corecursion. This extension is called Pure Type Systems with Corecursion (CoPTS). The typed lambda calculus for reactive programs defined by Krishnaswami and Benton can be obtained as a CoPTS. CoPTS’s allow us to study a wide range of typed lambda calculi extended with corecursion using only one framework. In particular, we study this extension for the calculus of constructions which is the underlying formal language of Coq. We use the machinery of infinitary rewriting and formalize the idea of wellbehaved programs using the concept of infinitary normalization. We study the properties of infinitary weak and strong normalization for CoPTS’s. The set of finite and infinite terms is defined as a metric completion. We shed new light on the meaning of the modal operator by connecting the modality with the depth used to define the metric. This connection is the key to the proofs of infinitary weak and strong normalization.
StepIndexed Normalization for a Language with General Recursion
"... The TRELLYS project has produced several designs for practical dependently typed languages. These languages are broken into two fragments—a logical fragment where every term normalizes and which is consistent when interpreted as a logic, and a programmatic fragment with general recursion and other c ..."
Abstract

Cited by 2 (2 self)
 Add to MetaCart
The TRELLYS project has produced several designs for practical dependently typed languages. These languages are broken into two fragments—a logical fragment where every term normalizes and which is consistent when interpreted as a logic, and a programmatic fragment with general recursion and other convenient but unsound features. In this paper, we present a small example language in this style. Our design allows the programmer to explicitly mention and pass information between the two fragments. We show that this feature substantially complicates the metatheory and present a new technique, combining the traditional Girard–Tait method with stepindexed logical relations, which we use to show normalization for the logical fragment. 1
Causality For Free! Parametricity Implies Causality for Functional Reactive Programs
"... Functional Reactive Programming (FRP) is a model of reactive systems in which signals are timedependent values, and signal functions are functions between signals. Signal functions are required to be causal, in that output behaviour at time t is only allowed to depend on input behaviour up to time ..."
Abstract

Cited by 2 (1 self)
 Add to MetaCart
Functional Reactive Programming (FRP) is a model of reactive systems in which signals are timedependent values, and signal functions are functions between signals. Signal functions are required to be causal, in that output behaviour at time t is only allowed to depend on input behaviour up to time t. In order to enforce causality, many FRP libraries are arrowized, in that they provide combinators for building signal functions, rather than allowing users to write functions directly. In this paper, we provide a definition of deep causality (which coincides with the usual definition on signals of base type, but differs on nested signals). We show that FRP types can be interpreted in System Fω extended with a kind of time, and show that in this interpretation, a “theorems for free” argument shows that parametric functions are deep causal. Since all System Fω functions are parametric, this implies that all implementable functions are deep causal. This model is the formal basis of the agdafrpjs FRP library for the dependently typed programming language Agda, which compiles to JavaScript and executes in the browser. Assuming parametricity of Agda, this allows reactive programs to be written as regular functions over signals, without sacrificing causality. All results in this paper have been mechanically verified in Agda. 1.
Completeness of Conversion between Reactive Programs for Ultrametric Models
"... Abstract. In 1970 Friedman proved completeness of beta eta conversion in the simplytyped lambda calculus for the settheoretical model. Recently Krishnaswami and Benton have captured the essence of Hudak’s reactive programs in an extension of simply typed lambda calculus with causal streams and a t ..."
Abstract
 Add to MetaCart
Abstract. In 1970 Friedman proved completeness of beta eta conversion in the simplytyped lambda calculus for the settheoretical model. Recently Krishnaswami and Benton have captured the essence of Hudak’s reactive programs in an extension of simply typed lambda calculus with causal streams and a temporal modality and provided this typed lambda calculus for reactive programs with a sound ultrametric semantics. We show that beta eta conversion in the typed lambda calculus of reactive programs is complete for the ultrametric model. 1
Fixing Idioms A recursion primitive for applicative DSLs
"... In a lazy functional language, the standard encoding of recursion in DSLs uses the host language’s recursion, so that DSL algorithms automatically use the host language’s least fixpoints, even though many domains require algorithms to produce different fixpoints. In particular, this is the case for ..."
Abstract
 Add to MetaCart
In a lazy functional language, the standard encoding of recursion in DSLs uses the host language’s recursion, so that DSL algorithms automatically use the host language’s least fixpoints, even though many domains require algorithms to produce different fixpoints. In particular, this is the case for DSLs implemented as Applicative functors (structures with a notion of pure computations and function application). We propose a recursion primitive afix that models a recursive binder in a finally tagless HOAS encoding, but with a novel rank2 type that allows us to specify and exploit the effectsvalues separation that characterises Applicative DSLs. Unlike related approaches for Monads and Arrows, we model effectful recursion, not value recursion. Using generic programming techniques, we define an aritygeneric version of the operator to model mutually recursive definitions. We recover intuitive user syntax with a form of shallow syntactic sugar: an alet construct that syntactically resembles the let construct, which we have implemented in the GHC Haskell compiler. We describe a proposed axiom for the afix operator. We demonstrate usefulness with examples from Applicative parser combinators and functional reactive programming. We show how higherorder recursive operators like many can be encoded without special library support, unlike previous approaches, and we demonstrate an implementation of the left recursion removal transform.
Dependently Typed Web Client Applications FRP in Agda in HTML5
"... Abstract. In this paper, we describe a compiler back end and library for web client application development in Agda, a dependently typed functional programming language. The compiler back end targets ECMAScript (also known as JavaScript), and so is executable in a browser. The library is an impleme ..."
Abstract
 Add to MetaCart
Abstract. In this paper, we describe a compiler back end and library for web client application development in Agda, a dependently typed functional programming language. The compiler back end targets ECMAScript (also known as JavaScript), and so is executable in a browser. The library is an implementation of Functional Reactive Programming (FRP) using a constructive variant of Lineartime Temporal Logic (LTL) as its type system. 1
Rate Types for Stream Programs
"... Abstract. We introduce RATE TYPES, a novel type system to reason about and optimize dataintensive programs. Built around stream languages, RATE TYPES performs static quantitative reasoning about stream rates — the frequency of data items in a stream being consumed, processed, and produced — a criti ..."
Abstract
 Add to MetaCart
Abstract. We introduce RATE TYPES, a novel type system to reason about and optimize dataintensive programs. Built around stream languages, RATE TYPES performs static quantitative reasoning about stream rates — the frequency of data items in a stream being consumed, processed, and produced — a critical performance characteristic previously addressed by numerous experimental approaches but few foundational efforts. Even though streams are fundamentally dynamic, we find two essential concepts of stream rate control — throughput ratio and natural rate — are intimately related to the program structure itself and can be effectively reasoned about by a type system. RATE TYPES is proven sound over a timeaware and parallelismaware operational semantics. The strong soundness result tolerates arbitrary schedules, and does not require any synchronization between stream filters. We further demonstrate the applications of RATE TYPES in energyefficient computing and CPU allocation on multicore architectures. 1