scholarly journals Staging with class: a specification for typed template Haskell

2022 ◽  
Vol 6 (POPL) ◽  
pp. 1-30
Author(s):  
Ningning Xie ◽  
Matthew Pickering ◽  
Andres Löh ◽  
Nicolas Wu ◽  
Jeremy Yallop ◽  
...  

Multi-stage programming using typed code quotation is an established technique for writing optimizing code generators with strong type-safety guarantees. Unfortunately, quotation in Haskell interacts poorly with type classes, making it difficult to write robust multi-stage programs. We study this unsound interaction and propose a resolution, staged type class constraints, which we formalize in a source calculus λ ⇒ that elaborates into an explicit core calculus F . We show type soundness of both calculi, establishing that well-typed, well-staged source programs always elaborate to well-typed, well-staged core programs, and prove beta and eta rules for code quotations. Our design allows programmers to incorporate type classes into multi-stage programs with confidence. Although motivated by Haskell, it is also suitable as a foundation for other languages that support both overloading and quotation.

2012 ◽  
pp. 196-203 ◽  
Author(s):  
Howard Doyle ◽  
Michael Parrish

This paper provides a summary of a multi-stage research project described through the narratives of the two authors. The research project investigated what students thought were effective (i.e., Good) and less effective (i.e., Bad) ways to learn English. The paper presents some of the main findings of the various components of the studies. One important finding relevant to educators working in self-access centres is that students responding to the open-ended portions of the study did not mention electronic, online or multimedia resources, or self-access learning centres (SALCs). Follow-up closed-response questionnaire findings indicated that students evaluated electronic resources and SALCs positively as good ways to learn outside of class. The authors suggest that a questionnaire-based list of ways to learn English out of class is an effective way to raise students’ awareness of alternatives for learners. Subsequent diary studies showed how participants used ideas that were introduced mainly via the questionnaire for their outside class study.


Author(s):  
Walid Taha ◽  
Zine-El-Abidine Benaissa ◽  
Tim Sheard
Keyword(s):  

Author(s):  
JUN INOUE ◽  
WALID TAHA

AbstractWe settle three basic questions that naturally arise when verifying code generators written in multi-stage functional programming languages. First, does adding staging to a language compromise any equalities that hold in the base language? Unfortunately it does, and more care is needed to reason about terms with free variables. Second, staging annotations, as the name “annotations” suggests, are often thought to be orthogonal to the behavior of a program, but when is this formally guaranteed to be true? We give termination conditions that characterize when this guarantee holds. Finally, do multi-stage languages satisfy useful, standard extensional properties, for example, that functions agreeing on all arguments are equivalent? We provide a sound and complete notion of applicative bisimulation, which establishes such properties or, in principle, any valid program equivalence. These results yield important insights into staging and allow us to prove the correctness of quite complicated multi-stage programs.


Author(s):  
W. Baumeister ◽  
R. Rachel ◽  
R. Guckenberger ◽  
R. Hegerl

IntroductionCorrelation averaging (CAV) is meanwhile an established technique in image processing of two-dimensional crystals /1,2/. The basic idea is to detect the real positions of unit cells in a crystalline array by means of correlation functions and to average them by real space superposition of the aligned motifs. The signal-to-noise ratio improves in proportion to the number of motifs included in the average. Unlike filtering in the Fourier domain, CAV corrects for lateral displacements of the unit cells; thus it avoids the loss of resolution entailed by these distortions in the conventional approach. Here we report on some variants of the method, aimed at retrieving a maximum of information from images with very low signal-to-noise ratios (low dose microscopy of unstained or lightly stained specimens) while keeping the procedure economical.


1991 ◽  
Author(s):  
F.I. Carroll ◽  
◽  
Anita H. Lewin
Keyword(s):  

2011 ◽  
Author(s):  
Jared Hotaling ◽  
Jerry Busemeyer ◽  
Richard Shiffrin

Author(s):  
Jamal Othman ◽  
Yaghoob Jafari

Malaysia is contemplating removal of most of her subsidy support measures including subsidies on cooking oil which is largely palm oil based. This paper aims to examine the effects of cooking oil subsidy removals on the competitiveness of the oil palm subsector and related markets. This is done by developing and applying a comparative static, multi-commodity, partial equilibrium model with multi-stages of production function for the Malaysian perennial crops subsector which explicitly links different stages of production, primary and intermediate input markets, trade, and policy linkages. Results partly suggest that export of cooking oil will increase by 0.2 per cent due to a 10 per cent cooking oil subsidy reduction, while domestic output of cooking oil may eventually see a net decline of 1.97 per cent. The results clearly point out that the effect of reducing cooking oil subsidies is relatively small at the upstream levels and therefore it only induces minute effects on factor markets. Consequently, the market for other agricultural crops is projected to change very marginally.   Keywords: Multicomodity, comparative statics, partial equilibrium model, output supply-factor markets linkages, effects of cooking oil subsidy removals.


Sign in / Sign up

Export Citation Format

Share Document