{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE StandaloneKindSignatures #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE KindSignatures #-}
module FFunctor.FCompose where
import FFunctor
type FCompose :: FF -> FF -> FF
newtype FCompose ff gg h x = FCompose {forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
FCompose ff gg h x -> ff (gg h) x
getFCompose :: ff (gg h) x}
deriving (Int -> FCompose ff gg h x -> ShowS
[FCompose ff gg h x] -> ShowS
FCompose ff gg h x -> String
(Int -> FCompose ff gg h x -> ShowS)
-> (FCompose ff gg h x -> String)
-> ([FCompose ff gg h x] -> ShowS)
-> Show (FCompose ff gg h x)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
Show (ff (gg h) x) =>
Int -> FCompose ff gg h x -> ShowS
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
Show (ff (gg h) x) =>
[FCompose ff gg h x] -> ShowS
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
Show (ff (gg h) x) =>
FCompose ff gg h x -> String
$cshowsPrec :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
Show (ff (gg h) x) =>
Int -> FCompose ff gg h x -> ShowS
showsPrec :: Int -> FCompose ff gg h x -> ShowS
$cshow :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
Show (ff (gg h) x) =>
FCompose ff gg h x -> String
show :: FCompose ff gg h x -> String
$cshowList :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
Show (ff (gg h) x) =>
[FCompose ff gg h x] -> ShowS
showList :: [FCompose ff gg h x] -> ShowS
Show, FCompose ff gg h x -> FCompose ff gg h x -> Bool
(FCompose ff gg h x -> FCompose ff gg h x -> Bool)
-> (FCompose ff gg h x -> FCompose ff gg h x -> Bool)
-> Eq (FCompose ff gg h x)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
Eq (ff (gg h) x) =>
FCompose ff gg h x -> FCompose ff gg h x -> Bool
$c== :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
Eq (ff (gg h) x) =>
FCompose ff gg h x -> FCompose ff gg h x -> Bool
== :: FCompose ff gg h x -> FCompose ff gg h x -> Bool
$c/= :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
Eq (ff (gg h) x) =>
FCompose ff gg h x -> FCompose ff gg h x -> Bool
/= :: FCompose ff gg h x -> FCompose ff gg h x -> Bool
Eq, Eq (FCompose ff gg h x)
Eq (FCompose ff gg h x) =>
(FCompose ff gg h x -> FCompose ff gg h x -> Ordering)
-> (FCompose ff gg h x -> FCompose ff gg h x -> Bool)
-> (FCompose ff gg h x -> FCompose ff gg h x -> Bool)
-> (FCompose ff gg h x -> FCompose ff gg h x -> Bool)
-> (FCompose ff gg h x -> FCompose ff gg h x -> Bool)
-> (FCompose ff gg h x -> FCompose ff gg h x -> FCompose ff gg h x)
-> (FCompose ff gg h x -> FCompose ff gg h x -> FCompose ff gg h x)
-> Ord (FCompose ff gg h x)
FCompose ff gg h x -> FCompose ff gg h x -> Bool
FCompose ff gg h x -> FCompose ff gg h x -> Ordering
FCompose ff gg h x -> FCompose ff gg h x -> FCompose ff gg h x
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
Ord (ff (gg h) x) =>
Eq (FCompose ff gg h x)
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
Ord (ff (gg h) x) =>
FCompose ff gg h x -> FCompose ff gg h x -> Bool
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
Ord (ff (gg h) x) =>
FCompose ff gg h x -> FCompose ff gg h x -> Ordering
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
Ord (ff (gg h) x) =>
FCompose ff gg h x -> FCompose ff gg h x -> FCompose ff gg h x
$ccompare :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
Ord (ff (gg h) x) =>
FCompose ff gg h x -> FCompose ff gg h x -> Ordering
compare :: FCompose ff gg h x -> FCompose ff gg h x -> Ordering
$c< :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
Ord (ff (gg h) x) =>
FCompose ff gg h x -> FCompose ff gg h x -> Bool
< :: FCompose ff gg h x -> FCompose ff gg h x -> Bool
$c<= :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
Ord (ff (gg h) x) =>
FCompose ff gg h x -> FCompose ff gg h x -> Bool
<= :: FCompose ff gg h x -> FCompose ff gg h x -> Bool
$c> :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
Ord (ff (gg h) x) =>
FCompose ff gg h x -> FCompose ff gg h x -> Bool
> :: FCompose ff gg h x -> FCompose ff gg h x -> Bool
$c>= :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
Ord (ff (gg h) x) =>
FCompose ff gg h x -> FCompose ff gg h x -> Bool
>= :: FCompose ff gg h x -> FCompose ff gg h x -> Bool
$cmax :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
Ord (ff (gg h) x) =>
FCompose ff gg h x -> FCompose ff gg h x -> FCompose ff gg h x
max :: FCompose ff gg h x -> FCompose ff gg h x -> FCompose ff gg h x
$cmin :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
Ord (ff (gg h) x) =>
FCompose ff gg h x -> FCompose ff gg h x -> FCompose ff gg h x
min :: FCompose ff gg h x -> FCompose ff gg h x -> FCompose ff gg h x
Ord, (forall m. Monoid m => FCompose ff gg h m -> m)
-> (forall m a. Monoid m => (a -> m) -> FCompose ff gg h a -> m)
-> (forall m a. Monoid m => (a -> m) -> FCompose ff gg h a -> m)
-> (forall a b. (a -> b -> b) -> b -> FCompose ff gg h a -> b)
-> (forall a b. (a -> b -> b) -> b -> FCompose ff gg h a -> b)
-> (forall b a. (b -> a -> b) -> b -> FCompose ff gg h a -> b)
-> (forall b a. (b -> a -> b) -> b -> FCompose ff gg h a -> b)
-> (forall a. (a -> a -> a) -> FCompose ff gg h a -> a)
-> (forall a. (a -> a -> a) -> FCompose ff gg h a -> a)
-> (forall a. FCompose ff gg h a -> [a])
-> (forall a. FCompose ff gg h a -> Bool)
-> (forall a. FCompose ff gg h a -> Int)
-> (forall a. Eq a => a -> FCompose ff gg h a -> Bool)
-> (forall a. Ord a => FCompose ff gg h a -> a)
-> (forall a. Ord a => FCompose ff gg h a -> a)
-> (forall a. Num a => FCompose ff gg h a -> a)
-> (forall a. Num a => FCompose ff gg h a -> a)
-> Foldable (FCompose ff gg h)
forall a. Eq a => a -> FCompose ff gg h a -> Bool
forall a. Num a => FCompose ff gg h a -> a
forall a. Ord a => FCompose ff gg h a -> a
forall m. Monoid m => FCompose ff gg h m -> m
forall a. FCompose ff gg h a -> Bool
forall a. FCompose ff gg h a -> Int
forall a. FCompose ff gg h a -> [a]
forall a. (a -> a -> a) -> FCompose ff gg h a -> a
forall m a. Monoid m => (a -> m) -> FCompose ff gg h a -> m
forall b a. (b -> a -> b) -> b -> FCompose ff gg h a -> b
forall a b. (a -> b -> b) -> b -> FCompose ff gg h a -> b
forall (t :: FUNCTOR).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) a.
(Foldable (ff (gg h)), Eq a) =>
a -> FCompose ff gg h a -> Bool
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) a.
(Foldable (ff (gg h)), Num a) =>
FCompose ff gg h a -> a
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) a.
(Foldable (ff (gg h)), Ord a) =>
FCompose ff gg h a -> a
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) m.
(Foldable (ff (gg h)), Monoid m) =>
FCompose ff gg h m -> m
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) a.
Foldable (ff (gg h)) =>
FCompose ff gg h a -> Bool
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) a.
Foldable (ff (gg h)) =>
FCompose ff gg h a -> Int
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) a.
Foldable (ff (gg h)) =>
FCompose ff gg h a -> [a]
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) a.
Foldable (ff (gg h)) =>
(a -> a -> a) -> FCompose ff gg h a -> a
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) m a.
(Foldable (ff (gg h)), Monoid m) =>
(a -> m) -> FCompose ff gg h a -> m
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) b a.
Foldable (ff (gg h)) =>
(b -> a -> b) -> b -> FCompose ff gg h a -> b
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) a b.
Foldable (ff (gg h)) =>
(a -> b -> b) -> b -> FCompose ff gg h a -> b
$cfold :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) m.
(Foldable (ff (gg h)), Monoid m) =>
FCompose ff gg h m -> m
fold :: forall m. Monoid m => FCompose ff gg h m -> m
$cfoldMap :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) m a.
(Foldable (ff (gg h)), Monoid m) =>
(a -> m) -> FCompose ff gg h a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> FCompose ff gg h a -> m
$cfoldMap' :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) m a.
(Foldable (ff (gg h)), Monoid m) =>
(a -> m) -> FCompose ff gg h a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> FCompose ff gg h a -> m
$cfoldr :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) a b.
Foldable (ff (gg h)) =>
(a -> b -> b) -> b -> FCompose ff gg h a -> b
foldr :: forall a b. (a -> b -> b) -> b -> FCompose ff gg h a -> b
$cfoldr' :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) a b.
Foldable (ff (gg h)) =>
(a -> b -> b) -> b -> FCompose ff gg h a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> FCompose ff gg h a -> b
$cfoldl :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) b a.
Foldable (ff (gg h)) =>
(b -> a -> b) -> b -> FCompose ff gg h a -> b
foldl :: forall b a. (b -> a -> b) -> b -> FCompose ff gg h a -> b
$cfoldl' :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) b a.
Foldable (ff (gg h)) =>
(b -> a -> b) -> b -> FCompose ff gg h a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> FCompose ff gg h a -> b
$cfoldr1 :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) a.
Foldable (ff (gg h)) =>
(a -> a -> a) -> FCompose ff gg h a -> a
foldr1 :: forall a. (a -> a -> a) -> FCompose ff gg h a -> a
$cfoldl1 :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) a.
Foldable (ff (gg h)) =>
(a -> a -> a) -> FCompose ff gg h a -> a
foldl1 :: forall a. (a -> a -> a) -> FCompose ff gg h a -> a
$ctoList :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) a.
Foldable (ff (gg h)) =>
FCompose ff gg h a -> [a]
toList :: forall a. FCompose ff gg h a -> [a]
$cnull :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) a.
Foldable (ff (gg h)) =>
FCompose ff gg h a -> Bool
null :: forall a. FCompose ff gg h a -> Bool
$clength :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) a.
Foldable (ff (gg h)) =>
FCompose ff gg h a -> Int
length :: forall a. FCompose ff gg h a -> Int
$celem :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) a.
(Foldable (ff (gg h)), Eq a) =>
a -> FCompose ff gg h a -> Bool
elem :: forall a. Eq a => a -> FCompose ff gg h a -> Bool
$cmaximum :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) a.
(Foldable (ff (gg h)), Ord a) =>
FCompose ff gg h a -> a
maximum :: forall a. Ord a => FCompose ff gg h a -> a
$cminimum :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) a.
(Foldable (ff (gg h)), Ord a) =>
FCompose ff gg h a -> a
minimum :: forall a. Ord a => FCompose ff gg h a -> a
$csum :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) a.
(Foldable (ff (gg h)), Num a) =>
FCompose ff gg h a -> a
sum :: forall a. Num a => FCompose ff gg h a -> a
$cproduct :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) a.
(Foldable (ff (gg h)), Num a) =>
FCompose ff gg h a -> a
product :: forall a. Num a => FCompose ff gg h a -> a
Foldable, Functor (FCompose ff gg h)
Foldable (FCompose ff gg h)
(Functor (FCompose ff gg h), Foldable (FCompose ff gg h)) =>
(forall (f :: FUNCTOR) a b.
Applicative f =>
(a -> f b) -> FCompose ff gg h a -> f (FCompose ff gg h b))
-> (forall (f :: FUNCTOR) a.
Applicative f =>
FCompose ff gg h (f a) -> f (FCompose ff gg h a))
-> (forall (m :: FUNCTOR) a b.
Monad m =>
(a -> m b) -> FCompose ff gg h a -> m (FCompose ff gg h b))
-> (forall (m :: FUNCTOR) a.
Monad m =>
FCompose ff gg h (m a) -> m (FCompose ff gg h a))
-> Traversable (FCompose ff gg h)
forall (t :: FUNCTOR).
(Functor t, Foldable t) =>
(forall (f :: FUNCTOR) a b.
Applicative f =>
(a -> f b) -> t a -> f (t b))
-> (forall (f :: FUNCTOR) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: FUNCTOR) a b.
Monad m =>
(a -> m b) -> t a -> m (t b))
-> (forall (m :: FUNCTOR) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: FUNCTOR) a.
Monad m =>
FCompose ff gg h (m a) -> m (FCompose ff gg h a)
forall (f :: FUNCTOR) a.
Applicative f =>
FCompose ff gg h (f a) -> f (FCompose ff gg h a)
forall (m :: FUNCTOR) a b.
Monad m =>
(a -> m b) -> FCompose ff gg h a -> m (FCompose ff gg h b)
forall (f :: FUNCTOR) a b.
Applicative f =>
(a -> f b) -> FCompose ff gg h a -> f (FCompose ff gg h b)
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR).
(FFunctor ff, FFunctor gg, Traversable (ff (gg h)), Functor h) =>
Functor (FCompose ff gg h)
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR).
(FFunctor ff, FFunctor gg, Traversable (ff (gg h)), Functor h) =>
Foldable (FCompose ff gg h)
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) (m :: FUNCTOR) a.
(FFunctor ff, FFunctor gg, Traversable (ff (gg h)), Functor h,
Monad m) =>
FCompose ff gg h (m a) -> m (FCompose ff gg h a)
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) (f :: FUNCTOR) a.
(FFunctor ff, FFunctor gg, Traversable (ff (gg h)), Functor h,
Applicative f) =>
FCompose ff gg h (f a) -> f (FCompose ff gg h a)
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) (m :: FUNCTOR) a b.
(FFunctor ff, FFunctor gg, Traversable (ff (gg h)), Functor h,
Monad m) =>
(a -> m b) -> FCompose ff gg h a -> m (FCompose ff gg h b)
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) (f :: FUNCTOR) a b.
(FFunctor ff, FFunctor gg, Traversable (ff (gg h)), Functor h,
Applicative f) =>
(a -> f b) -> FCompose ff gg h a -> f (FCompose ff gg h b)
$ctraverse :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) (f :: FUNCTOR) a b.
(FFunctor ff, FFunctor gg, Traversable (ff (gg h)), Functor h,
Applicative f) =>
(a -> f b) -> FCompose ff gg h a -> f (FCompose ff gg h b)
traverse :: forall (f :: FUNCTOR) a b.
Applicative f =>
(a -> f b) -> FCompose ff gg h a -> f (FCompose ff gg h b)
$csequenceA :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) (f :: FUNCTOR) a.
(FFunctor ff, FFunctor gg, Traversable (ff (gg h)), Functor h,
Applicative f) =>
FCompose ff gg h (f a) -> f (FCompose ff gg h a)
sequenceA :: forall (f :: FUNCTOR) a.
Applicative f =>
FCompose ff gg h (f a) -> f (FCompose ff gg h a)
$cmapM :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) (m :: FUNCTOR) a b.
(FFunctor ff, FFunctor gg, Traversable (ff (gg h)), Functor h,
Monad m) =>
(a -> m b) -> FCompose ff gg h a -> m (FCompose ff gg h b)
mapM :: forall (m :: FUNCTOR) a b.
Monad m =>
(a -> m b) -> FCompose ff gg h a -> m (FCompose ff gg h b)
$csequence :: forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) (m :: FUNCTOR) a.
(FFunctor ff, FFunctor gg, Traversable (ff (gg h)), Functor h,
Monad m) =>
FCompose ff gg h (m a) -> m (FCompose ff gg h a)
sequence :: forall (m :: FUNCTOR) a.
Monad m =>
FCompose ff gg h (m a) -> m (FCompose ff gg h a)
Traversable)
deriving
via ((ff :: FF) ((gg :: FF) h))
instance (FFunctor ff, FFunctor gg, Functor h) => Functor (FCompose ff gg h)
instance (FFunctor ff, FFunctor gg) => FFunctor (FCompose ff gg) where
ffmap :: forall (g :: FUNCTOR) (h :: FUNCTOR) x.
(Functor g, Functor h) =>
(g ~> h) -> FCompose ff gg g x -> FCompose ff gg h x
ffmap g ~> h
gh = ff (gg h) x -> FCompose ff gg h x
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
ff (gg h) x -> FCompose ff gg h x
FCompose (ff (gg h) x -> FCompose ff gg h x)
-> (FCompose ff gg g x -> ff (gg h) x)
-> FCompose ff gg g x
-> FCompose ff gg h x
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (gg g ~> gg h) -> ff (gg g) x -> ff (gg h) x
forall (g :: FUNCTOR) (h :: FUNCTOR) x.
(Functor g, Functor h) =>
(g ~> h) -> ff g x -> ff h x
forall (ff :: FF) (g :: FUNCTOR) (h :: FUNCTOR) x.
(FFunctor ff, Functor g, Functor h) =>
(g ~> h) -> ff g x -> ff h x
ffmap ((g ~> h) -> gg g x -> gg h x
forall (g :: FUNCTOR) (h :: FUNCTOR) x.
(Functor g, Functor h) =>
(g ~> h) -> gg g x -> gg h x
forall (ff :: FF) (g :: FUNCTOR) (h :: FUNCTOR) x.
(FFunctor ff, Functor g, Functor h) =>
(g ~> h) -> ff g x -> ff h x
ffmap g x -> h x
g ~> h
gh) (ff (gg g) x -> ff (gg h) x)
-> (FCompose ff gg g x -> ff (gg g) x)
-> FCompose ff gg g x
-> ff (gg h) x
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FCompose ff gg g x -> ff (gg g) x
forall (ff :: FF) (gg :: FF) (h :: FUNCTOR) x.
FCompose ff gg h x -> ff (gg h) x
getFCompose
type (⊚) = FCompose
infixl 7 ⊚