ekmett / ekmett/intern

Possible to recover uninterned value from Id?

Open
#16 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
25
Forks
8
PR merge metrics
No merged PRs in 30d

Description

I would like to only store integer `Id`s for interned identifiers, and then possibly recover the string from the `Id` for pretty-printing.

My use case for using the raw integer `Id` instead of `Interned{String,Text}` is to use negative ids for global variables/constants, and non-negative de Bruijn indices/levels for local variables. Since interned ids are always non-negative, I can use `- internedId - 1` as an identifier for globals.

Is it be possible to retrieve an uninterned value from just the `Id` using this library? I haven't been able to figure out how.

Thanks!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.