Lisp and Symbolic Computation - Special issue on state in programming languages (part I)
Region-based memory management
Information and Computation
Monadic state: axiomatization and type safety
ICFP '97 Proceedings of the second ACM SIGPLAN international conference on Functional programming
Proceedings of the 26th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Typed memory management via static capabilities
ACM Transactions on Programming Languages and Systems (TOPLAS)
POPL '02 Proceedings of the 29th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Region-based memory management in cyclone
PLDI '02 Proceedings of the ACM SIGPLAN 2002 Conference on Programming language design and implementation
Extending Typestate Checking Using Conditional Liveness Analysis
IEEE Transactions on Software Engineering
Nominal logic, a first order theory of names and binding
Information and Computation - TACS 2001
Monadic encapsulation of effects: a revised approach (extended version)
Journal of Functional Programming
Proceedings of the ninth ACM SIGPLAN international conference on Functional programming
Strongly typed heterogeneous collections
Haskell '04 Proceedings of the 2004 ACM SIGPLAN workshop on Haskell
A proof theory for generic judgments
ACM Transactions on Computational Logic (TOCL)
Linear regions are all you need
ESOP'06 Proceedings of the 15th European conference on Programming Languages and Systems
Parameterised notions of computation
MSFP'06 Proceedings of the 2006 international conference on Mathematically Structured Functional Programming
Lightweight linear types in system f°
Proceedings of the 5th ACM SIGPLAN workshop on Types in language design and implementation
Proceedings of the 15th ACM SIGPLAN international conference on Functional programming
Hi-index | 0.00 |
We present Haskell libraries that statically ensure the safe use of resources such as file handles. We statically prevent accessing an already closed handle or forgetting to close it. The libraries can be trivially extended to other resources such as database connections and graphic contexts. Because file handles and similar resources are scarce, we want to not just assure their safe use but further deallocate them soon after they are no longer needed. Relying on Fluet and Morrisett's [4] calculus of nested regions, we contribute a novel, improved, and extended implementation of the calculus in Haskell, with file handles as resources. Our library supports region polymorphism and implicit region subtyping, along with higher-order functions, mutable state, recursion, and run-time exceptions. A program may allocate arbitrarily many resources and dispose of them in any order, not necessarily LIFO. Region annotations are part of an expression's inferred type. Our new Haskell encoding of monadic regions as monad transformers needs no witness terms. It assures timely deallocation even when resources have markedly different lifetimes and the identity of the longest-living resource is determined only dynamically. For contrast, we also implement a Haskell library for manual resource management, where deallocation is explicit and safety is assured by a form of linear types. We implement the linear typing in Haskell with the help of phantom types and a parameterized monad to statically track the type-state of resources.