Safe Haskell | None |
---|---|
Language | Haskell2010 |
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.
fieldNames :: a -> [String] Source
(KnownSymbol sy, HasFieldNames (PlainFieldRec ts)) => HasFieldNames (PlainFieldRec ((:) * ((:::) Symbol sy t) ts)) | |
HasFieldNames (FieldRec f ([] *)) |
class HasFieldSizes a where Source
Compute the size in bytes of of each field in a record.
fieldSizes :: a -> [Int] Source
(HasFieldSizes (PlainFieldRec ts), Storable t) => HasFieldSizes (PlainFieldRec ((:) * ((:::) Symbol sy t) ts)) | |
HasFieldSizes (FieldRec f ([] *)) |
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.
(HasFieldDims (PlainFieldRec ts), Foldable v, Num (v a)) => HasFieldDims (PlainFieldRec ((:) * ((:::) Symbol sy (v a)) ts)) | |
HasFieldDims (FieldRec f ([] *)) |