| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Drasil.Database.UIDRef
Contents
Synopsis
- data UIDRef (typ :: k)
- hide :: IsChunk t => t -> UIDRef t
- unhide :: TypeableChunk t => UIDRef t -> ChunkDB -> Maybe t
- unhideOrErr :: TypeableChunk t => UIDRef t -> ChunkDB -> t
- raw :: forall {k} (t :: k). UIDRef t -> UID
- data UnitypedUIDRef
- hideUni :: IsChunk t => t -> UnitypedUIDRef
- unhideUni :: TypeableChunk t => UnitypedUIDRef -> ChunkDB -> Maybe t
- unhideUniOrErr :: TypeableChunk t => UnitypedUIDRef -> ChunkDB -> t
- rawUni :: UnitypedUIDRef -> UID
UID References
data UIDRef (typ :: k) Source #
A reference to another chunk through its UID, with a type variable to
retain information about the original chunk's type, useful for type-safe
dereferencing.
unhideOrErr :: TypeableChunk t => UIDRef t -> ChunkDB -> t Source #
Find a chunk by a UIDRef, erroring if not found.
data UnitypedUIDRef Source #
A variant of UIDRef without type information about the chunk being
referred to, effectively treating chunks as being "unityped."
Instances
| HasChunkRefs UnitypedUIDRef Source # | |
Defined in Drasil.Database.UIDRef | |
hideUni :: IsChunk t => t -> UnitypedUIDRef Source #
Create a UnitypedUIDRef to a chunk.
unhideUni :: TypeableChunk t => UnitypedUIDRef -> ChunkDB -> Maybe t Source #
Find a chunk by its UnitypedUIDRef.
unhideUniOrErr :: TypeableChunk t => UnitypedUIDRef -> ChunkDB -> t Source #
Find a chunk by its UnitypedUIDRef, erroring if not found.
rawUni :: UnitypedUIDRef -> UID Source #
Get the raw UID from a UnitypedUIDRef.