generic-data-0.8.1.0: Deriving instances with GHC.Generics and related utilities

Safe HaskellNone
LanguageHaskell2010

Generic.Data.Internal.Utils

Description

Utilities.

Warning

This is an internal module: it is not subject to any versioning policy, breaking changes can happen at any time.

If something here seems useful, please report it or create a pull request to export it from an external module.

Synopsis

Documentation

gcoerce :: (Generic a, Generic b, Coercible (Rep a) (Rep b)) => a -> b Source #

Convert between types with representationally equivalent generic representations.

gcoerceBinop :: (Generic a, Generic b, Coercible (Rep a) (Rep b)) => (a -> a -> a) -> b -> b -> b Source #

Compose gcoerce with a binary operation.

coerce' :: Coercible (f x) (g x) => f x -> g x Source #

Coerce while preserving the type index.

coerce1 :: Coercible f g => f x -> g x Source #

absurd1 :: V1 x -> a Source #

Elimination of V1.

from' :: Generic a => a -> Rep a () Source #

A helper for better type inference.

to' :: Generic a => Rep a () -> a Source #

A helper for better type inference.

liftG2 :: Generic1 f => (Rep1 f a -> Rep1 f b -> Rep1 f c) -> f a -> f b -> f c Source #

Lift binary combinators generically.