I've been interested in uniqueness types as an alternative to monads in pure functional languages for some time; unfortunately, this is kind of an esoteric area of CS research and online resources about programming with uniqueness types are few and far between. It's obvious how uniqueness types may be used to implement stateful data structures like references ("boxes") and arrays, though it escapes me how you might implement other common stateful data structures with them. Is it possible to implement, for example, locking with unique types? Can uniqueness types be used to share mutable data across threads? Is it possible to use unique types to build synchronization primitives (like mutexes), or is message passing necessary?
Take the 2-minute tour
×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.
|