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

Language | Haskell2010 |

This should be tests, but if you look for the source of this module, you’ll see how to use the package.

## Synopsis

- class Functor f => Coapplicative (f :: Type -> Type) where
- class Coapplicative m => Comonad (m :: Type -> Type) where
- class (Functor t, Functor t) => Distributive (t :: Type -> Type) where
- cotraverse :: forall (f :: Type -> Type) (a :: Type) (b :: Type). Coapplicative f => (f b -> a) -> f (t b) -> t a
- distribute :: forall (f :: Type -> Type) (a :: Type). Coapplicative f => f (t a) -> t (f a)

- consume :: (Traversable g, Applicative f) => (g b -> a) -> g (f b) -> f a
- type Algebra f a = f a -> a
- type Coalgebra f a = a -> f a
- type GAlgebra w f a = f (w a) -> a
- type GCoalgebra w f a = a -> f (w a)
- type ElgotAlgebra w f a = w (f a) -> a
- type ElgotCoalgebra w f a = a -> w (f a)
- newtype NewEither a b = NewEither (Either a b)
- newtype NewTuple a b = NewTuple ((,) a b)
- data NewEither' a b = NewEither' (Either a b)
- data NewTuple' a b = NewTuple' ((,) a b)
- data family TestA a
- data family DualA a
- type family TestB a
- type family DualB a
- type family TestC a where ...
- type family DualC a where ...
- (>^>) :: (a -> b) -> (b -> c) -> a -> c
- (<^<) :: (b -> a) -> (c -> b) -> c -> a
- data Mu f = Mu (forall a. Algebra f a -> a)
- data Nu f where
- data Fix f = Fix {}
- cata :: Functor f => (f a -> a) -> Fix f -> a
- ana :: Functor f => (a -> f a) -> a -> Fix f
- exampleDuals :: Q DualMappings

# Documentation

class Functor f => Coapplicative (f :: Type -> Type) where Source #

This should get mapped to the newly created class … right?

class Coapplicative m => Comonad (m :: Type -> Type) where Source #

This should get mapped to the newly created class … right?

class (Functor t, Functor t) => Distributive (t :: Type -> Type) where Source #

Because `Foldable`

is semi-dual to `Functor`

(which isn’t safe), we end
up with a duplicate `Functor`

constraint here.

cotraverse :: forall (f :: Type -> Type) (a :: Type) (b :: Type). Coapplicative f => (f b -> a) -> f (t b) -> t a Source #

distribute :: forall (f :: Type -> Type) (a :: Type). Coapplicative f => f (t a) -> t (f a) Source #

consume :: (Traversable g, Applicative f) => (g b -> a) -> g (f b) -> f a Source #

type GCoalgebra w f a = a -> f (w a) Source #

type ElgotAlgebra w f a = w (f a) -> a Source #

I’m not sure why one or the other happens.

type ElgotCoalgebra w f a = a -> w (f a) Source #

data NewEither' a b Source #

NewEither' (Either a b) |

(<^<) :: (b -> a) -> (c -> b) -> c -> a Source #

These docs are going to end up on `<^<`

, which is not what I’d expect.

ana :: Functor f => (a -> f a) -> a -> Fix f Source #

Interestingly, the documentation for a dualized function definition is added to the dual, not the explicitly-defined name. I don’t know why this behaves differently than the other cases.

exampleDuals :: Q DualMappings Source #

Duals for this module.