Информатика и вычислительная техника
  • формат pdf
  • размер 614.14 КБ
  • добавлен 24 сентября 2010 г.
Okasaki Chris. Purely Functional Data Structures
When a C programmer needs an efficient data structure for a particular problem, he or she can often simply look one up in any of a number of good textbooks or handbooks. Unfortunately, programmers in functional languages such as Standard ML or Haskell do not have this luxury. Although some data structures designed for imperative languages such as C can be quite easily adapted to a functional setting, most cannot, usually because they depend in crucial ways on assignments, which are disallowed, or at least discouraged, in functional languages.
To address this imbalance, we describe several techniques for designing functional data structures, and numerous original data structures based on these techniques, including multiple variations of lists, queues, double-ended queues, and heaps, many supporting more exotic features such as random access or efficient catenation.
In addition, we expose the fundamental role of lazy evaluation in amortized functional data structures. Traditional methods of amortization break down when old versions of a data structure, not just the most recent, are available for further processing. This property is known as persistence, and is taken for granted in functional languages. On the surface, persistence and amortization appear to be incompatible, but we show how lazy evaluation can be used to resolve this conflict, yielding amortized data structures that are efficient even when used persistently.
Tuing this relationship between lazy evaluation and amortization around, the notion of amortization also provides the first practical techniques for analyzing the time requirements of non-trivial lazy programs.
Finally, our data structures offer numerous hints to programming language designers, illustrating the utility of combining strict and lazy evaluation in a single language, and providing non-trivial examples using polymorphic recursion and higher-order, recursive modules.
Похожие разделы
Смотрите также

Curien P.-L. Categorical Combinators, Sequential Algorithms, and Functional Programmimg

  • формат djvu
  • размер 2.14 МБ
  • добавлен 12 октября 2011 г.
Издательство Birkh?user, 1993, -424 pp. The goal of this monograph is to give a concrete approach to the semantics of sequential programming languages, with application to the design and implementation of programming languages. Just as machines do not manipulate numbers, but representations of numbers, we do not present sets and functions, but concrete representations of these sets and functions. The motivation behind our constructions is to ens...

Fogus M., Houser C. The Joy of Clojure: Thinking the Clojure

  • формат pdf
  • размер 22.01 МБ
  • добавлен 06 апреля 2011 г.
Michael Fogus, Chris Houser. The Joy of Clojure: Thinking the Clojure. Manning Publications, 2011. - 360 p. - ISBN: 1935182641 Clojure is a dynamic programming language that targets the Java Virtual Machine. The Joy of Clojure goes beyond the syntax, and shows how to write fluent, idiomatic Clojure code. Readers will learn to approach programming challenges from a Functional perspective and master the Lisp techniques that make Clojure so elegant...

Halloway S. Programming Clojure

  • формат pdf
  • размер 1.61 МБ
  • добавлен 28 ноября 2009 г.
Clojure is a dynamic language for the Java Virtual Machine, with a compelling combination of features: Clojure is elegant. Clojure's clean, careful design lets you write programs that get right to the essence of a problem, without a lot of clutter and ceremony. Clojure is Lisp reloaded. Clojure has the power inherent in Lisp, but is not constrained by the history of Lisp. Clojure is a functional language. Data structures are immutable, and funct...

Hughes J. The Design of a Pretty-printer Library

Статья
  • формат pdf
  • размер 331.67 КБ
  • добавлен 05 марта 2011 г.
Статья одного из пропагандистов ФП о разработке библиотеки комбинаторов вывода. Реализация осуществлена на языке Haskell. Краткое содержание: Introduction A Preview of the Pretty-printing Library Deriving Functional Programs from Specifications Designing a Sequence Type Implementing Monads Monads for Backtracking Specifying Pretty-printing Implementing Pretty-printing: A Term Representation Optimized Pretty-printing: A Term Representation A Con...

Launchbury J., Peyton-Jones S.L. Lazy Functional State Threads

Статья
  • формат pdf
  • размер 291.25 КБ
  • добавлен 09 марта 2011 г.
John Launchbury and Simon L. Peyton Jones, Lazy Functional State Threads // In Programming Languages Design and Implementation. - ACM Press, 1993. - pp. 24-35. Краткое содержание: Introduction Overview Array references Input/output Formal semantics Implementation Other useful combinators Related work Acknowledgements References Appendix

Loverdos C.K.K., Syropoulos A. Steps in Scala

  • формат pdf
  • размер 12.25 МБ
  • добавлен 05 декабря 2011 г.
CAMBRIDGE UNIVERSITY PRESS, 2010. - 485 p. - ISBN: 978-0-511-90054-9 Object-functional programming is already here. Scala is the most prominent representative of this exciting approach to programming, both in the small and in the large. In this book we show how Scala proves to be a highly expressive, concise, and scalable language, which grows with the needs of the programmer, whether professional or hobbyist. Read the book to see how to: - leve...

Meijer E., Fokkinga M., Paterson R. Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire

  • формат pdf
  • размер 246.78 КБ
  • добавлен 09 марта 2011 г.
Erik Meijer and Maarten Fokkinga and Ross Paterson, Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire. - Springer-Verlag, 1991. - pp. 124-144. Краткое содержание: Introduction The data type of lists Algebraic data types Recursion schemes Parametrized types Conclusion References

Odersky M. Programming in Scala

  • формат pdf
  • размер 4.84 МБ
  • добавлен 28 ноября 2009 г.
Scala is an object-oriented programming language for the Java Virtual Machine. In addition to being object-oriented, Scala is also a functional language, and combines the best approaches to OO and functional programming. Programming in Scala is the definitive book on Scala, the new language for the Java Platform that blends object-oriented and functional programming concepts into a unique and powerful tool for developers. Coauthored by the desi...

Payne A. Programming Scala: Scalability = Functional Programming + Objects

  • формат pdf
  • размер 3.37 МБ
  • добавлен 25 декабря 2009 г.
Learn how to be more productive with Scala, a new multi-paradigm language for the Java Virtual Machine (JVM) that integrates features of both object-oriented and functional programming. With this book, you'll discover why Scala is ideal for highly scalable, component-based applications that support concurrency and distribution. Programming Scala clearly explains the advantages of Scala as a JVM language. You'll learn how to leverage the wealth o...

Subramaniam V. Programming Scala.Tackle multi-core complexity on the Java Virtual Machine

  • формат pdf
  • размер 3.5 МБ
  • добавлен 28 ноября 2009 г.
The increasing popularity and availability of multicore processors is creating a whole new set of challenges--although you can enjoy true concurrency, you're now faced with higher contention and synchronization issues. Deploying an existing application on a multicore processor may bring out previously hidden concurrency issues. Java's multi-threading facility by itself isn't enough---it's a very low level abstraction. Instead, you need a paradigm...