Safe Haskell | None |
---|
HLearn.Algebra.Types.Indexing
- class (Eq (IndexType datatype), Bounded (IndexType datatype), Enum (IndexType datatype)) => Index datatype where
- type IndexType datatype
- type IndexResult datatype
- (!) :: datatype -> IndexType datatype -> IndexResult datatype
- class DepIndex datatype index where
- type DepIndexResult datatype index
- (#) :: datatype -> index -> datatype `DepIndexResult` index
- class IndexList datatype (HList (DepIndexList datatype)) => HasDepIndex datatype where
- type DepIndexList datatype :: [*]
- depIndexList :: datatype -> HList (DepIndexList datatype)
- datatype2valueList :: HasDepIndex datatype => datatype -> HList (ValueList datatype)
- type ValueList datatype = IndexList2ValueList datatype (HList (DepIndexList datatype))
- makeIndex :: Name -> Q [Dec]
- data TH_0
- data TH_1
- data TH_2
- data TH_3
Documentation
class (Eq (IndexType datatype), Bounded (IndexType datatype), Enum (IndexType datatype)) => Index datatype whereSource
index into a data type, all of whose members have the same type
Methods
(!) :: datatype -> IndexType datatype -> IndexResult datatypeSource
class DepIndex datatype index whereSource
index into a data type, but the result type depends on which record we're indexing
Associated Types
type DepIndexResult datatype index Source
Methods
(#) :: datatype -> index -> datatype `DepIndexResult` indexSource
class IndexList datatype (HList (DepIndexList datatype)) => HasDepIndex datatype whereSource
defines a canonical ordering of all elments in the data type
Associated Types
type DepIndexList datatype :: [*]Source
Methods
depIndexList :: datatype -> HList (DepIndexList datatype)Source
datatype2valueList :: HasDepIndex datatype => datatype -> HList (ValueList datatype)Source
type ValueList datatype = IndexList2ValueList datatype (HList (DepIndexList datatype))Source
template haskell
makeIndex :: Name -> Q [Dec]Source
Creates data types and instances for indexing into a class. Dependent indices are preficed with "TH_" and normal indices by "I_". The dependent indices and DepIndex instances are always created. The normal index data types are always created, but the Index instance is created only if all records within the data type have the same type.