generics-lift-0.1.0.0: GHC Generics for deriving numeric typeclasses, Monoid, and other similar classes.

Copyright(c) Justin Le 2018
LicenseBSD-3
Maintainerjustin@jle.im
Stabilityunstable
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

GHC.Generics.Lift

Description

Lift polymorphic typeclass over product types using Generics.

This module has two main purposes:

  1. Write methods to lift methods of typeclasses to product types
  2. Write default/automatic instances for your typeclasses so users can auto-derive them

These functions can be used to lift polymorphic functions on any type (deriving Generic) that has a single constructor, where every field is an instance of the class constraint of the function being lifted.

See README for details on usage instructions and motivations.

Documentation

class GLift c f where Source #

Minimal complete definition

glift0, glift1, glift2, glift3

Methods

glift0 :: (forall a. c a => a) -> f p Source #

glift1 :: (forall a. c a => a -> a) -> f p -> f p Source #

glift2 :: (forall a. c a => a -> a -> a) -> f p -> f p -> f p Source #

glift3 :: (forall a. c a => a -> a -> a -> a) -> f p -> f p -> f p -> f p Source #

Instances

GLift c (U1 *) Source # 

Methods

glift0 :: (forall a. c a => a) -> U1 * p Source #

glift1 :: (forall a. c a => a -> a) -> U1 * p -> U1 * p Source #

glift2 :: (forall a. c a => a -> a -> a) -> U1 * p -> U1 * p -> U1 * p Source #

glift3 :: (forall a. c a => a -> a -> a -> a) -> U1 * p -> U1 * p -> U1 * p -> U1 * p Source #

c a => GLift c (K1 * i a) Source # 

Methods

glift0 :: (forall b. c b => b) -> K1 * i a p Source #

glift1 :: (forall b. c b => b -> b) -> K1 * i a p -> K1 * i a p Source #

glift2 :: (forall b. c b => b -> b -> b) -> K1 * i a p -> K1 * i a p -> K1 * i a p Source #

glift3 :: (forall b. c b => b -> b -> b -> b) -> K1 * i a p -> K1 * i a p -> K1 * i a p -> K1 * i a p Source #

(GLift c f, GLift c g) => GLift c ((:*:) * f g) Source # 

Methods

glift0 :: (forall a. c a => a) -> (* :*: f) g p Source #

glift1 :: (forall a. c a => a -> a) -> (* :*: f) g p -> (* :*: f) g p Source #

glift2 :: (forall a. c a => a -> a -> a) -> (* :*: f) g p -> (* :*: f) g p -> (* :*: f) g p Source #

glift3 :: (forall a. c a => a -> a -> a -> a) -> (* :*: f) g p -> (* :*: f) g p -> (* :*: f) g p -> (* :*: f) g p Source #

GLift c f => GLift c (M1 * i d f) Source # 

Methods

glift0 :: (forall a. c a => a) -> M1 * i d f p Source #

glift1 :: (forall a. c a => a -> a) -> M1 * i d f p -> M1 * i d f p Source #

glift2 :: (forall a. c a => a -> a -> a) -> M1 * i d f p -> M1 * i d f p -> M1 * i d f p Source #

glift3 :: (forall a. c a => a -> a -> a -> a) -> M1 * i d f p -> M1 * i d f p -> M1 * i d f p -> M1 * i d f p Source #

genericLift0 :: forall a c. (Generic a, GLift c (Rep a)) => (forall b. c b => b) -> a Source #

genericLift1 :: forall a c. (Generic a, GLift c (Rep a)) => (forall b. c b => b -> b) -> a -> a Source #

genericLift2 :: forall a c. (Generic a, GLift c (Rep a)) => (forall b. c b => b -> b -> b) -> a -> a -> a Source #

genericLift3 :: forall a c. (Generic a, GLift c (Rep a)) => (forall b. c b => b -> b -> b -> b) -> a -> a -> a -> a Source #