product-isomorphic-0.0.3.1: Weaken applicative functor on products

Copyright2017 Kei Hibino
LicenseBSD3
Maintainerex8k.hibino@gmail.com
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Data.Functor.ProductIsomorphic.Class

Contents

Description

This module defines functor interfaces which morphed functions are restricted to products.

Synopsis

ProductIso classes

class ProductIsoFunctor f where #

Restricted functor on products.

Minimal complete definition

(|$|)

Methods

(|$|) :: ProductConstructor (a -> b) => (a -> b) -> f a -> f b infixl 4 #

Instances

Functor f => ProductIsoFunctor (WrappedFunctor f) # 

Methods

(|$|) :: ProductConstructor (a -> b) => (a -> b) -> WrappedFunctor f a -> WrappedFunctor f b #

ProductIsoFunctor (WrappedAlter f a) # 

Methods

(|$|) :: ProductConstructor (a -> b) => (a -> b) -> WrappedAlter f a a -> WrappedAlter f a b #

class ProductIsoFunctor f => ProductIsoApplicative f where #

Restricted applicative functor on products.

Minimal complete definition

pureP, (|*|)

Methods

pureP :: ProductConstructor a => a -> f a #

(|*|) :: f (a -> b) -> f a -> f b infixl 4 #

class ProductIsoApplicative f => ProductIsoAlternative f where #

Restricted alternative on products.

Minimal complete definition

emptyP, (|||)

Methods

emptyP :: f a #

(|||) :: f a -> f a -> f a infixl 3 #

Empty element

class ProductIsoApplicative f => ProductIsoEmpty f e where #

Empty element of product operator

Minimal complete definition

pureE, peRight, peLeft

Methods

pureE :: f e #

peRight :: f (a, e) -> f a #

peLeft :: f (e, a) -> f a #

Instances

Applicative f => ProductIsoEmpty (WrappedFunctor f) () # 

Methods

pureE :: WrappedFunctor f () #

peRight :: WrappedFunctor f (a, ()) -> WrappedFunctor f a #

peLeft :: WrappedFunctor f ((), a) -> WrappedFunctor f a #

Alternative f => ProductIsoEmpty (WrappedAlter f a) () # 

Methods

pureE :: WrappedAlter f a () #

peRight :: WrappedAlter f a (a, ()) -> WrappedAlter f a a #

peLeft :: WrappedAlter f a ((), a) -> WrappedAlter f a a #

peRightR :: ProductIsoEmpty f e => f a -> f (a, e) #

peRight and peRightR should have isomorphic law. peRight . peRightR == peRightR . peRight == id

peLeftR :: ProductIsoEmpty f e => f a -> f (e, a) #

peLeft and peLeftR should have isomorphic law. peLeft . peLeftR == peLeftR . peLeft == id