Safe Haskell | None |
---|
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 whereSource
List all field names in a record.
fieldNames :: a -> [String]Source
(SingI Symbol sy, HasFieldNames (Rec ts Identity)) => HasFieldNames (Rec (: * (::: sy t) ts) Identity) | |
HasFieldNames (Rec ([] *) f) |
class HasFieldSizes a whereSource
Compute the size in bytes of of each field in a record.
fieldSizes :: a -> [Int]Source
(HasFieldSizes (Rec ts Identity), Storable t) => HasFieldSizes (Rec (: * (::: sy t) ts) Identity) | |
HasFieldSizes (Rec ([] *) f) |
class HasFieldDims a whereSource
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 (PlainRec ts), Foldable v, Num (v a)) => HasFieldDims (PlainRec (: * (::: sy (v a)) ts)) | |
HasFieldDims (Rec ([] *) f) |