Skip to content

Swift implementation of general-purpose interners for every use case

License

Notifications You must be signed in to change notification settings

regexident/Interner

Repository files navigation

Interner

Fast general-purpose interners for every use case

Interners take complex values and map them to trivially-comparable stand-ins that can later be resolved back to their source values. Interners are often found in software like parsers, language interpreters, and compilers; they can be used whenever a given algorithm compares its inputs by identity only.

Examples

import Interner

let interner = Interner<String>()

let string = "Hello"
let symbol = interner.interned(string)
let resolved = interner.lookup(symbol)

XCTAssert(resolved == string)

License

This project is licensed under the MPL-2.0 – see the LICENSE.md file for details.

About

Swift implementation of general-purpose interners for every use case

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages