| Copyright | (c) 2010-2011 Patrick Bahr Tom Hvitved | 
|---|---|
| License | BSD3 | 
| Maintainer | Patrick Bahr <paba@diku.dk> | 
| Stability | experimental | 
| Portability | non-portable (GHC Extensions) | 
| Safe Haskell | Safe | 
| Language | Haskell98 | 
Data.Comp.Ops
Description
This module provides operators on functors.
- data (f :+: g) e
 - fromInl :: (f :+: g) e -> Maybe (f e)
 - fromInr :: (f :+: g) e -> Maybe (g e)
 - caseF :: (f a -> b) -> (g a -> b) -> (f :+: g) a -> b
 - type family Elem (f :: * -> *) (g :: * -> *) :: Emb where ...
 - class Subsume e f g where
 - type (:<:) f g = Subsume (ComprEmb (Elem f g)) f g
 - inj :: forall f g a. f :<: g => f a -> g a
 - proj :: forall f g a. f :<: g => g a -> Maybe (f a)
 - type (:=:) f g = (f :<: g, g :<: f)
 - spl :: f :=: (f1 :+: f2) => (f1 a -> b) -> (f2 a -> b) -> f a -> b
 - data (f :*: g) a = (f a) :*: (g a)
 - ffst :: (f :*: g) a -> f a
 - fsnd :: (f :*: g) a -> g a
 - data (f :&: a) e = (f e) :&: a
 - class DistAnn s p s' | s' -> s, s' -> p where
 - class RemA s s' | s -> s' where
 
Documentation
data (f :+: g) e infixr 6 Source #
Formal sum of signatures (functors).
Instances
| DistAnn k s p s' => DistAnn k ((:+:) k f s) p ((:+:) k ((:&:) k f p) s') Source # | |
| RemA k s s' => RemA k ((:+:) k ((:&:) k f p) s) ((:+:) k f s') Source # | |
| (Functor f, Functor g) => Functor ((:+:) * f g) Source # | |
| (Foldable f, Foldable g) => Foldable ((:+:) * f g) Source # | |
| (Traversable f, Traversable g) => Traversable ((:+:) * f g) Source # | |
| (Render f, Render g) => Render ((:+:) * f g) Source # | |
| (HasVars f v0, HasVars g v0) => HasVars ((:+:) * f g) v0 Source # | |
| (Desugar f h, Desugar g h) => Desugar ((:+:) * f g) h Source # | |
caseF :: (f a -> b) -> (g a -> b) -> (f :+: g) a -> b Source #
Utility function to case on a functor sum, without exposing the internal representation of sums.
type (:<:) f g = Subsume (ComprEmb (Elem f g)) f g infixl 5 Source #
A constraint f :<: g expresses that the signature f is
 subsumed by g, i.e. f can be used to construct elements in g.
data (f :*: g) a infixr 8 Source #
Formal product of signatures (functors).
Constructors
| (f a) :*: (g a) infixr 8 | 
data (f :&: a) e infixr 7 Source #
This data type adds a constant product (annotation) to a signature.
Constructors
| (f e) :&: a infixr 7 | 
Instances
| DistAnn k f p ((:&:) k f p) Source # | |
| RemA k ((:&:) k f p) f Source # | |
| DistAnn k s p s' => DistAnn k ((:+:) k f s) p ((:+:) k ((:&:) k f p) s') Source # | |
| RemA k s s' => RemA k ((:+:) k ((:&:) k f p) s) ((:+:) k f s') Source # | |
| Functor f => Functor ((:&:) * f a) Source # | |
| Foldable f => Foldable ((:&:) * f a) Source # | |
| Traversable f => Traversable ((:&:) * f a) Source # | |
| HasVars f v => HasVars ((:&:) * f a) v Source # | |