extensible-sp-0.1.0.0: light-weight, extensible sums and products over types and kinds

Safe HaskellNone
LanguageHaskell2010

Data.Extensible.Product

Synopsis

Documentation

data a :&: b Source #

Constructors

Prod a b 

Instances

(Show b, Show a) => Show ((:&:) a b) Source # 

Methods

showsPrec :: Int -> (a :&: b) -> ShowS #

show :: (a :&: b) -> String #

showList :: [a :&: b] -> ShowS #

ProductClass c a => ProductClass ((:&:) c b) a Source # 

Methods

grab :: (c :&: b) -> a Source #

stash :: a -> (c :&: b) -> c :&: b Source #

ProductClass ((:&:) a b) b Source # 

Methods

grab :: (a :&: b) -> b Source #

stash :: b -> (a :&: b) -> a :&: b Source #

class ProductClass c s where Source #

Extensible product typeclass for type

Minimal complete definition

grab, stash

Methods

grab :: c -> s Source #

stash :: s -> c -> c Source #

Instances

ProductClass a a Source # 

Methods

grab :: a -> a Source #

stash :: a -> a -> a Source #

ProductClass (a, b) b Source # 

Methods

grab :: (a, b) -> b Source #

stash :: b -> (a, b) -> (a, b) Source #

ProductClass (a, b) a Source # 

Methods

grab :: (a, b) -> a Source #

stash :: a -> (a, b) -> (a, b) Source #

ProductClass c a => ProductClass ((:&:) c b) a Source # 

Methods

grab :: (c :&: b) -> a Source #

stash :: a -> (c :&: b) -> c :&: b Source #

ProductClass ((:&:) a b) b Source # 

Methods

grab :: (a :&: b) -> b Source #

stash :: b -> (a :&: b) -> a :&: b Source #

ProductClass (a, b, c) c Source # 

Methods

grab :: (a, b, c) -> c Source #

stash :: c -> (a, b, c) -> (a, b, c) Source #

ProductClass (a, b, c) b Source # 

Methods

grab :: (a, b, c) -> b Source #

stash :: b -> (a, b, c) -> (a, b, c) Source #

ProductClass (a, b, c) a Source # 

Methods

grab :: (a, b, c) -> a Source #

stash :: a -> (a, b, c) -> (a, b, c) Source #

ProductClass (a, b, c, d) d Source # 

Methods

grab :: (a, b, c, d) -> d Source #

stash :: d -> (a, b, c, d) -> (a, b, c, d) Source #

ProductClass (a, b, c, d) c Source # 

Methods

grab :: (a, b, c, d) -> c Source #

stash :: c -> (a, b, c, d) -> (a, b, c, d) Source #

ProductClass (a, b, c, d) b Source # 

Methods

grab :: (a, b, c, d) -> b Source #

stash :: b -> (a, b, c, d) -> (a, b, c, d) Source #

ProductClass (a, b, c, d) a Source # 

Methods

grab :: (a, b, c, d) -> a Source #

stash :: a -> (a, b, c, d) -> (a, b, c, d) Source #

ProductClass (a, b, c, d, e) e Source # 

Methods

grab :: (a, b, c, d, e) -> e Source #

stash :: e -> (a, b, c, d, e) -> (a, b, c, d, e) Source #

ProductClass (a, b, c, d, e) d Source # 

Methods

grab :: (a, b, c, d, e) -> d Source #

stash :: d -> (a, b, c, d, e) -> (a, b, c, d, e) Source #

ProductClass (a, b, c, d, e) c Source # 

Methods

grab :: (a, b, c, d, e) -> c Source #

stash :: c -> (a, b, c, d, e) -> (a, b, c, d, e) Source #

ProductClass (a, b, c, d, e) b Source # 

Methods

grab :: (a, b, c, d, e) -> b Source #

stash :: b -> (a, b, c, d, e) -> (a, b, c, d, e) Source #

ProductClass (a, b, c, d, e) a Source # 

Methods

grab :: (a, b, c, d, e) -> a Source #

stash :: a -> (a, b, c, d, e) -> (a, b, c, d, e) Source #

type (:>&:) c a = ProductClass c a Source #

Short-hand type operator for product class

prodLens :: c :>&: a => Lens' c a Source #

Convenience lens for manipulating product

(<&) :: a -> b -> a :&: b Source #

cons-like operator for products