| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Vinyl.Reflect
Description
Reflection utilities for vinyl records.
- class HasFieldNames a where
- fieldNames :: a -> [String]
- class HasFieldSizes a where
- fieldSizes :: a -> [Int]
- class HasFieldDims a where
Documentation
class HasFieldNames a where Source
List all field names in a record.
Methods
fieldNames :: a -> [String] Source
Instances
| (KnownSymbol sy, HasFieldNames (FieldRec ts)) => HasFieldNames (FieldRec ((:) ((,) Symbol *) ((,) Symbol * sy t) ts)) | |
| HasFieldNames (FieldRec ([] ((,) Symbol *))) |
class HasFieldSizes a where Source
Compute the size in bytes of of each field in a record.
Methods
fieldSizes :: a -> [Int] Source
Instances
| (HasFieldSizes (FieldRec ts), Storable t) => HasFieldSizes (FieldRec ((:) ((,) Symbol *) ((,) Symbol * sy t) ts)) | |
| HasFieldSizes (FieldRec ([] ((,) Symbol *))) |
class HasFieldDims a where Source
Compute the dimensionality of each field in a record. This is primarily useful for things like the small finite vector types provided by Linear.
Instances
| (HasFieldDims (FieldRec ts), Foldable v, Num (v a)) => HasFieldDims (FieldRec ((:) ((,) Symbol *) ((,) Symbol * sy (v a)) ts)) | |
| HasFieldDims (FieldRec ([] ((,) Symbol *))) |