9 research outputs found

    Type Classes for Lightweight Substructural Types

    Full text link
    Linear and substructural types are powerful tools, but adding them to standard functional programming languages often means introducing extra annotations and typing machinery. We propose a lightweight substructural type system design that recasts the structural rules of weakening and contraction as type classes; we demonstrate this design in a prototype language, Clamp. Clamp supports polymorphic substructural types as well as an expressive system of mutable references. At the same time, it adds little additional overhead to a standard Damas-Hindley-Milner type system enriched with type classes. We have established type safety for the core model and implemented a type checker with type inference in Haskell.Comment: In Proceedings LINEARITY 2014, arXiv:1502.0441

    1 The Qubit Quantum Computing and λq

    No full text
    Quantum mechanics is concerned with states in a Hilbert (vector, inner product) space. Consider bits 0 and 1 in a register. These are orthogonal “basis states”. Actual states are superpositions c0|0 〉 + c1|1 〉 where � i |ci | 2 = 1. We call these quantum states “qubits.” Examples: ψ = |0〉 ψ = 1 √ (|0 〉 + |1〉) 2 3 i ψ = |0 〉 − 2 2 |1〉 The squares of the magnitudes values of the coefficients form a probability distribution, which is what we see when we measure the system. What space is generated by |0 〉 and |1〉? C2, but normalized (a Bloch sphere). The |·〉 notation is Dirac’s. It’s nice, but sometimes it helps to think of our space this way

    Practical affine types

    No full text

    Haskell session types with (almost) no class

    No full text

    A theory of substructural types and control

    No full text
    corecore