free-category-0.0.2.0: Free category

Safe HaskellSafe
LanguageHaskell2010

Control.Arrow.Free

Contents

Synopsis

Free arrow

data Arr f a b where Source #

Constructors

Id :: Arr f a a 
(:.:) :: f b c -> Arr f a b -> Arr f a c 
Arr :: (b -> c) -> Arr f a b -> Arr f a c 
Prod :: Arr f a b -> Arr f a c -> Arr f a (b, c) 
Instances
Arrow (Arr f) Source # 
Instance details

Defined in Control.Arrow.Free

Methods

arr :: (b -> c) -> Arr f b c #

first :: Arr f b c -> Arr f (b, d) (c, d) #

second :: Arr f b c -> Arr f (d, b) (d, c) #

(***) :: Arr f b c -> Arr f b' c' -> Arr f (b, b') (c, c') #

(&&&) :: Arr f b c -> Arr f b c' -> Arr f b (c, c') #

FreeAlgebra2 Arr Source # 
Instance details

Defined in Control.Arrow.Free

Methods

liftFree2 :: AlgebraType0 Arr f => f a b -> Arr f a b #

foldNatFree2 :: (AlgebraType Arr d, AlgebraType0 Arr f) => (forall (x :: k) (y :: k). f x y -> d x y) -> Arr f a b -> d a b #

codom2 :: AlgebraType0 Arr f => Proof (AlgebraType Arr (Arr f)) (Arr f) #

forget2 :: AlgebraType Arr f => Proof (AlgebraType0 Arr f) (Arr f) #

Category (Arr f :: Type -> Type -> Type) Source # 
Instance details

Defined in Control.Arrow.Free

Methods

id :: Arr f a a #

(.) :: Arr f b c -> Arr f a b -> Arr f a c #

type AlgebraType0 Arr (f :: l) Source # 
Instance details

Defined in Control.Arrow.Free

type AlgebraType0 Arr (f :: l) = ()
type AlgebraType Arr (c :: Type -> Type -> Type) Source # 
Instance details

Defined in Control.Arrow.Free

type AlgebraType Arr (c :: Type -> Type -> Type) = Arrow c

Free arrow (CPS style)

newtype A f a b Source #

Constructors

A 

Fields

  • runA :: forall r. Arrow r => (forall x y. f x y -> r x y) -> r a b
     
Instances
Arrow (A f) Source # 
Instance details

Defined in Control.Arrow.Free

Methods

arr :: (b -> c) -> A f b c #

first :: A f b c -> A f (b, d) (c, d) #

second :: A f b c -> A f (d, b) (d, c) #

(***) :: A f b c -> A f b' c' -> A f (b, b') (c, c') #

(&&&) :: A f b c -> A f b c' -> A f b (c, c') #

FreeAlgebra2 A Source # 
Instance details

Defined in Control.Arrow.Free

Methods

liftFree2 :: AlgebraType0 A f => f a b -> A f a b #

foldNatFree2 :: (AlgebraType A d, AlgebraType0 A f) => (forall (x :: k) (y :: k). f x y -> d x y) -> A f a b -> d a b #

codom2 :: AlgebraType0 A f => Proof (AlgebraType A (A f)) (A f) #

forget2 :: AlgebraType A f => Proof (AlgebraType0 A f) (A f) #

Category (A f :: Type -> Type -> Type) Source # 
Instance details

Defined in Control.Arrow.Free

Methods

id :: A f a a #

(.) :: A f b c -> A f a b -> A f a c #

type AlgebraType0 A (f :: l) Source # 
Instance details

Defined in Control.Arrow.Free

type AlgebraType0 A (f :: l) = ()
type AlgebraType A (c :: Type -> Type -> Type) Source # 
Instance details

Defined in Control.Arrow.Free

type AlgebraType A (c :: Type -> Type -> Type) = Arrow c

fromA :: A f a b -> Arr f a b Source #

Inverse of fromA, which also is a specialisatin of hoistFreeH2.

toA :: Arr f a b -> A f a b Source #

Isomorphism from Arr to A, which is a specialisation of hoistFreeH2.

Free interface re-exports

class FreeAlgebra2 (m :: (k -> k -> Type) -> k -> k -> Type) where #

Free algebra similar to FreeAlgebra1 and FreeAlgebra, but for types of kind Type -> Type -> Type. Examples include free categories, free arrows, etc (see 'free-category' package).

Methods

liftFree2 :: AlgebraType0 m f => f a b -> m f a b #

