Safe Haskell | None |
---|---|
Language | Haskell2010 |
- cast :: (IsRecord a ra, IsRecord b rb, IsSubTypeOf ra rb) => a -> b
- class IsSubTypeOf r1 r2
- class IsElemOf s a r
Documentation
cast :: (IsRecord a ra, IsRecord b rb, IsSubTypeOf ra rb) => a -> b Source #
Cast one record type to another if there is a subtype relationship between them. Currently, only width subtyping is considered, which means that we can forget and reorder fields.
class IsSubTypeOf r1 r2 Source #
Class that checks whether one record code is convertible into another.
Conversion works if the first record contains at least the labels of the second record, and if the types of the corresponding fields match exactly.
castRecord
IsSubTypeOf r1 ([] (FieldLabel, Type)) Source # | |
(IsSubTypeOf r1 r2, IsElemOf s2 a2 r1) => IsSubTypeOf r1 ((:) (Symbol, Type) ((,) Symbol Type s2 a2) r2) Source # | |