Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

## Synopsis

- data Arr f a b where
- newtype A f a b = A {}
- fromA :: A f a b -> Arr f a b
- toA :: Arr f a b -> A f a b
- class FreeAlgebra2 (m :: (k -> k -> Type) -> k -> k -> Type) where
- 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)

- 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

# Free arrow

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 # | |

FreeAlgebra2 Arr Source # | |

Defined in Control.Arrow.Free 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 # | |

type AlgebraType0 Arr (f :: l) Source # | |

Defined in Control.Arrow.Free | |

type AlgebraType Arr (c :: Type -> Type -> Type) Source # | |

Defined in Control.Arrow.Free |

# Free arrow (CPS style)

## Instances

Arrow (A f) Source # | |

FreeAlgebra2 A Source # | |

Defined in Control.Arrow.Free 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 # | |

type AlgebraType0 A (f :: l) Source # | |

Defined in Control.Arrow.Free | |

type AlgebraType A (c :: Type -> Type -> Type) Source # | |

Defined in Control.Arrow.Free |

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

Inverse of

, which also is a specialisatin of `fromA`

.`hoistFreeH2`

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

Isomorphism from

to `Arr`

, which is a specialisation of
`A`

.`hoistFreeH2`

# Free interface re-exports

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

Free algebra similar to

and `FreeAlgebra1`

, but for types
of kind `FreeAlgebra`

`Type -> Type -> Type`

. Examples include free categories, free
arrows, etc (see 'free-category' package).

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

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 #