6 research outputs found

    Effect Capabilities For Haskell

    Get PDF
    International audienceComputational effects complicate the tasks of reasoning about and maintaining software, due to the many kinds of interferences that can occur. While different proposals have been formulated to alleviate the fragility and burden of dealing with specific effects, such as state or exceptions, there is no prevalent robust mechanism that addresses the general interference issue. Build- ing upon the idea of capability-based security, we propose effect capabilities as an effective and flexible manner to control monadic effects and their interfer- ences. Capabilities can be selectively shared between modules to establish secure effect-centric coordination. We further refine capabilities with type-based per- mission lattices to allow fine-grained decomposition of authority. We provide an implementation of effect capabilities in Haskell, using type classes to establish a way to statically share capabilities between modules, as well as to check proper access permissions to effects at compile time. We exemplify how to tame effect interferences using effect capabilities, by treating state and exceptions

    Derivable partial locking for algebraic data types

    Get PDF
    Parallelism and concurrency are one of the most actively researched fields in Computer Science. Writing concurrent programs is challenging because of the need for synchronization and solving possible race conditions and deadlocks while avoiding unnecessary waiting and overhead. The integrity of the program data can be archived by providing locks for its data structures or using concurrent data structures. Partial locking allows threads to lock exactly those parts of the global data they need to read or update. This article presents a method that helps the implementation of threadsafe programs with Algebraic Data Types [1], By transforming the data model of the application to thread-safe data structures with a built-in, configurable locking mechanism including partial locking. With this support, the programmer can focus on the business logic of his application when writing the program. As part of this article, we prove that the shared version of the calculation will produce the same result as the original one

    Effect Capabilities For Haskell

    Get PDF
    International audienceComputational effects complicate the tasks of reasoning about and maintaining software, due to the many kinds of interferences that can occur. While different proposals have been formulated to alleviate the fragility and burden of dealing with specific effects, such as state or exceptions, there is no prevalent robust mechanism that addresses the general interference issue. Build- ing upon the idea of capability-based security, we propose effect capabilities as an effective and flexible manner to control monadic effects and their interfer- ences. Capabilities can be selectively shared between modules to establish secure effect-centric coordination. We further refine capabilities with type-based per- mission lattices to allow fine-grained decomposition of authority. We provide an implementation of effect capabilities in Haskell, using type classes to establish a way to statically share capabilities between modules, as well as to check proper access permissions to effects at compile time. We exemplify how to tame effect interferences using effect capabilities, by treating state and exceptions

    From dynamic binding to state via modal possibility

    Full text link
    In this paper we propose a typed, purely functional calculus for state (with second-class locations) in which types reflect the dichotomy between reading from and writing into the global store. This is in contrast to the usual formulation of state via monads, where the primitives for reading and writing introduce the same monadic type constructor. We hope to argue that making this distinction is useful, simple, and has strong logical foundations. Our type system is based on the proof-term calculus for constructive modal logic S4, which has two modal type operators: for neces-sity and 3 for possibility. We extend this calculus with the notion of names (which stand for locations) and generalize to indexed fami-lies of modal operators (indexed by sets of names). Then, the modal type CA classifies computations of type A which read from store locations listed in the set C. The dual type 3CA classifies compu-tations which first write into the locations from C and than use the changed store to obtain a value of type A. There are several benefits to this development. First, the necessita-tion fragment of the language is interesting in its own: it formulates a calculus of dynamic binding. Second, the possibility operator 3 is a monad, thus forcing the single-threading of memory writes, but not of memory reads (as these are associated with ). Finally, the different status of reads and writes gives rise to a natural way of expressing the allocation of uninitialized memory while also pro-viding guarantees that only initialized locations are dereferenced

    Global variables in Haskell

    No full text
    corecore