Safe Haskell | None |
---|---|
Language | GHC2021 |
weaken
over generic representations.
Documentation
weakenGeneric :: (Generic s, Generic w, GWeaken (Rep s) (Rep w)) => s -> w Source #
Weaken a value generically.
The weak and strong types must be compatible. See Generic
for
the definition of compatibility in this context.
class GWeaken (s :: k -> Type) (w :: k -> Type) where Source #
Instances
GWeaken (U1 :: k -> Type) (U1 :: k -> Type) Source # | Nothing to do for empty constructors. |
GWeaken (V1 :: k -> Type) (V1 :: k -> Type) Source # | Nothing to do for empty datatypes. |
GWeaken (Rec0 s :: k -> Type) (Rec0 s :: k -> Type) Source # | Special case: if source and target types are equal, copy the value through. |
(Weaken s, Weakened s ~ w) => GWeaken (Rec0 s :: k -> Type) (Rec0 w :: k -> Type) Source # | Weaken a field using the existing |
(GWeaken ls lw, GWeaken rs rw) => GWeaken (ls :*: rs :: k -> Type) (lw :*: rw :: k -> Type) Source # | Weaken product types by weakening left and right. |
(GWeaken ls lw, GWeaken rs rw) => GWeaken (ls :+: rs :: k -> Type) (lw :+: rw :: k -> Type) Source # | Weaken sum types by casing and weakening left or right. |
GWeaken s w => GWeaken (M1 is ms s :: k -> Type) (M1 iw mw w :: k -> Type) Source # | Strip all meta. |