drasil-database-0.1.1.0: A framework for code and document generation for scientific software - Database SubPackage
Safe HaskellSafe-Inferred
LanguageHaskell2010

Drasil.Database.UIDRef

Synopsis

UID References

data UIDRef typ 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.

Instances

Instances details
HasChunkRefs (UIDRef t) Source # 
Instance details

Defined in Drasil.Database.UIDRef

Methods

chunkRefs :: UIDRef t -> Set UID Source #

hide :: IsChunk t => t -> UIDRef t Source #

Create a UIDRef to a chunk.

unhide :: IsChunk t => UIDRef t -> ChunkDB -> Maybe t Source #

Find a chunk by a UIDRef.

unhideOrErr :: IsChunk 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

Instances details
HasChunkRefs UnitypedUIDRef Source # 
Instance details

Defined in Drasil.Database.UIDRef

hideUni :: IsChunk t => t -> UnitypedUIDRef Source #

Create a UnitypedUIDRef to a chunk.

unhideUni :: IsChunk t => UnitypedUIDRef -> ChunkDB -> Maybe t Source #

Find a chunk by its UnitypedUIDRef.

unhideUniOrErr :: IsChunk t => UnitypedUIDRef -> ChunkDB -> t Source #

Find a chunk by its UnitypedUIDRef, erroring if not found.