foldNatFree2 :: (AlgebraType m d, AlgebraType0 m f) => (forall (x :: k) (y :: k). f x y -> d x y) -> m f a b -> d a b #

codom2 :: AlgebraType0 m f => Proof (AlgebraType m (m f)) (m f) #

forget2 :: AlgebraType m f => Proof (AlgebraType0 m f) (m f) #

Instances
FreeAlgebra2 (Cat :: (k -> k -> Type) -> k -> k -> Type) Source # 
Instance details

Defined in Control.Category.Free

Methods

liftFree2 :: AlgebraType0 Cat f => f a b -> Cat f a b #

foldNatFree2 :: (AlgebraType Cat d, AlgebraType0 Cat f) => (forall (x :: k0) (y :: k0). f x y -> d x y) -> Cat f a b -> d a b #

codom2 :: AlgebraType0 Cat f => Proof (AlgebraType Cat (Cat f)) (Cat f) #

forget2 :: AlgebraType Cat f => Proof (AlgebraType0 Cat f) (Cat f) #

FreeAlgebra2 (C :: (k -> k -> Type) -> k -> k -> Type) Source # 
Instance details

Defined in Control.Category.Free

Methods

liftFree2 :: AlgebraType0 C f => f a b -> C f a b #

foldNatFree2 :: (AlgebraType C d, AlgebraType0 C f) => (forall (x :: k0) (y :: k0). f x y -> d x y) -> C f a b -> d a b #

codom2 :: AlgebraType0 C f => Proof (AlgebraType C (C f)) (C f) #

forget2 :: AlgebraType C f => Proof (AlgebraType0 C f) (C f) #

Monad m => FreeAlgebra2 (FreeEffCat m :: (k -> k -> Type) -> k -> k -> Type) Source # 
Instance details

Defined in Control.Category.FreeEff

Methods

liftFree2 :: AlgebraType0 (FreeEffCat m) f => f a b -> FreeEffCat m f a b #

foldNatFree2 :: (AlgebraType (FreeEffCat m) d, AlgebraType0 (FreeEffCat m) f) => (forall (x :: k0) (y :: k0). f x y -> d x y) -> FreeEffCat m f a b -> d a b #

codom2 :: AlgebraType0 (FreeEffCat m) f => Proof (AlgebraType (FreeEffCat m) (FreeEffCat m f)) (FreeEffCat m f) #

forget2 :: AlgebraType (FreeEffCat m) f => Proof (AlgebraType0 (FreeEffCat m) f) (FreeEffCat m f) #

FreeAlgebra2 A Source # 
Instance details

Defined in Control.Arrow.Free

Methods

liftFree2 :: AlgebraType0 A f => f a b -> A f a b #

foldNatFree2 :: (AlgebraType A d, AlgebraType0 A f) => (forall (x :: k) (y :: k). f x y -> d x y) -> A f a b -> d a b #

codom2 :: AlgebraType0 A f => Proof (AlgebraType A (A f)) (A f) #

forget2 :: AlgebraType A f => Proof (AlgebraType0 A f) (A f) #

FreeAlgebra2 Arr Source # 
Instance details

Defined in Control.Arrow.Free

Methods

liftFree2 :: AlgebraType0 Arr f => f a b -> Arr f a b #

foldNatFree2 :: (AlgebraType Arr d, AlgebraType0 Arr f) => (forall (x :: k) (y :: k). f x y -> d x y) -> Arr f a b -> d a b #

codom2 :: AlgebraType0 Arr f => Proof (AlgebraType Arr (Arr f)) (Arr f) #

forget2 :: AlgebraType Arr f => Proof (AlgebraType0 Arr f) (Arr f) #

wrapFree2 :: (AlgebraType0 m f, FreeAlgebra2 m, Monad (m f a)) => f a (m f a b) -> m f a b #

foldFree2 :: (FreeAlgebra2 m, AlgebraType m f) => m f a b -> f a b #

hoistFree2 :: (FreeAlgebra2 m, AlgebraType0 m g, AlgebraType0 m f) => (forall (x :: k) (y :: k). f x y -> g x y) -> m f a b -> m g a b #

joinFree2 :: (FreeAlgebra2 m, AlgebraType0 m f) => m (m f) a b -> m f a b #

bindFree2 :: (FreeAlgebra2 m, AlgebraType0 m g, AlgebraType0 m f) => m f a b -> (forall (x :: k) (y :: k). f x y -> m g x y) -> m g a b #