regular-0.3.4.4: Generic programming library for regular datatypes.

Copyright(c) 2008 Universiteit Utrecht
LicenseBSD3
Maintainergenerics@haskell.org
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell98

Generics.Regular.Functions.LR

Contents

Description

Summary: Generic functionality for regular dataypes: mapM, flatten, zip, equality, show, value generation and fold.

Synopsis

Functions for generating values that are different on top-level

class LRBase a where Source

The LRBase class defines two functions, leftb and rightb, which should produce different values.

Methods

leftb :: a Source

rightb :: a Source

Instances

class LR f where Source

The LR class defines two functions, leftf and rightf, which should produce different functorial values.

Methods

leftf :: a -> f a Source

rightf :: a -> f a Source

Instances

LR U 
LR I 
LRBase a => LR (K a) 
LR f => LR (S s f) 
LR f => LR (C c f) 
(LR f, LR g) => LR ((:*:) f g) 
(LR f, LR g) => LR ((:+:) f g) 

left :: (Regular a, LR (PF a)) => a Source

Produces a value which should be different from the value returned by right.

right :: (Regular a, LR (PF a)) => a Source

Produces a value which should be different from the value returned by left.