| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Drasil.Database.Chunk
Documentation
A piece of reusable knowledge, with an internal identifier (UID),
possibly dependant on other chunks.
type IsChunk a = (HasUID a, HasChunkRefs a) Source #
Constraint for anything that may be considered a valid chunk type.
type TypeableChunk a = (IsChunk a, Typeable a) Source #
Constraint for anything that may be considered a valid chunk type, and is
also Typeable. Type-ability is necessary for storing/retrieving chunks
in/from the ChunkDB.
TypeableChunk is meant to be a purely internal concept; users of Drasil
should only ever need to use IsChunk. Typeable is automatically derived
by GHC, but can cause issues with type inference if used directly in user
code, especially when involving parameterized chunk types.
class HasChunkRefs a where Source #
The majority of chunks will relate other chunks in some way. In other
words, the majority of our chunks *depend* on others. HasChunkRefs is meant
as a way to capture what things a chunk *directly* refers to (i.e., depends
on directly).
Instances
| HasChunkRefs Chunk Source # | |
| HasChunkRefs UID Source # | |
| HasChunkRefs UnitypedUIDRef Source # | |
Defined in Drasil.Database.UIDRef | |
| HasChunkRefs String Source # | |
| HasChunkRefs Integer Source # | |
| HasChunkRefs Bool Source # | |
| HasChunkRefs Char Source # | |
| HasChunkRefs Double Source # | |
| HasChunkRefs Int Source # | |
| (Generic a, GHasCRefs (Rep a)) => HasChunkRefs (Generically a) Source # | |
Defined in Drasil.Database.Chunk | |
| HasChunkRefs (UIDRef t) Source # | |
| HasChunkRefs a => HasChunkRefs (Maybe a) Source # | |
| HasChunkRefs a => HasChunkRefs [a] Source # | |
| (HasChunkRefs l, HasChunkRefs r) => HasChunkRefs (Either l r) Source # | |
mkChunk :: TypeableChunk a => a -> Chunk Source #