generic-data-functions-0.5.1: Familiar functions lifted to generic data types
Safe HaskellSafe-Inferred
LanguageGHC2021

Generic.Data.Wrappers

Description

Wrappers for "free" generics, where the base case is handled for you.

Synopsis
  • data NoRec0 (a :: k)
  • type ENoRec0 = 'Text "Cannot use generic function on NoRec0-wrapped type containing fields"
  • data EmptyRec0 (a :: k)

Documentation

data NoRec0 (a :: k) Source #

Free generic wrapper where any field emits a type error.

Useful for generic functions on void or enum types.

Instances

Instances details
GenericContra (NoRec0 f :: Type) Source #

over types with no fields in any constructor

Instance details

Defined in Generic.Data.Function.Contra.Constructor

Associated Types

type GenericContraF (NoRec0 f) :: Type -> Type Source #

type GenericContraC (NoRec0 f) a Source #

GenericFoldMap (NoRec0 m :: Type) Source #

foldMap over types with no fields in any constructor.

Instance details

Defined in Generic.Data.Function.FoldMap.Constructor

Associated Types

type GenericFoldMapM (NoRec0 m) Source #

type GenericFoldMapC (NoRec0 m) a Source #

GenericTraverse (NoRec0 f :: Type) Source #

traverse over types with no fields in any constructor.

Instance details

Defined in Generic.Data.Function.Traverse.Constructor

Associated Types

type GenericTraverseF (NoRec0 f) :: Type -> Type Source #

type GenericTraverseC (NoRec0 f) a Source #

type GenericContraF (NoRec0 f :: Type) Source # 
Instance details

Defined in Generic.Data.Function.Contra.Constructor

type GenericContraF (NoRec0 f :: Type) = f
type GenericFoldMapM (NoRec0 m :: Type) Source # 
Instance details

Defined in Generic.Data.Function.FoldMap.Constructor

type GenericFoldMapM (NoRec0 m :: Type) = m
type GenericTraverseF (NoRec0 f :: Type) Source # 
Instance details

Defined in Generic.Data.Function.Traverse.Constructor

type GenericTraverseF (NoRec0 f :: Type) = f
type GenericContraC (NoRec0 f :: Type) _1 Source # 
Instance details

Defined in Generic.Data.Function.Contra.Constructor

type GenericFoldMapC (NoRec0 m :: Type) _1 Source # 
Instance details

Defined in Generic.Data.Function.FoldMap.Constructor

type GenericTraverseC (NoRec0 f :: Type) _1 Source # 
Instance details

Defined in Generic.Data.Function.Traverse.Constructor

type ENoRec0 = 'Text "Cannot use generic function on NoRec0-wrapped type containing fields" Source #

data EmptyRec0 (a :: k) Source #

Free generic wrapper where every field does "nothing" (e.g. mempty.)

Maybe useful for testing?

Instances

Instances details
GenericContra (EmptyRec0 f :: Type) Source #

over types where all fields map to mempty

Instance details

Defined in Generic.Data.Function.Contra.Constructor

Associated Types

type GenericContraF (EmptyRec0 f) :: Type -> Type Source #

type GenericContraC (EmptyRec0 f) a Source #

Monoid m => GenericFoldMap (EmptyRec0 m :: Type) Source #

foldMap over types where all fields map to mempty.

Instance details

Defined in Generic.Data.Function.FoldMap.Constructor

Associated Types

type GenericFoldMapM (EmptyRec0 m) Source #

type GenericFoldMapC (EmptyRec0 m) a Source #

GenericTraverse (EmptyRec0 f :: Type) Source #

traverse over types where all fields are replaced with the functor's empty.

Note that one may write a valid instance using a Monoid on as instead. I don't think you should. But I can't explain why.

Instance details

Defined in Generic.Data.Function.Traverse.Constructor

Associated Types

type GenericTraverseF (EmptyRec0 f) :: Type -> Type Source #

type GenericTraverseC (EmptyRec0 f) a Source #

type GenericContraF (EmptyRec0 f :: Type) Source # 
Instance details

Defined in Generic.Data.Function.Contra.Constructor

type GenericContraF (EmptyRec0 f :: Type) = f
type GenericFoldMapM (EmptyRec0 m :: Type) Source # 
Instance details

Defined in Generic.Data.Function.FoldMap.Constructor

type GenericTraverseF (EmptyRec0 f :: Type) Source # 
Instance details

Defined in Generic.Data.Function.Traverse.Constructor

type GenericContraC (EmptyRec0 f :: Type) _1 Source # 
Instance details

Defined in Generic.Data.Function.Contra.Constructor

type GenericFoldMapC (EmptyRec0 m :: Type) _1 Source # 
Instance details

Defined in Generic.Data.Function.FoldMap.Constructor

type GenericFoldMapC (EmptyRec0 m :: Type) _1 = ()
type GenericTraverseC (EmptyRec0 f :: Type) _1 Source # 
Instance details

Defined in Generic.Data.Function.Traverse.Constructor