calamity-0.3.0.0: A library for writing discord bots in haskell
Safe HaskellNone
LanguageHaskell2010

Calamity.Internal.ShapeCoerce

Description

Something to coerce between two records with the same field names and compatible field types

Documentation

shapeCoerce :: (Generic a, Generic b, GShapeCoerce (Rep a) (Rep b)) => a -> b Source #

type ShapeCoerce a b = (Generic a, Generic b, GShapeCoerce (Rep a) (Rep b)) Source #

class GShapeCoerce f g where Source #

Methods

gshapeCoerce :: f a -> g b Source #

Instances

Instances details
Coercible a b => GShapeCoerce (Rec0 a :: k1 -> Type) (Rec0 b :: k2 -> Type) Source # 
Instance details

Defined in Calamity.Internal.ShapeCoerce

Methods

gshapeCoerce :: forall (a0 :: k) (b0 :: k). Rec0 a a0 -> Rec0 b b0 Source #

GShapeCoerce f g => GShapeCoerce (S1 ('MetaSel ('Nothing :: Maybe Symbol) fsu fss fl) f :: k1 -> Type) (S1 ('MetaSel ('Nothing :: Maybe Symbol) gsu gss gl) g :: k2 -> Type) Source # 
Instance details

Defined in Calamity.Internal.ShapeCoerce

Methods

gshapeCoerce :: forall (a :: k) (b :: k). S1 ('MetaSel 'Nothing fsu fss fl) f a -> S1 ('MetaSel 'Nothing gsu gss gl) g b Source #

GShapeCoerce f g => GShapeCoerce (S1 ('MetaSel ('Just name) fsu fss fl) f :: k1 -> Type) (S1 ('MetaSel ('Just name') gsu gss gl) g :: k2 -> Type) Source # 
Instance details

Defined in Calamity.Internal.ShapeCoerce

Methods

gshapeCoerce :: forall (a :: k) (b :: k). S1 ('MetaSel ('Just name) fsu fss fl) f a -> S1 ('MetaSel ('Just name') gsu gss gl) g b Source #

(GShapeCoerce fa ga, GShapeCoerce fb gb) => GShapeCoerce (fa :*: fb :: k1 -> Type) (ga :*: gb :: k2 -> Type) Source # 
Instance details

Defined in Calamity.Internal.ShapeCoerce

Methods

gshapeCoerce :: forall (a :: k) (b :: k). (fa :*: fb) a -> (ga :*: gb) b Source #

GShapeCoerce f g => GShapeCoerce (M1 C da f :: k1 -> Type) (M1 C db g :: k2 -> Type) Source # 
Instance details

Defined in Calamity.Internal.ShapeCoerce

Methods

gshapeCoerce :: forall (a :: k) (b :: k). M1 C da f a -> M1 C db g b Source #

GShapeCoerce f g => GShapeCoerce (M1 D da f :: k1 -> Type) (M1 D db g :: k2 -> Type) Source # 
Instance details

Defined in Calamity.Internal.ShapeCoerce

Methods

gshapeCoerce :: forall (a :: k) (b :: k). M1 D da f a -> M1 D db g b Source #