Safe Haskell | Unsafe |
---|---|
Language | Haskell2010 |
Categorical.Dual.Example
Description
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
- extract :: f a -> a
- class Coapplicative m => Comonad (m :: Type -> Type) where
- (=>>) :: m a -> m b -> m b -> a
- class Functor t => Distributive (t :: Type -> Type) where
- cotraverse :: forall f a b. Coapplicative f => (f b -> a) -> f (t b) -> t a
- distribute :: Coapplicative f => f (t a) -> t (f a)
- consume :: (Traversable g, Applicative f) => (g b -> a) -> g (f b) -> f a
- type Algebra (f :: Type -> Type) a = f a -> a
- type Coalgebra (f :: Type -> Type) a = a -> f a
- type GAlgebra (w :: Type -> k) (f :: k -> Type) a = f (w a) -> a
- type GCoalgebra (w :: Type -> k) (f :: k -> Type) a = a -> f (w a)
- type ElgotAlgebra (w :: k -> Type) (f :: Type -> k) a = w (f a) -> a
- type ElgotCoalgebra (w :: k -> Type) (f :: Type -> k) 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
- (>^>) :: (a -> b) -> (b -> c) -> a -> c
- (<^<) :: (b -> a) -> (c -> b) -> c -> a
- newtype Mu (f :: Type -> Type) = Mu (forall a. Algebra f a -> a)
- data Nu (f :: Type -> Type) where
- newtype Fix (f :: Type -> Type) = Fix {}
- cata :: Functor f => (f a -> a) -> Fix f -> a
- ana :: Functor f => (a -> f a) -> a -> Fix f
- exampleDuals :: Q DualMappings
- testF :: Char -> Int
- testT :: (Int, Char)
- testV :: (Void, Char)
- testV' :: Either Void Char
- testQ :: forall a b. Either Bool (Char, b -> Int) -> (Int -> a, Char)
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 => Distributive (t :: Type -> Type) where Source #
Methods
cotraverse :: forall f a b. Coapplicative f => (f b -> a) -> f (t b) -> t a Source #
distribute :: 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 :: Type -> k) (f :: k -> Type) a = a -> f (w a) Source #
type ElgotAlgebra (w :: k -> Type) (f :: Type -> k) a = w (f a) -> a Source #
I’m not sure why one or the other happens.
type ElgotCoalgebra (w :: k -> Type) (f :: Type -> k) a = a -> w (f a) Source #
data NewEither' a b Source #
Constructors
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.