Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- multimapI :: forall arr x y. MultimapI arr x y => arr -> x -> y
- multitraverse :: forall f arr x y. Multitraverse f arr x y => arr -> x -> f y
- multifold_ :: forall m arr x y. Multifold_ m arr x y => arr -> Fold m x y
- multimapOf :: forall cat arr x y. MultimapOf cat arr x y => arr -> cat x y
- class MultimapOf (->) arr x y => MultimapI arr x y
- class MultimapOf (Fold m) arr x y => Multifold_ m arr x y
- class Multitraverse_ f arr x y => Multitraverse f arr x y
- type Multitraverse_ f arr x y = (MultimapOf (Kleisli f) (WrapKleisli f arr) x y, CoercibleKleisli f (WrapKleisli f arr) arr)
- type family WrapKleisli (f :: Type -> Type) (arr :: Type)
- class Coercible warr arr => CoercibleKleisli (f :: Type -> Type) warr arr
- class Multimap_ cat (S2 arr) x y => MultimapOf cat arr x y
- newtype Fold m x y = Fold {
- unFold :: x -> m
- class CatLike cat where
- catid :: cat x x
- class FunctorOf cat t where
- catmap :: cat a b -> cat (t a) (t b)
- class BifunctorOf cat t where
- catbimap :: cat a b -> cat c d -> cat (t a c) (t b d)
- class Multimap_ cat arr x y where
- multimap_ :: arr -> cat x y
- data a :+ b = a :+ b
- data Rule rule mode = Rule rule mode
- data AnyId = AnyId
- data AnyFunctor = AnyFunctor
- data AnyBifunctor = AnyBifunctor
- data NilArr = NilArr
- data Incoherent = Incoherent
- type Default mode arr = arr :+ (Rule AnyId mode :+ (Rule AnyFunctor mode :+ (Rule AnyBifunctor mode :+ NilArr)))
- defaultIncoherent :: arr -> Default Incoherent arr
- def :: mode -> arr -> Default mode arr
- data S arr arr' = S arr arr'
- type S2 arr = S arr arr
- s2 :: arr -> S2 arr
Documentation
multitraverse :: forall f arr x y. Multitraverse f arr x y => arr -> x -> f y Source #
multifold_ :: forall m arr x y. Multifold_ m arr x y => arr -> Fold m x y Source #
This is kept internal because of the Fold
wrapping.
multimapOf :: forall cat arr x y. MultimapOf cat arr x y => arr -> cat x y Source #
class MultimapOf (->) arr x y => MultimapI arr x y Source #
Core of multimap
.
Instances
MultimapOf (->) arr x y => MultimapI arr x y Source # | |
Defined in Generic.Functor.Internal.Implicit |
class MultimapOf (Fold m) arr x y => Multifold_ m arr x y Source #
Constraint for multifold_
.
Instances
MultimapOf (Fold m) arr x y => Multifold_ m arr x y Source # | |
Defined in Generic.Functor.Internal.Implicit |
class Multitraverse_ f arr x y => Multitraverse f arr x y Source #
Constraint for multitraverse
.
Instances
Multitraverse_ f arr x y => Multitraverse f arr x y Source # | |
Defined in Generic.Functor.Internal.Implicit |
type Multitraverse_ f arr x y = (MultimapOf (Kleisli f) (WrapKleisli f arr) x y, CoercibleKleisli f (WrapKleisli f arr) arr) Source #
Internal definition of Multitraverse
type family WrapKleisli (f :: Type -> Type) (arr :: Type) Source #
Instances
type WrapKleisli _f NilArr Source # | |
Defined in Generic.Functor.Internal.Implicit | |
type WrapKleisli _f (Rule rule mode) Source # | |
Defined in Generic.Functor.Internal.Implicit | |
type WrapKleisli f (a :+ arr) Source # | |
Defined in Generic.Functor.Internal.Implicit | |
type WrapKleisli f (a -> f b) Source # | |
Defined in Generic.Functor.Internal.Implicit |
class Coercible warr arr => CoercibleKleisli (f :: Type -> Type) warr arr Source #
Auxiliary constraint for Multitraverse
Instances
d ~ NilArr => CoercibleKleisli f d NilArr Source # | |
Defined in Generic.Functor.Internal.Implicit | |
(b2 ~ f c, a ~ Kleisli f b1 c) => CoercibleKleisli f a (b1 -> b2) Source # | |
Defined in Generic.Functor.Internal.Implicit | |
d ~ Rule rule mode => CoercibleKleisli f d (Rule rule mode) Source # | |
Defined in Generic.Functor.Internal.Implicit | |
(CoercibleKleisli f a b, CoercibleKleisli f arr arr') => CoercibleKleisli f (a :+ arr) (b :+ arr') Source # | |
Defined in Generic.Functor.Internal.Implicit |
class Multimap_ cat (S2 arr) x y => MultimapOf cat arr x y Source #
Instances
Multimap_ cat (S2 arr) x y => MultimapOf cat arr x y Source # | |
Defined in Generic.Functor.Internal.Implicit |
Fold m
is like Kleisli (Const m)
, but it has a different FunctorOf
instance,
with Foldable
instead of Traversable
.
Internal
class CatLike cat where Source #
Instances
Applicative f => CatLike (Kleisli f) Source # | |
Defined in Generic.Functor.Internal.Implicit | |
Monoid m => CatLike (Fold m) Source # | |
Defined in Generic.Functor.Internal.Implicit | |
CatLike (->) Source # | |
Defined in Generic.Functor.Internal.Implicit |
class BifunctorOf cat t where Source #
Instances
(Applicative f, Bitraversable t) => BifunctorOf (Kleisli f) t Source # | |
(Bifoldable t, Monoid m) => BifunctorOf (Fold m) t Source # | |
Bifunctor t => BifunctorOf (->) t Source # | |
Defined in Generic.Functor.Internal.Implicit |
class Multimap_ cat arr x y where Source #
Internal implementation of MultimapOf
.
Instances
Multimap_ cat (S arr (arr0 :+ (arr1 :+ arr2))) x y => Multimap_ cat (S arr ((arr0 :+ arr1) :+ arr2)) x y Source # | |
Multimap_ cat (S arr arr') x y => Multimap_ cat (S arr (NilArr :+ arr')) x y Source # | |
CatLike cat => Multimap_ cat (S arr (Rule AnyId Incoherent :+ arr')) x x Source # | |
Defined in Generic.Functor.Internal.Implicit | |
Multimap_ cat (S arr arr') x y => Multimap_ cat (S arr (() :+ arr')) x y Source # | |
Multimap_ cat (S arr arr') x y => Multimap_ cat (S arr (arr0 :+ arr')) x y Source # | |
Multimap_ cat (S arr (cat a b :+ arr')) a b Source # | |
(FunctorOf cat f, MultimapOf cat arr x y) => Multimap_ cat (S arr (Rule AnyFunctor Incoherent :+ arr')) (f x) (f y) Source # | |
Defined in Generic.Functor.Internal.Implicit multimap_ :: S arr (Rule AnyFunctor Incoherent :+ arr') -> cat (f x) (f y) Source # | |
(BifunctorOf cat f, MultimapOf cat arr x1 y1, MultimapOf cat arr x2 y2) => Multimap_ cat (S arr (Rule AnyBifunctor Incoherent :+ arr')) (f x1 x2) (f y1 y2) Source # | |
Defined in Generic.Functor.Internal.Implicit multimap_ :: S arr (Rule AnyBifunctor Incoherent :+ arr') -> cat (f x1 x2) (f y1 y2) Source # | |
(MultimapOf (->) arr y1 x1, MultimapOf (->) arr x2 y2) => Multimap_ (->) (S arr (Rule AnyBifunctor Incoherent :+ arr')) (x1 -> x2) (y1 -> y2) Source # | |
Defined in Generic.Functor.Internal.Implicit multimap_ :: S arr (Rule AnyBifunctor Incoherent :+ arr') -> (x1 -> x2) -> (y1 -> y2) Source # |
Heterogeneous lists of arrows are constructed as lists separated by
(
and terminated by :+
)()
.
Example
Given f :: a -> a'
and g :: b -> b'
,
(f
is a list with the two elements :+
g :+
())f
and g
.
if f :: a -> a' g :: b -> b' then f:+
g:+
() :: (a -> a'):+
(b -> b'):+
()
Those lists are used by gmultimap
and multimap
.
bimap_ :: (a -> a') -> (b -> b') -> (Maybe a, [Either b a]) -> (Maybe a', [Either b' a']) bimap_ f g =multimap
(f:+
g:+
())
a :+ b infixr 1 |
Instances
Multimap_ cat (S arr (arr0 :+ (arr1 :+ arr2))) x y => Multimap_ cat (S arr ((arr0 :+ arr1) :+ arr2)) x y Source # | |
Multimap_ cat (S arr arr') x y => Multimap_ cat (S arr (NilArr :+ arr')) x y Source # | |
CatLike cat => Multimap_ cat (S arr (Rule AnyId Incoherent :+ arr')) x x Source # | |
Defined in Generic.Functor.Internal.Implicit | |
Multimap_ cat (S arr arr') x y => Multimap_ cat (S arr (() :+ arr')) x y Source # | |
Multimap_ cat (S arr arr') x y => Multimap_ cat (S arr (arr0 :+ arr')) x y Source # | |
Multimap_ cat (S arr (cat a b :+ arr')) a b Source # | |
(FunctorOf cat f, MultimapOf cat arr x y) => Multimap_ cat (S arr (Rule AnyFunctor Incoherent :+ arr')) (f x) (f y) Source # | |
Defined in Generic.Functor.Internal.Implicit multimap_ :: S arr (Rule AnyFunctor Incoherent :+ arr') -> cat (f x) (f y) Source # | |
(CoercibleKleisli f a b, CoercibleKleisli f arr arr') => CoercibleKleisli f (a :+ arr) (b :+ arr') Source # | |
Defined in Generic.Functor.Internal.Implicit | |
(BifunctorOf cat f, MultimapOf cat arr x1 y1, MultimapOf cat arr x2 y2) => Multimap_ cat (S arr (Rule AnyBifunctor Incoherent :+ arr')) (f x1 x2) (f y1 y2) Source # | |
Defined in Generic.Functor.Internal.Implicit multimap_ :: S arr (Rule AnyBifunctor Incoherent :+ arr') -> cat (f x1 x2) (f y1 y2) Source # | |
(MultimapOf (->) arr y1 x1, MultimapOf (->) arr x2 y2) => Multimap_ (->) (S arr (Rule AnyBifunctor Incoherent :+ arr')) (x1 -> x2) (y1 -> y2) Source # | |
Defined in Generic.Functor.Internal.Implicit multimap_ :: S arr (Rule AnyBifunctor Incoherent :+ arr') -> (x1 -> x2) -> (y1 -> y2) Source # | |
type WrapKleisli f (a :+ arr) Source # | |
Defined in Generic.Functor.Internal.Implicit |
Rule rule mode |
Instances
data AnyFunctor Source #
Instances
(FunctorOf cat f, MultimapOf cat arr x y) => Multimap_ cat (S arr (Rule AnyFunctor Incoherent :+ arr')) (f x) (f y) Source # | |
Defined in Generic.Functor.Internal.Implicit multimap_ :: S arr (Rule AnyFunctor Incoherent :+ arr') -> cat (f x) (f y) Source # |
data AnyBifunctor Source #
Instances
(BifunctorOf cat f, MultimapOf cat arr x1 y1, MultimapOf cat arr x2 y2) => Multimap_ cat (S arr (Rule AnyBifunctor Incoherent :+ arr')) (f x1 x2) (f y1 y2) Source # | |
Defined in Generic.Functor.Internal.Implicit multimap_ :: S arr (Rule AnyBifunctor Incoherent :+ arr') -> cat (f x1 x2) (f y1 y2) Source # | |
(MultimapOf (->) arr y1 x1, MultimapOf (->) arr x2 y2) => Multimap_ (->) (S arr (Rule AnyBifunctor Incoherent :+ arr')) (x1 -> x2) (y1 -> y2) Source # | |
Defined in Generic.Functor.Internal.Implicit multimap_ :: S arr (Rule AnyBifunctor Incoherent :+ arr') -> (x1 -> x2) -> (y1 -> y2) Source # |
Instances
d ~ NilArr => CoercibleKleisli f d NilArr Source # | |
Defined in Generic.Functor.Internal.Implicit | |
Multimap_ cat (S arr arr') x y => Multimap_ cat (S arr (NilArr :+ arr')) x y Source # | |
type WrapKleisli _f NilArr Source # | |
Defined in Generic.Functor.Internal.Implicit |
data Incoherent Source #
Instances
CatLike cat => Multimap_ cat (S arr (Rule AnyId Incoherent :+ arr')) x x Source # | |
Defined in Generic.Functor.Internal.Implicit | |
(FunctorOf cat f, MultimapOf cat arr x y) => Multimap_ cat (S arr (Rule AnyFunctor Incoherent :+ arr')) (f x) (f y) Source # | |
Defined in Generic.Functor.Internal.Implicit multimap_ :: S arr (Rule AnyFunctor Incoherent :+ arr') -> cat (f x) (f y) Source # | |
(BifunctorOf cat f, MultimapOf cat arr x1 y1, MultimapOf cat arr x2 y2) => Multimap_ cat (S arr (Rule AnyBifunctor Incoherent :+ arr')) (f x1 x2) (f y1 y2) Source # | |
Defined in Generic.Functor.Internal.Implicit multimap_ :: S arr (Rule AnyBifunctor Incoherent :+ arr') -> cat (f x1 x2) (f y1 y2) Source # | |
(MultimapOf (->) arr y1 x1, MultimapOf (->) arr x2 y2) => Multimap_ (->) (S arr (Rule AnyBifunctor Incoherent :+ arr')) (x1 -> x2) (y1 -> y2) Source # | |
Defined in Generic.Functor.Internal.Implicit multimap_ :: S arr (Rule AnyBifunctor Incoherent :+ arr') -> (x1 -> x2) -> (y1 -> y2) Source # |
type Default mode arr = arr :+ (Rule AnyId mode :+ (Rule AnyFunctor mode :+ (Rule AnyBifunctor mode :+ NilArr))) Source #
defaultIncoherent :: arr -> Default Incoherent arr Source #
arr
is the list of arrows provided by the user. It is constant.
When testing whether any arrow matches, arr'
is the remaining list of
arrows to be tested.
S arr arr' |
Instances
Multimap_ cat (S arr (arr0 :+ (arr1 :+ arr2))) x y => Multimap_ cat (S arr ((arr0 :+ arr1) :+ arr2)) x y Source # | |
Multimap_ cat (S arr arr') x y => Multimap_ cat (S arr (NilArr :+ arr')) x y Source # | |
CatLike cat => Multimap_ cat (S arr (Rule AnyId Incoherent :+ arr')) x x Source # | |
Defined in Generic.Functor.Internal.Implicit | |
Multimap_ cat (S arr arr') x y => Multimap_ cat (S arr (() :+ arr')) x y Source # | |
Multimap_ cat (S arr arr') x y => Multimap_ cat (S arr (arr0 :+ arr')) x y Source # | |
Multimap_ cat (S arr (cat a b :+ arr')) a b Source # | |
(FunctorOf cat f, MultimapOf cat arr x y) => Multimap_ cat (S arr (Rule AnyFunctor Incoherent :+ arr')) (f x) (f y) Source # | |
Defined in Generic.Functor.Internal.Implicit multimap_ :: S arr (Rule AnyFunctor Incoherent :+ arr') -> cat (f x) (f y) Source # | |
(BifunctorOf cat f, MultimapOf cat arr x1 y1, MultimapOf cat arr x2 y2) => Multimap_ cat (S arr (Rule AnyBifunctor Incoherent :+ arr')) (f x1 x2) (f y1 y2) Source # | |
Defined in Generic.Functor.Internal.Implicit multimap_ :: S arr (Rule AnyBifunctor Incoherent :+ arr') -> cat (f x1 x2) (f y1 y2) Source # | |
(MultimapOf (->) arr y1 x1, MultimapOf (->) arr x2 y2) => Multimap_ (->) (S arr (Rule AnyBifunctor Incoherent :+ arr')) (x1 -> x2) (y1 -> y2) Source # | |
Defined in Generic.Functor.Internal.Implicit multimap_ :: S arr (Rule AnyBifunctor Incoherent :+ arr') -> (x1 -> x2) -> (y1 -> y2) Source # |