首页 > 最新文献

ACM SIGPLAN Symposium/Workshop on Haskell最新文献

英文 中文
Hasochism: the pleasure and pain of dependently typed haskell programming Hasochism:依赖类型haskell编程的快乐和痛苦
Pub Date : 2013-09-23 DOI: 10.1145/2503778.2503786
S. Lindley, Conor McBride
Haskell's type system has outgrown its Hindley-Milner roots to the extent that it now stretches to the basics of dependently typed programming. In this paper, we collate and classify techniques for programming with dependent types in Haskell, and contribute some new ones. In particular, through extended examples---merge-sort and rectangular tilings---we show how to exploit Haskell's constraint solver as a theorem prover, delivering code which, as Agda programmers, we envy. We explore the compromises involved in simulating variations on the theme of the dependent function space in an attempt to help programmers put dependent types to work, and to inform the evolving language design both of Haskell and of dependently typed languages more broadly.
Haskell的类型系统已经超越了它的Hindley-Milner根源,它现在延伸到依赖类型编程的基础。本文对Haskell中依赖类型编程的技术进行了整理和分类,并贡献了一些新的技术。特别是,通过扩展的示例——合并排序和矩形拼接——我们展示了如何利用Haskell的约束求解器作为定理证明器,交付的代码,作为Agda程序员,我们羡慕不已。我们探讨了在模拟依赖函数空间的变化时所涉及的妥协,试图帮助程序员使用依赖类型,并更广泛地为Haskell和依赖类型语言的不断发展的语言设计提供信息。
{"title":"Hasochism: the pleasure and pain of dependently typed haskell programming","authors":"S. Lindley, Conor McBride","doi":"10.1145/2503778.2503786","DOIUrl":"https://doi.org/10.1145/2503778.2503786","url":null,"abstract":"Haskell's type system has outgrown its Hindley-Milner roots to the extent that it now stretches to the basics of dependently typed programming. In this paper, we collate and classify techniques for programming with dependent types in Haskell, and contribute some new ones. In particular, through extended examples---merge-sort and rectangular tilings---we show how to exploit Haskell's constraint solver as a theorem prover, delivering code which, as Agda programmers, we envy. We explore the compromises involved in simulating variations on the theme of the dependent function space in an attempt to help programmers put dependent types to work, and to inform the evolving language design both of Haskell and of dependently typed languages more broadly.","PeriodicalId":188691,"journal":{"name":"ACM SIGPLAN Symposium/Workshop on Haskell","volume":"24 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2013-09-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"131690567","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 50
Maintaining verified software 维护已验证的软件
Pub Date : 2013-09-23 DOI: 10.1145/2503778.2503787
Joe Leslie-Hurd
Maintaining software in the face of evolving dependencies is a challenging problem, and in addition to good release practices there is a need for automatic dependency analysis tools to avoid errors creeping in. Verified software reveals more semantic information in the form of mechanized proofs of functional specifications, and this can be used for dependency analysis. In this paper we present a scheme for automatic dependency analysis of verified software, which for each program checks that the collection of installed libraries is sufficient to guarantee its functional correctness. We illustrate the scheme with a case study of Haskell packages verified in higher order logic. The dependency analysis reduces the burden of maintaining verified Haskell packages by automatically computing version ranges for the packages they depend on, such that any combination provides the functionality required for correct operation.
面对不断发展的依赖关系维护软件是一个具有挑战性的问题,除了良好的发布实践之外,还需要自动依赖分析工具来避免错误的出现。经过验证的软件以功能规范的机械化证明的形式揭示了更多的语义信息,这可以用于依赖性分析。本文提出了一种对已验证软件进行自动依赖分析的方案,该方案对每个程序检查已安装库的集合是否足以保证其功能的正确性。我们通过一个在高阶逻辑中验证的Haskell包的案例研究来说明该方案。依赖分析通过自动计算它们所依赖的包的版本范围,减少了维护经过验证的Haskell包的负担,这样任何组合都提供了正确操作所需的功能。
{"title":"Maintaining verified software","authors":"Joe Leslie-Hurd","doi":"10.1145/2503778.2503787","DOIUrl":"https://doi.org/10.1145/2503778.2503787","url":null,"abstract":"Maintaining software in the face of evolving dependencies is a challenging problem, and in addition to good release practices there is a need for automatic dependency analysis tools to avoid errors creeping in. Verified software reveals more semantic information in the form of mechanized proofs of functional specifications, and this can be used for dependency analysis. In this paper we present a scheme for automatic dependency analysis of verified software, which for each program checks that the collection of installed libraries is sufficient to guarantee its functional correctness. We illustrate the scheme with a case study of Haskell packages verified in higher order logic. The dependency analysis reduces the burden of maintaining verified Haskell packages by automatically computing version ranges for the packages they depend on, such that any combination provides the functionality required for correct operation.","PeriodicalId":188691,"journal":{"name":"ACM SIGPLAN Symposium/Workshop on Haskell","volume":"1 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2013-09-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"130979118","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
The Intel labs Haskell research compiler 英特尔实验室Haskell研究编译器
Pub Date : 2013-09-23 DOI: 10.1145/2503778.2503779
Hai Liu, Neal Glew, Leaf Petersen, T. A. Anderson
The Glasgow Haskell Compiler (GHC) is a well supported optimizing compiler for the Haskell programming language, along with its own extensions to the language and libraries. Haskell's lazy semantics imposes a runtime model which is in general difficult to implement efficiently. GHC achieves good performance across a wide variety of programs via aggressive optimization taking advantage of the lack of side effects, and by targeting a carefully tuned virtual machine. The Intel Labs Haskell Research Compiler uses GHC as a frontend, but provides a new whole-program optimizing backend by compiling the GHC intermediate representation to a relatively generic functional language compilation platform. We found that GHC's external Core language was relatively easy to use, but reusing GHC's libraries and achieving full compatibility were harder. For certain classes of programs, our platform provides substantial performance benefits over GHC alone, performing 2x faster than GHC with the LLVM backend on selected modern performance-oriented benchmarks; for other classes of programs, the benefits of GHC's tuned virtual machine continue to outweigh the benefits of more aggressive whole program optimization. Overall we achieve parity with GHC with the LLVM backend. In this paper, we describe our Haskell compiler stack, its implementation and optimization approach, and present benchmark results comparing it to GHC.
格拉斯哥Haskell编译器(GHC)是一个为Haskell编程语言提供良好支持的优化编译器,以及它自己对该语言和库的扩展。Haskell的懒惰语义强加了一个通常很难有效实现的运行时模型。GHC通过积极的优化(利用了无副作用的优势)和针对精心调优的虚拟机,在各种各样的程序中实现了良好的性能。英特尔实验室Haskell研究编译器使用GHC作为前端,但通过将GHC中间表示编译为相对通用的函数式语言编译平台,提供了一个新的整体程序优化后端。我们发现GHC的外部核心语言相对容易使用,但是重用GHC的库和实现完全兼容比较困难。对于某些类别的程序,我们的平台提供了比GHC单独的显著性能优势,在选定的现代性能为导向的基准测试中,使用LLVM后端比GHC快2倍;对于其他类别的程序,GHC调优虚拟机的好处仍然超过更积极的整个程序优化的好处。总的来说,我们通过LLVM后端实现了与GHC相同的功能。在本文中,我们描述了我们的Haskell编译器堆栈,它的实现和优化方法,并给出了与GHC比较的基准测试结果。
{"title":"The Intel labs Haskell research compiler","authors":"Hai Liu, Neal Glew, Leaf Petersen, T. A. Anderson","doi":"10.1145/2503778.2503779","DOIUrl":"https://doi.org/10.1145/2503778.2503779","url":null,"abstract":"The Glasgow Haskell Compiler (GHC) is a well supported optimizing compiler for the Haskell programming language, along with its own extensions to the language and libraries. Haskell's lazy semantics imposes a runtime model which is in general difficult to implement efficiently. GHC achieves good performance across a wide variety of programs via aggressive optimization taking advantage of the lack of side effects, and by targeting a carefully tuned virtual machine. The Intel Labs Haskell Research Compiler uses GHC as a frontend, but provides a new whole-program optimizing backend by compiling the GHC intermediate representation to a relatively generic functional language compilation platform. We found that GHC's external Core language was relatively easy to use, but reusing GHC's libraries and achieving full compatibility were harder. For certain classes of programs, our platform provides substantial performance benefits over GHC alone, performing 2x faster than GHC with the LLVM backend on selected modern performance-oriented benchmarks; for other classes of programs, the benefits of GHC's tuned virtual machine continue to outweigh the benefits of more aggressive whole program optimization. Overall we achieve parity with GHC with the LLVM backend. In this paper, we describe our Haskell compiler stack, its implementation and optimization approach, and present benchmark results comparing it to GHC.","PeriodicalId":188691,"journal":{"name":"ACM SIGPLAN Symposium/Workshop on Haskell","volume":"49 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2013-09-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"129780613","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 13
Names for free: polymorphic views of names and binders 免费的名称:名称和绑定的多态视图
Pub Date : 2013-09-23 DOI: 10.1145/2503778.2503780
Jean-Philippe Bernardy, Nicolas Pouillard
We propose a novel technique to represent names and binders in Haskell. The dynamic (run-time) representation is based on de Bruijn indices, but it features an interface to write and manipulate variables conviently, using Haskell-level lambdas and variables. The key idea is to use rich types: a subterm with an additional free variable is viewed either as forallν.ν → Term(ɑ + ν) or ϶ν.ν x Term(ν.ν) depending on whether it is constructed or analysed. We demonstrate on a number of examples how this approach permits to express term construction and manipulation in a natural way, while retaining the good properties of representations based on de Bruijn indices.
我们提出了一种在Haskell中表示名称和粘合剂的新技术。动态(运行时)表示基于de Bruijn索引,但它提供了一个接口,可以使用haskell级别的lambdas和变量方便地编写和操作变量。关键思想是使用富类型:带有附加自由变量的子项被视为forallν。ν→术语(ν + ν)或϶ν。ν x terms (ν.ν)取决于它是否被构造或分析。我们通过一些例子展示了这种方法如何允许以自然的方式表达术语构建和操作,同时保留了基于de Bruijn索引的表示的良好性质。
{"title":"Names for free: polymorphic views of names and binders","authors":"Jean-Philippe Bernardy, Nicolas Pouillard","doi":"10.1145/2503778.2503780","DOIUrl":"https://doi.org/10.1145/2503778.2503780","url":null,"abstract":"We propose a novel technique to represent names and binders in Haskell. The dynamic (run-time) representation is based on de Bruijn indices, but it features an interface to write and manipulate variables conviently, using Haskell-level lambdas and variables. The key idea is to use rich types: a subterm with an additional free variable is viewed either as forallν.ν → Term(ɑ + ν) or ϶ν.ν x Term(ν.ν) depending on whether it is constructed or analysed. We demonstrate on a number of examples how this approach permits to express term construction and manipulation in a natural way, while retaining the good properties of representations based on de Bruijn indices.","PeriodicalId":188691,"journal":{"name":"ACM SIGPLAN Symposium/Workshop on Haskell","volume":"28 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2013-09-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"133724209","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 4
Understanding idiomatic traversals backwards and forwards 理解习惯的前后遍历
Pub Date : 2013-09-23 DOI: 10.1145/2503778.2503781
R. Bird, J. Gibbons, Stefan Mehner, J. Voigtländer, T. Schrijvers
We present new ways of reasoning about a particular class of effectful Haskell programs, namely those expressed as idiomatic traversals. Starting out with a specific problem about labelling and unlabelling binary trees, we extract a general inversion law, applicable to any monad, relating a traversal over the elements of an arbitrary traversable type to a traversal that goes in the opposite direction. This law can be invoked to show that, in a suitable sense, unlabelling is the inverse of labelling. The inversion law, as well as a number of other properties of idiomatic traversals, is a corollary of a more general theorem characterising traversable functors as finitary containers: an arbitrary traversable object can be decomposed uniquely into shape and contents, and traversal be understood in terms of those. Proof of the theorem involves the properties of traversal in a special idiom related to the free applicative functor.
我们提出了对一类有效的Haskell程序进行推理的新方法,即那些表示为惯用遍历的程序。从一个关于标记和不标记二叉树的特定问题开始,我们提取了一个适用于任何单子的一般反转定律,将任意可遍历类型的元素的遍历与相反方向的遍历联系起来。这个定律可以用来表明,在适当的意义上,不贴标签是贴标签的反面。逆律,以及一些惯用遍历函数的其他性质,是一个将可遍历函子描述为有限容器的更一般定理的必然结果:一个任意的可遍历对象可以被唯一地分解为形状和内容,并且遍历可以根据它们来理解。这个定理的证明涉及到与自由应用函子相关的一种特殊的遍历性质。
{"title":"Understanding idiomatic traversals backwards and forwards","authors":"R. Bird, J. Gibbons, Stefan Mehner, J. Voigtländer, T. Schrijvers","doi":"10.1145/2503778.2503781","DOIUrl":"https://doi.org/10.1145/2503778.2503781","url":null,"abstract":"We present new ways of reasoning about a particular class of effectful Haskell programs, namely those expressed as idiomatic traversals. Starting out with a specific problem about labelling and unlabelling binary trees, we extract a general inversion law, applicable to any monad, relating a traversal over the elements of an arbitrary traversable type to a traversal that goes in the opposite direction. This law can be invoked to show that, in a suitable sense, unlabelling is the inverse of labelling. The inversion law, as well as a number of other properties of idiomatic traversals, is a corollary of a more general theorem characterising traversable functors as finitary containers: an arbitrary traversable object can be decomposed uniquely into shape and contents, and traversal be understood in terms of those. Proof of the theorem involves the properties of traversal in a special idiom related to the free applicative functor.","PeriodicalId":188691,"journal":{"name":"ACM SIGPLAN Symposium/Workshop on Haskell","volume":"28 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2013-09-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"115574885","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 21
An EDSL approach to high performance Haskell programming 一个实现高性能Haskell编程的EDSL方法
Pub Date : 2013-09-23 DOI: 10.1145/2503778.2503789
J. Ankner, Josef Svenningsson
This paper argues for a new methodology for writing high performance Haskell programs by using Embedded Domain Specific Languages. We exemplify the methodology by describing a complete library, meta-repa, which is a reimplementation of parts of the repa library. The paper describes the implementation of meta-repa and contrasts it with the standard approach to writing high performance libraries. We conclude that even though the embedded language approach has an initial cost of defining the language and some syntactic overhead it gives a more tailored programming model, stronger performance guarantees, better control over optimizations, simpler implementation of fusion and inlining and allows for moving type level programming down to value level programming in some cases. We also provide benchmarks showing that meta-repa is as fast, or faster, than repa. Furthermore, meta-repa also includes push arrays and we demonstrate their usefulness for writing certain high performance kernels such as FFT.
本文提出了一种使用嵌入式领域特定语言编写高性能Haskell程序的新方法。我们通过描述一个完整的库meta-repa来举例说明该方法,meta-repa是repa库部分的重新实现。本文描述了meta-repa的实现,并将其与编写高性能库的标准方法进行了对比。我们得出的结论是,尽管嵌入式语言方法具有定义语言的初始成本和一些语法开销,但它提供了更定制的编程模型,更强的性能保证,更好的优化控制,更简单的融合和内联实现,并允许在某些情况下将类型级编程移到值级编程。我们还提供了基准测试,显示meta-repa与repa一样快,甚至比repa更快。此外,meta-repa还包括push数组,我们演示了它们对于编写某些高性能内核(如FFT)的有用性。
{"title":"An EDSL approach to high performance Haskell programming","authors":"J. Ankner, Josef Svenningsson","doi":"10.1145/2503778.2503789","DOIUrl":"https://doi.org/10.1145/2503778.2503789","url":null,"abstract":"This paper argues for a new methodology for writing high performance Haskell programs by using Embedded Domain Specific Languages.\u0000 We exemplify the methodology by describing a complete library, meta-repa, which is a reimplementation of parts of the repa library. The paper describes the implementation of meta-repa and contrasts it with the standard approach to writing high performance libraries. We conclude that even though the embedded language approach has an initial cost of defining the language and some syntactic overhead it gives a more tailored programming model, stronger performance guarantees, better control over optimizations, simpler implementation of fusion and inlining and allows for moving type level programming down to value level programming in some cases. We also provide benchmarks showing that meta-repa is as fast, or faster, than repa.\u0000 Furthermore, meta-repa also includes push arrays and we demonstrate their usefulness for writing certain high performance kernels such as FFT.","PeriodicalId":188691,"journal":{"name":"ACM SIGPLAN Symposium/Workshop on Haskell","volume":"103 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2013-09-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"115734481","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 23
Splittable pseudorandom number generators using cryptographic hashing 使用加密散列的可分割伪随机数生成器
Pub Date : 2013-09-23 DOI: 10.1145/2503778.2503784
Koen Claessen, Michal H. Palka
We propose a new splittable pseudorandom number generator (PRNG) based on a cryptographic hash function. Splittable PRNGs, in contrast to linear PRNGs, allow the creation of two (seemingly) independent generators from a given random number generator. Splittable PRNGs are very useful for structuring purely functional programs, as they avoid the need for threading around state. We show that the currently known and used splittable PRNGs are either not efficient enough, have inherent flaws, or lack formal arguments about their randomness. In contrast, our proposed generator can be implemented efficiently, and comes with a formal statements and proofs that quantify how 'random' the results are that are generated. The provided proofs give strong randomness guarantees under assumptions commonly made in cryptography.
提出了一种基于密码学哈希函数的可分裂伪随机数生成器。与线性prng相比,可分割prng允许从给定的随机数生成器创建两个(看似)独立的生成器。可拆分prng对于构造纯函数式程序非常有用,因为它们避免了围绕状态执行线程的需要。我们表明,目前已知和使用的可分割prng要么不够有效,要么有内在缺陷,要么缺乏关于其随机性的正式论证。相比之下,我们提出的生成器可以有效地实现,并附带正式的声明和证明,量化生成的结果是如何“随机”的。所提供的证明在密码学中常用的假设下提供了强随机性保证。
{"title":"Splittable pseudorandom number generators using cryptographic hashing","authors":"Koen Claessen, Michal H. Palka","doi":"10.1145/2503778.2503784","DOIUrl":"https://doi.org/10.1145/2503778.2503784","url":null,"abstract":"We propose a new splittable pseudorandom number generator (PRNG) based on a cryptographic hash function. Splittable PRNGs, in contrast to linear PRNGs, allow the creation of two (seemingly) independent generators from a given random number generator. Splittable PRNGs are very useful for structuring purely functional programs, as they avoid the need for threading around state. We show that the currently known and used splittable PRNGs are either not efficient enough, have inherent flaws, or lack formal arguments about their randomness. In contrast, our proposed generator can be implemented efficiently, and comes with a formal statements and proofs that quantify how 'random' the results are that are generated. The provided proofs give strong randomness guarantees under assumptions commonly made in cryptography.","PeriodicalId":188691,"journal":{"name":"ACM SIGPLAN Symposium/Workshop on Haskell","volume":"145 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2013-09-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"124638521","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 34
Extensible effects: an alternative to monad transformers 可扩展效果:单片变压器的替代方案
Pub Date : 2013-09-23 DOI: 10.1145/2503778.2503791
O. Kiselyov, A. Sabry, Cameron Swords
We design and implement a library that solves the long-standing problem of combining effects without imposing restrictions on their interactions (such as static ordering). Effects arise from interactions between a client and an effect handler (interpreter); interactions may vary throughout the program and dynamically adapt to execution conditions. Existing code that relies on monad transformers may be used with our library with minor changes, gaining efficiency over long monad stacks. In addition, our library has greater expressiveness, allowing for practical idioms that are inefficient, cumbersome, or outright impossible with monad transformers. Our alternative to a monad transformer stack is a single monad, for the coroutine-like communication of a client with its handler. Its type reflects possible requests, i.e., possible effects of a computation. To support arbitrary effects and their combinations, requests are values of an extensible union type, which allows adding and, notably, subtracting summands. Extending and, upon handling, shrinking of the union of possible requests is reflected in its type, yielding a type-and-effect system for Haskell. The library is lightweight, generalizing the extensible exception handling to other effects and accurately tracking them in types.
我们设计并实现了一个库,该库解决了长期存在的组合效果的问题,而不会对它们的交互施加限制(例如静态排序)。效果产生于客户端和效果处理程序(解释器)之间的交互;交互可以在整个程序中变化,并动态地适应执行条件。依赖于monad转换器的现有代码可以与我们的库一起使用,只需做一些微小的更改,就可以在长monad堆栈上获得效率。此外,我们的库具有更强的表达性,允许使用效率低下、繁琐或完全不可能使用单子转换器的实用习惯用法。我们的monad转换器堆栈的替代方案是单个monad,用于客户端与其处理程序之间类似协程的通信。它的类型反映了可能的请求,即计算的可能效果。为了支持任意效果及其组合,请求是可扩展联合类型的值,它允许添加和(特别是减去和)。扩展和在处理时缩减可能请求的联合反映在它的类型中,为Haskell产生了一个类型和效果系统。该库是轻量级的,将可扩展的异常处理推广到其他效果,并在类型中准确地跟踪它们。
{"title":"Extensible effects: an alternative to monad transformers","authors":"O. Kiselyov, A. Sabry, Cameron Swords","doi":"10.1145/2503778.2503791","DOIUrl":"https://doi.org/10.1145/2503778.2503791","url":null,"abstract":"We design and implement a library that solves the long-standing problem of combining effects without imposing restrictions on their interactions (such as static ordering). Effects arise from interactions between a client and an effect handler (interpreter); interactions may vary throughout the program and dynamically adapt to execution conditions. Existing code that relies on monad transformers may be used with our library with minor changes, gaining efficiency over long monad stacks. In addition, our library has greater expressiveness, allowing for practical idioms that are inefficient, cumbersome, or outright impossible with monad transformers.\u0000 Our alternative to a monad transformer stack is a single monad, for the coroutine-like communication of a client with its handler. Its type reflects possible requests, i.e., possible effects of a computation. To support arbitrary effects and their combinations, requests are values of an extensible union type, which allows adding and, notably, subtracting summands. Extending and, upon handling, shrinking of the union of possible requests is reflected in its type, yielding a type-and-effect system for Haskell. The library is lightweight, generalizing the extensible exception handling to other effects and accurately tracking them in types.","PeriodicalId":188691,"journal":{"name":"ACM SIGPLAN Symposium/Workshop on Haskell","volume":"10 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2013-09-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"126956101","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 107
Causality of optimized Haskell: what is burning our cycles? 优化Haskell的因果关系:是什么在燃烧我们的周期?
Pub Date : 2013-09-23 DOI: 10.1145/2503778.2503788
P. Wortmann, D. Duke
Profiling real-world Haskell programs is hard, as compiler optimizations make it tricky to establish causality between the source code and program behavior. In this paper we attack the root issue by performing a causality analysis of functional programs under optimization. We apply our findings to build a novel profiling infrastructure on top of the Glasgow Haskell Compiler, allowing for performance analysis even of aggressively optimized programs.
分析真实的Haskell程序很困难,因为编译器优化使得在源代码和程序行为之间建立因果关系变得很棘手。在本文中,我们通过对优化下的函数程序进行因果分析来解决根本问题。我们应用我们的发现,在格拉斯哥Haskell编译器之上构建了一个新的分析基础设施,甚至允许对积极优化的程序进行性能分析。
{"title":"Causality of optimized Haskell: what is burning our cycles?","authors":"P. Wortmann, D. Duke","doi":"10.1145/2503778.2503788","DOIUrl":"https://doi.org/10.1145/2503778.2503788","url":null,"abstract":"Profiling real-world Haskell programs is hard, as compiler optimizations make it tricky to establish causality between the source code and program behavior. In this paper we attack the root issue by performing a causality analysis of functional programs under optimization. We apply our findings to build a novel profiling infrastructure on top of the Glasgow Haskell Compiler, allowing for performance analysis even of aggressively optimized programs.","PeriodicalId":188691,"journal":{"name":"ACM SIGPLAN Symposium/Workshop on Haskell","volume":"20 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2013-09-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"121997621","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 1
Adding structure to monoids: thus hopefully ending Haskell's string type confusion 为monoids添加结构:从而有望结束Haskell的字符串类型混淆
Pub Date : 2013-09-23 DOI: 10.1145/2503778.2503785
Mario BlaEevic
This paper presents the rationale and design of monoid-subclasses. This Haskell library consists of a collection of type classes that generalize the interface of several common data types, most importantly those used to represent strings. We demonstrate that the mathematical theory behind monoid-subclasses can bring substantial practical benefits to the Haskell library ecosystem by generalizing attoparsec, one of the most popular Haskell parsing libraries.
本文给出了单群子类的基本原理和设计。这个Haskell库由一组类型类组成,这些类型类泛化了几种常见数据类型的接口,最重要的是那些用于表示字符串的类型。通过推广最流行的Haskell解析库之一attoparsec,我们证明了monoid子类背后的数学理论可以为Haskell库生态系统带来实质性的实际好处。
{"title":"Adding structure to monoids: thus hopefully ending Haskell's string type confusion","authors":"Mario BlaEevic","doi":"10.1145/2503778.2503785","DOIUrl":"https://doi.org/10.1145/2503778.2503785","url":null,"abstract":"This paper presents the rationale and design of monoid-subclasses. This Haskell library consists of a collection of type classes that generalize the interface of several common data types, most importantly those used to represent strings. We demonstrate that the mathematical theory behind monoid-subclasses can bring substantial practical benefits to the Haskell library ecosystem by generalizing attoparsec, one of the most popular Haskell parsing libraries.","PeriodicalId":188691,"journal":{"name":"ACM SIGPLAN Symposium/Workshop on Haskell","volume":"48 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2013-09-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"126487781","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 2
期刊
ACM SIGPLAN Symposium/Workshop on Haskell
全部 Acc. Chem. Res. ACS Applied Bio Materials ACS Appl. Electron. Mater. ACS Appl. Energy Mater. ACS Appl. Mater. Interfaces ACS Appl. Nano Mater. ACS Appl. Polym. Mater. ACS BIOMATER-SCI ENG ACS Catal. ACS Cent. Sci. ACS Chem. Biol. ACS Chemical Health & Safety ACS Chem. Neurosci. ACS Comb. Sci. ACS Earth Space Chem. ACS Energy Lett. ACS Infect. Dis. ACS Macro Lett. ACS Mater. Lett. ACS Med. Chem. Lett. ACS Nano ACS Omega ACS Photonics ACS Sens. ACS Sustainable Chem. Eng. ACS Synth. Biol. Anal. Chem. BIOCHEMISTRY-US Bioconjugate Chem. BIOMACROMOLECULES Chem. Res. Toxicol. Chem. Rev. Chem. Mater. CRYST GROWTH DES ENERG FUEL Environ. Sci. Technol. Environ. Sci. Technol. Lett. Eur. J. Inorg. Chem. IND ENG CHEM RES Inorg. Chem. J. Agric. Food. Chem. J. Chem. Eng. Data J. Chem. Educ. J. Chem. Inf. Model. J. Chem. Theory Comput. J. Med. Chem. J. Nat. Prod. J PROTEOME RES J. Am. Chem. Soc. LANGMUIR MACROMOLECULES Mol. Pharmaceutics Nano Lett. Org. Lett. ORG PROCESS RES DEV ORGANOMETALLICS J. Org. Chem. J. Phys. Chem. J. Phys. Chem. A J. Phys. Chem. B J. Phys. Chem. C J. Phys. Chem. Lett. Analyst Anal. Methods Biomater. Sci. Catal. Sci. Technol. Chem. Commun. Chem. Soc. Rev. CHEM EDUC RES PRACT CRYSTENGCOMM Dalton Trans. Energy Environ. Sci. ENVIRON SCI-NANO ENVIRON SCI-PROC IMP ENVIRON SCI-WAT RES Faraday Discuss. Food Funct. Green Chem. Inorg. Chem. Front. Integr. Biol. J. Anal. At. Spectrom. J. Mater. Chem. A J. Mater. Chem. B J. Mater. Chem. C Lab Chip Mater. Chem. Front. Mater. Horiz. MEDCHEMCOMM Metallomics Mol. Biosyst. Mol. Syst. Des. Eng. Nanoscale Nanoscale Horiz. Nat. Prod. Rep. New J. Chem. Org. Biomol. Chem. Org. Chem. Front. PHOTOCH PHOTOBIO SCI PCCP Polym. Chem.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1