interior

Package Version Hex Docs Erlang-compatible JavaScript-compatible

👺 Interior mutability in Gleam.

⚠️ Disclaimer

Types in Gleam are immutable for a reason! As such, you should use immutable data structures whenever possible.

Don’t use this library to shortcut structuring your code and APIs in a functional way that embraces immutability!

That being said, there are some scenarios where it can be handy to have shared mutable state, and in those situations this library provides a target-agnostic way for achieving interior mutability.

Search Document