{-# Language DataKinds, DefaultSignatures, FlexibleContexts, FlexibleInstances, GeneralizedNewtypeDeriving,
InstanceSigs, MultiParamTypeClasses, PolyKinds, RankNTypes, ScopedTypeVariables, StandaloneDeriving,
TypeApplications, TypeFamilies, TypeOperators, UndecidableInstances #-}
module Transformation.AG.Generics (
Auto(..), Keep(..), Folded(..), Mapped(..), Traversed(..),
Bequether(..), Synthesizer(..), SynthesizedField(..), Revelation(..),
foldedField, mappedField, passDown, bequestDefault)
where
import Data.Functor.Compose (Compose(..))
import Data.Functor.Const (Const(..))
import Data.Kind (Type)
import Data.Generics.Product.Subtype (Subtype(upcast))
import Data.Proxy (Proxy(..))
import GHC.Generics
import GHC.Records
import GHC.TypeLits (Symbol, ErrorMessage (Text), TypeError)
import Unsafe.Coerce (unsafeCoerce)
import qualified Rank2
import Transformation (Transformation, Domain, Codomain, At)
import Transformation.AG
import qualified Transformation
import qualified Transformation.Shallow as Shallow
import qualified Transformation.Deep as Deep
import qualified Transformation.Full as Full
newtype Auto t = Auto t
newtype Keep t = Keep t
type instance Atts (Inherited (Auto t)) x = Atts (Inherited t) x
type instance Atts (Synthesized (Auto t)) x = Atts (Synthesized t) x
type instance Atts (Inherited (Keep t)) x = Atts (Inherited t) x
type instance Atts (Synthesized (Keep t)) x = Atts (Synthesized t) x
instance {-# overlappable #-} (Revelation (Auto t), Domain (Auto t) ~ f, Codomain (Auto t) ~ Semantics (Auto t),
Rank2.Apply (g (Semantics (Auto t))), Attribution (Auto t) g (Semantics (Auto t)) f) =>
Auto t `At` g (Semantics (Auto t)) (Semantics (Auto t)) where
Auto t
t $ :: Auto t
-> Domain (Auto t) (g (Semantics (Auto t)) (Semantics (Auto t)))
-> Codomain (Auto t) (g (Semantics (Auto t)) (Semantics (Auto t)))
$ Domain (Auto t) (g (Semantics (Auto t)) (Semantics (Auto t)))
x = (forall a. f a -> a)
-> Auto t
-> f (g (Semantics (Auto t)) (Semantics (Auto t)))
-> Semantics (Auto t) (g (Semantics (Auto t)) (Semantics (Auto t)))
forall (q :: * -> *) t x (g :: (* -> *) -> (* -> *) -> *)
(p :: * -> *).
(q ~ Semantics t, x ~ g q q, Apply (g q), Attribution t g q p) =>
(forall a. p a -> a) -> t -> p x -> q x
applyDefault (Auto t -> Domain (Auto t) a -> a
forall t x. Revelation t => t -> Domain t x -> x
forall x. Auto t -> Domain (Auto t) x -> x
reveal Auto t
t) Auto t
t f (g (Semantics (Auto t)) (Semantics (Auto t)))
Domain (Auto t) (g (Semantics (Auto t)) (Semantics (Auto t)))
x
{-# INLINE ($) #-}
instance {-# overlappable #-}
(Revelation (Keep t), p ~ Transformation.Domain (Keep t), Rank2.Apply (g q),
q ~ Transformation.Codomain (Keep t), q ~ PreservingSemantics (Keep t) p, s ~ Semantics (Keep t),
Atts (Inherited (Keep t)) (g q q) ~ Atts (Inherited (Keep t)) (g s s),
Atts (Synthesized (Keep t)) (g q q) ~ Atts (Synthesized (Keep t)) (g s s),
g q (Synthesized (Keep t)) ~ g s (Synthesized (Keep t)),
g q (Inherited (Keep t)) ~ g s (Inherited (Keep t)), Attribution (Keep t) g q p) =>
Keep t `At` g (PreservingSemantics (Keep t) p) (PreservingSemantics (Keep t) p) where
($) :: Keep t -> p (g (PreservingSemantics (Keep t) p) (PreservingSemantics (Keep t) p))
-> PreservingSemantics (Keep t) p (g (PreservingSemantics (Keep t) p) (PreservingSemantics (Keep t) p))
Keep t
t $ :: Keep t
-> p (g (PreservingSemantics (Keep t) p)
(PreservingSemantics (Keep t) p))
-> PreservingSemantics
(Keep t)
p
(g (PreservingSemantics (Keep t) p)
(PreservingSemantics (Keep t) p))
$ p (g (PreservingSemantics (Keep t) p)
(PreservingSemantics (Keep t) p))
x = (forall a. p a -> a)
-> Keep t
-> p (g (PreservingSemantics (Keep t) p)
(PreservingSemantics (Keep t) p))
-> PreservingSemantics
(Keep t)
p
(g (PreservingSemantics (Keep t) p)
(PreservingSemantics (Keep t) p))
forall (p :: * -> *) t (q :: * -> *) x
(g :: (* -> *) -> (* -> *) -> *).
(p ~ Domain t, q ~ PreservingSemantics t p, x ~ g q q, Apply (g q),
Atts (Inherited t) (g q q)
~ Atts (Inherited t) (g (Semantics t) (Semantics t)),
Atts (Synthesized t) (g q q)
~ Atts (Synthesized t) (g (Semantics t) (Semantics t)),
g q (Synthesized t) ~ g (Semantics t) (Synthesized t),
g q (Inherited t) ~ g (Semantics t) (Inherited t),
Attribution t g (PreservingSemantics t p) p) =>
(forall a. p a -> a)
-> t
-> p (g (PreservingSemantics t p) (PreservingSemantics t p))
-> PreservingSemantics
t p (g (PreservingSemantics t p) (PreservingSemantics t p))
applyDefaultWithAttributes (Keep t -> Domain (Keep t) a -> a
forall t x. Revelation t => t -> Domain t x -> x
forall x. Keep t -> Domain (Keep t) x -> x
reveal Keep t
t) Keep t
t p (g (PreservingSemantics (Keep t) p)
(PreservingSemantics (Keep t) p))
x
{-# INLINE ($) #-}
instance (Transformation (Auto t), Domain (Auto t) ~ f, Functor f, Codomain (Auto t) ~ Semantics (Auto t),
Rank2.Functor (g f), Deep.Functor (Auto t) g, Auto t `At` g (Semantics (Auto t)) (Semantics (Auto t))) =>
Full.Functor (Auto t) g where
<$> :: Auto t
-> Domain (Auto t) (g (Domain (Auto t)) (Domain (Auto t)))
-> Codomain (Auto t) (g (Codomain (Auto t)) (Codomain (Auto t)))
(<$>) = Auto t
-> Domain (Auto t) (g (Domain (Auto t)) (Domain (Auto t)))
-> Codomain (Auto t) (g (Codomain (Auto t)) (Codomain (Auto t)))
forall t (g :: (* -> *) -> (* -> *) -> *).
(Functor t g, At t (g (Codomain t) (Codomain t)),
Functor (Domain t)) =>
t
-> Domain t (g (Domain t) (Domain t))
-> Codomain t (g (Codomain t) (Codomain t))
Full.mapUpDefault
instance (Transformation (Keep t), Domain (Keep t) ~ f, Functor f, Codomain (Keep t) ~ PreservingSemantics (Keep t) f,
Functor f, Rank2.Functor (g f), Deep.Functor (Keep t) g,
Keep t `At` g (PreservingSemantics (Keep t) f) (PreservingSemantics (Keep t) f)) =>
Full.Functor (Keep t) g where
<$> :: Keep t
-> Domain (Keep t) (g (Domain (Keep t)) (Domain (Keep t)))
-> Codomain (Keep t) (g (Codomain (Keep t)) (Codomain (Keep t)))
(<$>) = Keep t
-> Domain (Keep t) (g (Domain (Keep t)) (Domain (Keep t)))
-> Codomain (Keep t) (g (Codomain (Keep t)) (Codomain (Keep t)))
forall t (g :: (* -> *) -> (* -> *) -> *).
(Functor t g, At t (g (Codomain t) (Codomain t)),
Functor (Domain t)) =>
t
-> Domain t (g (Domain t) (Domain t))
-> Codomain t (g (Codomain t) (Codomain t))
Full.mapUpDefault
instance {-# overlappable #-} (Bequether (Auto t) g d s, Synthesizer (Auto t) g d s) => Attribution (Auto t) g d s where
attribution :: Auto t -> s (g d d) -> Rule (Auto t) g
attribution Auto t
t s (g d d)
l (Inherited Atts (Inherited (Auto t)) (g sem (Semantics (Auto t)))
i, g sem (Synthesized (Auto t))
s) = (Atts (Synthesized (Auto t)) (g sem (Semantics (Auto t)))
-> Synthesized (Auto t) (g sem (Semantics (Auto t)))
forall t a. Atts (Synthesized t) a -> Synthesized t a
Synthesized (Atts (Synthesized (Auto t)) (g sem (Semantics (Auto t)))
-> Synthesized (Auto t) (g sem (Semantics (Auto t))))
-> Atts (Synthesized (Auto t)) (g sem (Semantics (Auto t)))
-> Synthesized (Auto t) (g sem (Semantics (Auto t)))
forall a b. (a -> b) -> a -> b
$ Auto t
-> s (g d d)
-> Atts (Inherited (Auto t)) (g sem sem)
-> g sem (Synthesized (Auto t))
-> Atts (Synthesized (Auto t)) (g sem sem)
forall t (g :: (* -> *) -> (* -> *) -> *) (deep :: * -> *)
(shallow :: * -> *) (sem :: * -> *).
(Synthesizer t g deep shallow, sem ~ Semantics t) =>
t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> Atts (Synthesized t) (g sem sem)
forall (sem :: * -> *).
(sem ~ Semantics (Auto t)) =>
Auto t
-> s (g d d)
-> Atts (Inherited (Auto t)) (g sem sem)
-> g sem (Synthesized (Auto t))
-> Atts (Synthesized (Auto t)) (g sem sem)
synthesis Auto t
t s (g d d)
l Atts (Inherited (Auto t)) (g sem sem)
Atts (Inherited (Auto t)) (g sem (Semantics (Auto t)))
i g sem (Synthesized (Auto t))
s, Auto t
-> s (g d d)
-> Atts (Inherited (Auto t)) (g sem sem)
-> g sem (Synthesized (Auto t))
-> g sem (Inherited (Auto t))
forall t (g :: (* -> *) -> (* -> *) -> *) (deep :: * -> *)
(shallow :: * -> *) (sem :: * -> *).
(Bequether t g deep shallow, sem ~ Semantics t) =>
t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> g sem (Inherited t)
forall (sem :: * -> *).
(sem ~ Semantics (Auto t)) =>
Auto t
-> s (g d d)
-> Atts (Inherited (Auto t)) (g sem sem)
-> g sem (Synthesized (Auto t))
-> g sem (Inherited (Auto t))
bequest Auto t
t s (g d d)
l Atts (Inherited (Auto t)) (g sem sem)
Atts (Inherited (Auto t)) (g sem (Semantics (Auto t)))
i g sem (Synthesized (Auto t))
s)
class Transformation t => Revelation t where
reveal :: t -> Domain t x -> x
class Bequether t g deep shallow where
bequest :: forall sem. sem ~ Semantics t =>
t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> g sem (Inherited t)
class Synthesizer t g deep shallow where
synthesis :: forall sem. sem ~ Semantics t =>
t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> Atts (Synthesized t) (g sem sem)
class SynthesizedField (name :: Symbol) result t g deep shallow where
synthesizedField :: forall sem. sem ~ Semantics t =>
Proxy name
-> t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> result
instance {-# overlappable #-} (sem ~ Semantics t, Domain t ~ shallow, Revelation t,
Shallow.Functor (PassDown t sem (Atts (Inherited t) (g sem sem))) (g sem)) =>
Bequether t g (Semantics t) shallow where
bequest :: forall (sem :: * -> *).
(sem ~ Semantics t) =>
t
-> shallow (g (Semantics t) (Semantics t))
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> g sem (Inherited t)
bequest = t
-> shallow (g (Semantics t) (Semantics t))
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> g sem (Inherited t)
t
-> shallow (g (Semantics t) (Semantics t))
-> Atts (Inherited t) (g (Semantics t) (Semantics t))
-> g (Semantics t) (Synthesized t)
-> g (Semantics t) (Inherited t)
forall t (g :: (* -> *) -> (* -> *) -> *) (shallow :: * -> *)
(sem :: * -> *).
(sem ~ Semantics t, Domain t ~ shallow, Revelation t,
Functor
(PassDown t sem (Atts (Inherited t) (g sem sem))) (g sem)) =>
t
-> shallow (g sem sem)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> g sem (Inherited t)
bequestDefault
instance {-# overlappable #-} (Atts (Synthesized t) (g sem sem) ~ result, Generic result, sem ~ Semantics t,
GenericSynthesizer t g d s (Rep result)) => Synthesizer t g d s where
synthesis :: forall (sem :: * -> *).
(sem ~ Semantics t) =>
t
-> s (g d d)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> Atts (Synthesized t) (g sem sem)
synthesis t
t s (g d d)
node Atts (Inherited t) (g sem sem)
i g sem (Synthesized t)
s = Rep result Any -> result
forall a x. Generic a => Rep a x -> a
forall x. Rep result x -> result
to (t
-> s (g d d)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> Rep result Any
forall {k} t (g :: (* -> *) -> (* -> *) -> *) (deep :: * -> *)
(shallow :: * -> *) (result :: k -> *) (a :: k) (sem :: * -> *).
(GenericSynthesizer t g deep shallow result, sem ~ Semantics t) =>
t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> result a
forall a (sem :: * -> *).
(sem ~ Semantics t) =>
t
-> s (g d d)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> Rep result a
genericSynthesis t
t s (g d d)
node Atts (Inherited t) (g sem sem)
i g sem (Synthesized t)
s)
newtype Folded a = Folded{forall a. Folded a -> a
getFolded :: a} deriving (Folded a -> Folded a -> Bool
(Folded a -> Folded a -> Bool)
-> (Folded a -> Folded a -> Bool) -> Eq (Folded a)
forall a. Eq a => Folded a -> Folded a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall a. Eq a => Folded a -> Folded a -> Bool
== :: Folded a -> Folded a -> Bool
$c/= :: forall a. Eq a => Folded a -> Folded a -> Bool
/= :: Folded a -> Folded a -> Bool
Eq, Eq (Folded a)
Eq (Folded a) =>
(Folded a -> Folded a -> Ordering)
-> (Folded a -> Folded a -> Bool)
-> (Folded a -> Folded a -> Bool)
-> (Folded a -> Folded a -> Bool)
-> (Folded a -> Folded a -> Bool)
-> (Folded a -> Folded a -> Folded a)
-> (Folded a -> Folded a -> Folded a)
-> Ord (Folded a)
Folded a -> Folded a -> Bool
Folded a -> Folded a -> Ordering
Folded a -> Folded a -> Folded a
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 a. Ord a => Eq (Folded a)
forall a. Ord a => Folded a -> Folded a -> Bool
forall a. Ord a => Folded a -> Folded a -> Ordering
forall a. Ord a => Folded a -> Folded a -> Folded a
$ccompare :: forall a. Ord a => Folded a -> Folded a -> Ordering
compare :: Folded a -> Folded a -> Ordering
$c< :: forall a. Ord a => Folded a -> Folded a -> Bool
< :: Folded a -> Folded a -> Bool
$c<= :: forall a. Ord a => Folded a -> Folded a -> Bool
<= :: Folded a -> Folded a -> Bool
$c> :: forall a. Ord a => Folded a -> Folded a -> Bool
> :: Folded a -> Folded a -> Bool
$c>= :: forall a. Ord a => Folded a -> Folded a -> Bool
>= :: Folded a -> Folded a -> Bool
$cmax :: forall a. Ord a => Folded a -> Folded a -> Folded a
max :: Folded a -> Folded a -> Folded a
$cmin :: forall a. Ord a => Folded a -> Folded a -> Folded a
min :: Folded a -> Folded a -> Folded a
Ord, Int -> Folded a -> ShowS
[Folded a] -> ShowS
Folded a -> String
(Int -> Folded a -> ShowS)
-> (Folded a -> String) -> ([Folded a] -> ShowS) -> Show (Folded a)
forall a. Show a => Int -> Folded a -> ShowS
forall a. Show a => [Folded a] -> ShowS
forall a. Show a => Folded a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall a. Show a => Int -> Folded a -> ShowS
showsPrec :: Int -> Folded a -> ShowS
$cshow :: forall a. Show a => Folded a -> String
show :: Folded a -> String
$cshowList :: forall a. Show a => [Folded a] -> ShowS
showList :: [Folded a] -> ShowS
Show, NonEmpty (Folded a) -> Folded a
Folded a -> Folded a -> Folded a
(Folded a -> Folded a -> Folded a)
-> (NonEmpty (Folded a) -> Folded a)
-> (forall b. Integral b => b -> Folded a -> Folded a)
-> Semigroup (Folded a)
forall b. Integral b => b -> Folded a -> Folded a
forall a. Semigroup a => NonEmpty (Folded a) -> Folded a
forall a. Semigroup a => Folded a -> Folded a -> Folded a
forall a b. (Semigroup a, Integral b) => b -> Folded a -> Folded a
forall a.
(a -> a -> a)
-> (NonEmpty a -> a)
-> (forall b. Integral b => b -> a -> a)
-> Semigroup a
$c<> :: forall a. Semigroup a => Folded a -> Folded a -> Folded a
<> :: Folded a -> Folded a -> Folded a
$csconcat :: forall a. Semigroup a => NonEmpty (Folded a) -> Folded a
sconcat :: NonEmpty (Folded a) -> Folded a
$cstimes :: forall a b. (Semigroup a, Integral b) => b -> Folded a -> Folded a
stimes :: forall b. Integral b => b -> Folded a -> Folded a
Semigroup, Semigroup (Folded a)
Folded a
Semigroup (Folded a) =>
Folded a
-> (Folded a -> Folded a -> Folded a)
-> ([Folded a] -> Folded a)
-> Monoid (Folded a)
[Folded a] -> Folded a
Folded a -> Folded a -> Folded a
forall a.
Semigroup a =>
a -> (a -> a -> a) -> ([a] -> a) -> Monoid a
forall a. Monoid a => Semigroup (Folded a)
forall a. Monoid a => Folded a
forall a. Monoid a => [Folded a] -> Folded a
forall a. Monoid a => Folded a -> Folded a -> Folded a
$cmempty :: forall a. Monoid a => Folded a
mempty :: Folded a
$cmappend :: forall a. Monoid a => Folded a -> Folded a -> Folded a
mappend :: Folded a -> Folded a -> Folded a
$cmconcat :: forall a. Monoid a => [Folded a] -> Folded a
mconcat :: [Folded a] -> Folded a
Monoid)
newtype Mapped f a = Mapped{forall {k} (f :: k -> *) (a :: k). Mapped f a -> f a
getMapped :: f a}
deriving (Mapped f a -> Mapped f a -> Bool
(Mapped f a -> Mapped f a -> Bool)
-> (Mapped f a -> Mapped f a -> Bool) -> Eq (Mapped f a)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall k (f :: k -> *) (a :: k).
Eq (f a) =>
Mapped f a -> Mapped f a -> Bool
$c== :: forall k (f :: k -> *) (a :: k).
Eq (f a) =>
Mapped f a -> Mapped f a -> Bool
== :: Mapped f a -> Mapped f a -> Bool
$c/= :: forall k (f :: k -> *) (a :: k).
Eq (f a) =>
Mapped f a -> Mapped f a -> Bool
/= :: Mapped f a -> Mapped f a -> Bool
Eq, Eq (Mapped f a)
Eq (Mapped f a) =>
(Mapped f a -> Mapped f a -> Ordering)
-> (Mapped f a -> Mapped f a -> Bool)
-> (Mapped f a -> Mapped f a -> Bool)
-> (Mapped f a -> Mapped f a -> Bool)
-> (Mapped f a -> Mapped f a -> Bool)
-> (Mapped f a -> Mapped f a -> Mapped f a)
-> (Mapped f a -> Mapped f a -> Mapped f a)
-> Ord (Mapped f a)
Mapped f a -> Mapped f a -> Bool
Mapped f a -> Mapped f a -> Ordering
Mapped f a -> Mapped f a -> Mapped f a
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 k (f :: k -> *) (a :: k). Ord (f a) => Eq (Mapped f a)
forall k (f :: k -> *) (a :: k).
Ord (f a) =>
Mapped f a -> Mapped f a -> Bool
forall k (f :: k -> *) (a :: k).
Ord (f a) =>
Mapped f a -> Mapped f a -> Ordering
forall k (f :: k -> *) (a :: k).
Ord (f a) =>
Mapped f a -> Mapped f a -> Mapped f a
$ccompare :: forall k (f :: k -> *) (a :: k).
Ord (f a) =>
Mapped f a -> Mapped f a -> Ordering
compare :: Mapped f a -> Mapped f a -> Ordering
$c< :: forall k (f :: k -> *) (a :: k).
Ord (f a) =>
Mapped f a -> Mapped f a -> Bool
< :: Mapped f a -> Mapped f a -> Bool
$c<= :: forall k (f :: k -> *) (a :: k).
Ord (f a) =>
Mapped f a -> Mapped f a -> Bool
<= :: Mapped f a -> Mapped f a -> Bool
$c> :: forall k (f :: k -> *) (a :: k).
Ord (f a) =>
Mapped f a -> Mapped f a -> Bool
> :: Mapped f a -> Mapped f a -> Bool
$c>= :: forall k (f :: k -> *) (a :: k).
Ord (f a) =>
Mapped f a -> Mapped f a -> Bool
>= :: Mapped f a -> Mapped f a -> Bool
$cmax :: forall k (f :: k -> *) (a :: k).
Ord (f a) =>
Mapped f a -> Mapped f a -> Mapped f a
max :: Mapped f a -> Mapped f a -> Mapped f a
$cmin :: forall k (f :: k -> *) (a :: k).
Ord (f a) =>
Mapped f a -> Mapped f a -> Mapped f a
min :: Mapped f a -> Mapped f a -> Mapped f a
Ord, Int -> Mapped f a -> ShowS
[Mapped f a] -> ShowS
Mapped f a -> String
(Int -> Mapped f a -> ShowS)
-> (Mapped f a -> String)
-> ([Mapped f a] -> ShowS)
-> Show (Mapped f a)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (f :: k -> *) (a :: k).
Show (f a) =>
Int -> Mapped f a -> ShowS
forall k (f :: k -> *) (a :: k).
Show (f a) =>
[Mapped f a] -> ShowS
forall k (f :: k -> *) (a :: k). Show (f a) => Mapped f a -> String
$cshowsPrec :: forall k (f :: k -> *) (a :: k).
Show (f a) =>
Int -> Mapped f a -> ShowS
showsPrec :: Int -> Mapped f a -> ShowS
$cshow :: forall k (f :: k -> *) (a :: k). Show (f a) => Mapped f a -> String
show :: Mapped f a -> String
$cshowList :: forall k (f :: k -> *) (a :: k).
Show (f a) =>
[Mapped f a] -> ShowS
showList :: [Mapped f a] -> ShowS
Show, NonEmpty (Mapped f a) -> Mapped f a
Mapped f a -> Mapped f a -> Mapped f a
(Mapped f a -> Mapped f a -> Mapped f a)
-> (NonEmpty (Mapped f a) -> Mapped f a)
-> (forall b. Integral b => b -> Mapped f a -> Mapped f a)
-> Semigroup (Mapped f a)
forall b. Integral b => b -> Mapped f a -> Mapped f a
forall a.
(a -> a -> a)
-> (NonEmpty a -> a)
-> (forall b. Integral b => b -> a -> a)
-> Semigroup a
forall k (f :: k -> *) (a :: k).
Semigroup (f a) =>
NonEmpty (Mapped f a) -> Mapped f a
forall k (f :: k -> *) (a :: k).
Semigroup (f a) =>
Mapped f a -> Mapped f a -> Mapped f a
forall k (f :: k -> *) (a :: k) b.
(Semigroup (f a), Integral b) =>
b -> Mapped f a -> Mapped f a
$c<> :: forall k (f :: k -> *) (a :: k).
Semigroup (f a) =>
Mapped f a -> Mapped f a -> Mapped f a
<> :: Mapped f a -> Mapped f a -> Mapped f a
$csconcat :: forall k (f :: k -> *) (a :: k).
Semigroup (f a) =>
NonEmpty (Mapped f a) -> Mapped f a
sconcat :: NonEmpty (Mapped f a) -> Mapped f a
$cstimes :: forall k (f :: k -> *) (a :: k) b.
(Semigroup (f a), Integral b) =>
b -> Mapped f a -> Mapped f a
stimes :: forall b. Integral b => b -> Mapped f a -> Mapped f a
Semigroup, Semigroup (Mapped f a)
Mapped f a
Semigroup (Mapped f a) =>
Mapped f a
-> (Mapped f a -> Mapped f a -> Mapped f a)
-> ([Mapped f a] -> Mapped f a)
-> Monoid (Mapped f a)
[Mapped f a] -> Mapped f a
Mapped f a -> Mapped f a -> Mapped f a
forall a.
Semigroup a =>
a -> (a -> a -> a) -> ([a] -> a) -> Monoid a
forall k (f :: k -> *) (a :: k).
Monoid (f a) =>
Semigroup (Mapped f a)
forall k (f :: k -> *) (a :: k). Monoid (f a) => Mapped f a
forall k (f :: k -> *) (a :: k).
Monoid (f a) =>
[Mapped f a] -> Mapped f a
forall k (f :: k -> *) (a :: k).
Monoid (f a) =>
Mapped f a -> Mapped f a -> Mapped f a
$cmempty :: forall k (f :: k -> *) (a :: k). Monoid (f a) => Mapped f a
mempty :: Mapped f a
$cmappend :: forall k (f :: k -> *) (a :: k).
Monoid (f a) =>
Mapped f a -> Mapped f a -> Mapped f a
mappend :: Mapped f a -> Mapped f a -> Mapped f a
$cmconcat :: forall k (f :: k -> *) (a :: k).
Monoid (f a) =>
[Mapped f a] -> Mapped f a
mconcat :: [Mapped f a] -> Mapped f a
Monoid, (forall a b. (a -> b) -> Mapped f a -> Mapped f b)
-> (forall a b. a -> Mapped f b -> Mapped f a)
-> Functor (Mapped f)
forall a b. a -> Mapped f b -> Mapped f a
forall a b. (a -> b) -> Mapped f a -> Mapped f b
forall (f :: * -> *) a b.
Functor f =>
a -> Mapped f b -> Mapped f a
forall (f :: * -> *) a b.
Functor f =>
(a -> b) -> Mapped f a -> Mapped f b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall (f :: * -> *) a b.
Functor f =>
(a -> b) -> Mapped f a -> Mapped f b
fmap :: forall a b. (a -> b) -> Mapped f a -> Mapped f b
$c<$ :: forall (f :: * -> *) a b.
Functor f =>
a -> Mapped f b -> Mapped f a
<$ :: forall a b. a -> Mapped f b -> Mapped f a
Functor, Functor (Mapped f)
Functor (Mapped f) =>
(forall a. a -> Mapped f a)
-> (forall a b. Mapped f (a -> b) -> Mapped f a -> Mapped f b)
-> (forall a b c.
(a -> b -> c) -> Mapped f a -> Mapped f b -> Mapped f c)
-> (forall a b. Mapped f a -> Mapped f b -> Mapped f b)
-> (forall a b. Mapped f a -> Mapped f b -> Mapped f a)
-> Applicative (Mapped f)
forall a. a -> Mapped f a
forall a b. Mapped f a -> Mapped f b -> Mapped f a
forall a b. Mapped f a -> Mapped f b -> Mapped f b
forall a b. Mapped f (a -> b) -> Mapped f a -> Mapped f b
forall a b c.
(a -> b -> c) -> Mapped f a -> Mapped f b -> Mapped f c
forall (f :: * -> *).
Functor f =>
(forall a. a -> f a)
-> (forall a b. f (a -> b) -> f a -> f b)
-> (forall a b c. (a -> b -> c) -> f a -> f b -> f c)
-> (forall a b. f a -> f b -> f b)
-> (forall a b. f a -> f b -> f a)
-> Applicative f
forall (f :: * -> *). Applicative f => Functor (Mapped f)
forall (f :: * -> *) a. Applicative f => a -> Mapped f a
forall (f :: * -> *) a b.
Applicative f =>
Mapped f a -> Mapped f b -> Mapped f a
forall (f :: * -> *) a b.
Applicative f =>
Mapped f a -> Mapped f b -> Mapped f b
forall (f :: * -> *) a b.
Applicative f =>
Mapped f (a -> b) -> Mapped f a -> Mapped f b
forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> Mapped f a -> Mapped f b -> Mapped f c
$cpure :: forall (f :: * -> *) a. Applicative f => a -> Mapped f a
pure :: forall a. a -> Mapped f a
$c<*> :: forall (f :: * -> *) a b.
Applicative f =>
Mapped f (a -> b) -> Mapped f a -> Mapped f b
<*> :: forall a b. Mapped f (a -> b) -> Mapped f a -> Mapped f b
$cliftA2 :: forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> Mapped f a -> Mapped f b -> Mapped f c
liftA2 :: forall a b c.
(a -> b -> c) -> Mapped f a -> Mapped f b -> Mapped f c
$c*> :: forall (f :: * -> *) a b.
Applicative f =>
Mapped f a -> Mapped f b -> Mapped f b
*> :: forall a b. Mapped f a -> Mapped f b -> Mapped f b
$c<* :: forall (f :: * -> *) a b.
Applicative f =>
Mapped f a -> Mapped f b -> Mapped f a
<* :: forall a b. Mapped f a -> Mapped f b -> Mapped f a
Applicative, Applicative (Mapped f)
Applicative (Mapped f) =>
(forall a b. Mapped f a -> (a -> Mapped f b) -> Mapped f b)
-> (forall a b. Mapped f a -> Mapped f b -> Mapped f b)
-> (forall a. a -> Mapped f a)
-> Monad (Mapped f)
forall a. a -> Mapped f a
forall a b. Mapped f a -> Mapped f b -> Mapped f b
forall a b. Mapped f a -> (a -> Mapped f b) -> Mapped f b
forall (f :: * -> *). Monad f => Applicative (Mapped f)
forall (f :: * -> *) a. Monad f => a -> Mapped f a
forall (f :: * -> *) a b.
Monad f =>
Mapped f a -> Mapped f b -> Mapped f b
forall (f :: * -> *) a b.
Monad f =>
Mapped f a -> (a -> Mapped f b) -> Mapped f b
forall (m :: * -> *).
Applicative m =>
(forall a b. m a -> (a -> m b) -> m b)
-> (forall a b. m a -> m b -> m b)
-> (forall a. a -> m a)
-> Monad m
$c>>= :: forall (f :: * -> *) a b.
Monad f =>
Mapped f a -> (a -> Mapped f b) -> Mapped f b
>>= :: forall a b. Mapped f a -> (a -> Mapped f b) -> Mapped f b
$c>> :: forall (f :: * -> *) a b.
Monad f =>
Mapped f a -> Mapped f b -> Mapped f b
>> :: forall a b. Mapped f a -> Mapped f b -> Mapped f b
$creturn :: forall (f :: * -> *) a. Monad f => a -> Mapped f a
return :: forall a. a -> Mapped f a
Monad, (forall m. Monoid m => Mapped f m -> m)
-> (forall m a. Monoid m => (a -> m) -> Mapped f a -> m)
-> (forall m a. Monoid m => (a -> m) -> Mapped f a -> m)
-> (forall a b. (a -> b -> b) -> b -> Mapped f a -> b)
-> (forall a b. (a -> b -> b) -> b -> Mapped f a -> b)
-> (forall b a. (b -> a -> b) -> b -> Mapped f a -> b)
-> (forall b a. (b -> a -> b) -> b -> Mapped f a -> b)
-> (forall a. (a -> a -> a) -> Mapped f a -> a)
-> (forall a. (a -> a -> a) -> Mapped f a -> a)
-> (forall a. Mapped f a -> [a])
-> (forall a. Mapped f a -> Bool)
-> (forall a. Mapped f a -> Int)
-> (forall a. Eq a => a -> Mapped f a -> Bool)
-> (forall a. Ord a => Mapped f a -> a)
-> (forall a. Ord a => Mapped f a -> a)
-> (forall a. Num a => Mapped f a -> a)
-> (forall a. Num a => Mapped f a -> a)
-> Foldable (Mapped f)
forall a. Eq a => a -> Mapped f a -> Bool
forall a. Num a => Mapped f a -> a
forall a. Ord a => Mapped f a -> a
forall m. Monoid m => Mapped f m -> m
forall a. Mapped f a -> Bool
forall a. Mapped f a -> Int
forall a. Mapped f a -> [a]
forall a. (a -> a -> a) -> Mapped f a -> a
forall m a. Monoid m => (a -> m) -> Mapped f a -> m
forall b a. (b -> a -> b) -> b -> Mapped f a -> b
forall a b. (a -> b -> b) -> b -> Mapped f a -> b
forall (f :: * -> *) a.
(Foldable f, Eq a) =>
a -> Mapped f a -> Bool
forall (f :: * -> *) a. (Foldable f, Num a) => Mapped f a -> a
forall (f :: * -> *) a. (Foldable f, Ord a) => Mapped f a -> a
forall (f :: * -> *) m. (Foldable f, Monoid m) => Mapped f m -> m
forall (f :: * -> *) a. Foldable f => Mapped f a -> Bool
forall (f :: * -> *) a. Foldable f => Mapped f a -> Int
forall (f :: * -> *) a. Foldable f => Mapped f a -> [a]
forall (f :: * -> *) a.
Foldable f =>
(a -> a -> a) -> Mapped f a -> a
forall (f :: * -> *) m a.
(Foldable f, Monoid m) =>
(a -> m) -> Mapped f a -> m
forall (f :: * -> *) b a.
Foldable f =>
(b -> a -> b) -> b -> Mapped f a -> b
forall (f :: * -> *) a b.
Foldable f =>
(a -> b -> b) -> b -> Mapped f a -> b
forall (t :: * -> *).
(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
$cfold :: forall (f :: * -> *) m. (Foldable f, Monoid m) => Mapped f m -> m
fold :: forall m. Monoid m => Mapped f m -> m
$cfoldMap :: forall (f :: * -> *) m a.
(Foldable f, Monoid m) =>
(a -> m) -> Mapped f a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> Mapped f a -> m
$cfoldMap' :: forall (f :: * -> *) m a.
(Foldable f, Monoid m) =>
(a -> m) -> Mapped f a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> Mapped f a -> m
$cfoldr :: forall (f :: * -> *) a b.
Foldable f =>
(a -> b -> b) -> b -> Mapped f a -> b
foldr :: forall a b. (a -> b -> b) -> b -> Mapped f a -> b
$cfoldr' :: forall (f :: * -> *) a b.
Foldable f =>
(a -> b -> b) -> b -> Mapped f a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> Mapped f a -> b
$cfoldl :: forall (f :: * -> *) b a.
Foldable f =>
(b -> a -> b) -> b -> Mapped f a -> b
foldl :: forall b a. (b -> a -> b) -> b -> Mapped f a -> b
$cfoldl' :: forall (f :: * -> *) b a.
Foldable f =>
(b -> a -> b) -> b -> Mapped f a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> Mapped f a -> b
$cfoldr1 :: forall (f :: * -> *) a.
Foldable f =>
(a -> a -> a) -> Mapped f a -> a
foldr1 :: forall a. (a -> a -> a) -> Mapped f a -> a
$cfoldl1 :: forall (f :: * -> *) a.
Foldable f =>
(a -> a -> a) -> Mapped f a -> a
foldl1 :: forall a. (a -> a -> a) -> Mapped f a -> a
$ctoList :: forall (f :: * -> *) a. Foldable f => Mapped f a -> [a]
toList :: forall a. Mapped f a -> [a]
$cnull :: forall (f :: * -> *) a. Foldable f => Mapped f a -> Bool
null :: forall a. Mapped f a -> Bool
$clength :: forall (f :: * -> *) a. Foldable f => Mapped f a -> Int
length :: forall a. Mapped f a -> Int
$celem :: forall (f :: * -> *) a.
(Foldable f, Eq a) =>
a -> Mapped f a -> Bool
elem :: forall a. Eq a => a -> Mapped f a -> Bool
$cmaximum :: forall (f :: * -> *) a. (Foldable f, Ord a) => Mapped f a -> a
maximum :: forall a. Ord a => Mapped f a -> a
$cminimum :: forall (f :: * -> *) a. (Foldable f, Ord a) => Mapped f a -> a
minimum :: forall a. Ord a => Mapped f a -> a
$csum :: forall (f :: * -> *) a. (Foldable f, Num a) => Mapped f a -> a
sum :: forall a. Num a => Mapped f a -> a
$cproduct :: forall (f :: * -> *) a. (Foldable f, Num a) => Mapped f a -> a
product :: forall a. Num a => Mapped f a -> a
Foldable)
newtype Traversed m f a = Traversed{forall {k} {k} (m :: k -> *) (f :: k -> k) (a :: k).
Traversed m f a -> m (f a)
getTraversed :: m (f a)} deriving (Traversed m f a -> Traversed m f a -> Bool
(Traversed m f a -> Traversed m f a -> Bool)
-> (Traversed m f a -> Traversed m f a -> Bool)
-> Eq (Traversed m f a)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Eq (m (f a)) =>
Traversed m f a -> Traversed m f a -> Bool
$c== :: forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Eq (m (f a)) =>
Traversed m f a -> Traversed m f a -> Bool
== :: Traversed m f a -> Traversed m f a -> Bool
$c/= :: forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Eq (m (f a)) =>
Traversed m f a -> Traversed m f a -> Bool
/= :: Traversed m f a -> Traversed m f a -> Bool
Eq, Eq (Traversed m f a)
Eq (Traversed m f a) =>
(Traversed m f a -> Traversed m f a -> Ordering)
-> (Traversed m f a -> Traversed m f a -> Bool)
-> (Traversed m f a -> Traversed m f a -> Bool)
-> (Traversed m f a -> Traversed m f a -> Bool)
-> (Traversed m f a -> Traversed m f a -> Bool)
-> (Traversed m f a -> Traversed m f a -> Traversed m f a)
-> (Traversed m f a -> Traversed m f a -> Traversed m f a)
-> Ord (Traversed m f a)
Traversed m f a -> Traversed m f a -> Bool
Traversed m f a -> Traversed m f a -> Ordering
Traversed m f a -> Traversed m f a -> Traversed m f a
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 k (m :: k -> *) k (f :: k -> k) (a :: k).
Ord (m (f a)) =>
Eq (Traversed m f a)
forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Ord (m (f a)) =>
Traversed m f a -> Traversed m f a -> Bool
forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Ord (m (f a)) =>
Traversed m f a -> Traversed m f a -> Ordering
forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Ord (m (f a)) =>
Traversed m f a -> Traversed m f a -> Traversed m f a
$ccompare :: forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Ord (m (f a)) =>
Traversed m f a -> Traversed m f a -> Ordering
compare :: Traversed m f a -> Traversed m f a -> Ordering
$c< :: forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Ord (m (f a)) =>
Traversed m f a -> Traversed m f a -> Bool
< :: Traversed m f a -> Traversed m f a -> Bool
$c<= :: forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Ord (m (f a)) =>
Traversed m f a -> Traversed m f a -> Bool
<= :: Traversed m f a -> Traversed m f a -> Bool
$c> :: forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Ord (m (f a)) =>
Traversed m f a -> Traversed m f a -> Bool
> :: Traversed m f a -> Traversed m f a -> Bool
$c>= :: forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Ord (m (f a)) =>
Traversed m f a -> Traversed m f a -> Bool
>= :: Traversed m f a -> Traversed m f a -> Bool
$cmax :: forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Ord (m (f a)) =>
Traversed m f a -> Traversed m f a -> Traversed m f a
max :: Traversed m f a -> Traversed m f a -> Traversed m f a
$cmin :: forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Ord (m (f a)) =>
Traversed m f a -> Traversed m f a -> Traversed m f a
min :: Traversed m f a -> Traversed m f a -> Traversed m f a
Ord, Int -> Traversed m f a -> ShowS
[Traversed m f a] -> ShowS
Traversed m f a -> String
(Int -> Traversed m f a -> ShowS)
-> (Traversed m f a -> String)
-> ([Traversed m f a] -> ShowS)
-> Show (Traversed m f a)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Show (m (f a)) =>
Int -> Traversed m f a -> ShowS
forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Show (m (f a)) =>
[Traversed m f a] -> ShowS
forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Show (m (f a)) =>
Traversed m f a -> String
$cshowsPrec :: forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Show (m (f a)) =>
Int -> Traversed m f a -> ShowS
showsPrec :: Int -> Traversed m f a -> ShowS
$cshow :: forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Show (m (f a)) =>
Traversed m f a -> String
show :: Traversed m f a -> String
$cshowList :: forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Show (m (f a)) =>
[Traversed m f a] -> ShowS
showList :: [Traversed m f a] -> ShowS
Show, NonEmpty (Traversed m f a) -> Traversed m f a
Traversed m f a -> Traversed m f a -> Traversed m f a
(Traversed m f a -> Traversed m f a -> Traversed m f a)
-> (NonEmpty (Traversed m f a) -> Traversed m f a)
-> (forall b.
Integral b =>
b -> Traversed m f a -> Traversed m f a)
-> Semigroup (Traversed m f a)
forall b. Integral b => b -> Traversed m f a -> Traversed m f a
forall a.
(a -> a -> a)
-> (NonEmpty a -> a)
-> (forall b. Integral b => b -> a -> a)
-> Semigroup a
forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Semigroup (m (f a)) =>
NonEmpty (Traversed m f a) -> Traversed m f a
forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Semigroup (m (f a)) =>
Traversed m f a -> Traversed m f a -> Traversed m f a
forall k (m :: k -> *) k (f :: k -> k) (a :: k) b.
(Semigroup (m (f a)), Integral b) =>
b -> Traversed m f a -> Traversed m f a
$c<> :: forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Semigroup (m (f a)) =>
Traversed m f a -> Traversed m f a -> Traversed m f a
<> :: Traversed m f a -> Traversed m f a -> Traversed m f a
$csconcat :: forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Semigroup (m (f a)) =>
NonEmpty (Traversed m f a) -> Traversed m f a
sconcat :: NonEmpty (Traversed m f a) -> Traversed m f a
$cstimes :: forall k (m :: k -> *) k (f :: k -> k) (a :: k) b.
(Semigroup (m (f a)), Integral b) =>
b -> Traversed m f a -> Traversed m f a
stimes :: forall b. Integral b => b -> Traversed m f a -> Traversed m f a
Semigroup, Semigroup (Traversed m f a)
Traversed m f a
Semigroup (Traversed m f a) =>
Traversed m f a
-> (Traversed m f a -> Traversed m f a -> Traversed m f a)
-> ([Traversed m f a] -> Traversed m f a)
-> Monoid (Traversed m f a)
[Traversed m f a] -> Traversed m f a
Traversed m f a -> Traversed m f a -> Traversed m f a
forall a.
Semigroup a =>
a -> (a -> a -> a) -> ([a] -> a) -> Monoid a
forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Monoid (m (f a)) =>
Semigroup (Traversed m f a)
forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Monoid (m (f a)) =>
Traversed m f a
forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Monoid (m (f a)) =>
[Traversed m f a] -> Traversed m f a
forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Monoid (m (f a)) =>
Traversed m f a -> Traversed m f a -> Traversed m f a
$cmempty :: forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Monoid (m (f a)) =>
Traversed m f a
mempty :: Traversed m f a
$cmappend :: forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Monoid (m (f a)) =>
Traversed m f a -> Traversed m f a -> Traversed m f a
mappend :: Traversed m f a -> Traversed m f a -> Traversed m f a
$cmconcat :: forall k (m :: k -> *) k (f :: k -> k) (a :: k).
Monoid (m (f a)) =>
[Traversed m f a] -> Traversed m f a
mconcat :: [Traversed m f a] -> Traversed m f a
Monoid)
instance (Functor m, Functor f) => Functor (Traversed m f) where
fmap :: forall a b. (a -> b) -> Traversed m f a -> Traversed m f b
fmap a -> b
f (Traversed m (f a)
x) = m (f b) -> Traversed m f b
forall {k} {k} (m :: k -> *) (f :: k -> k) (a :: k).
m (f a) -> Traversed m f a
Traversed ((a -> b
f (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>) (f a -> f b) -> m (f a) -> m (f b)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> m (f a)
x)
newtype PassDown (t :: Type) (f :: Type -> Type) a = PassDown a
data Accumulator (t :: Type) (name :: Symbol) (a :: Type) = Accumulator
data Replicator (t :: Type) (f :: Type -> Type) (name :: Symbol) = Replicator
data Traverser (t :: Type) (m :: Type -> Type) (f :: Type -> Type) (name :: Symbol) = Traverser
instance Transformation (PassDown t f a) where
type Domain (PassDown t f a) = f
type Codomain (PassDown t f a) = Inherited t
instance Transformation (Accumulator t name a) where
type Domain (Accumulator t name a) = Synthesized t
type Codomain (Accumulator t name a) = Const (Folded a)
instance Transformation (Replicator t f name) where
type Domain (Replicator t f name) = Synthesized t
type Codomain (Replicator t f name) = f
instance Transformation (Traverser t m f name) where
type Domain (Traverser t m f name) = Synthesized t
type Codomain (Traverser t m f name) = Compose m f
instance Subtype (Atts (Inherited t) a) b => Transformation.At (PassDown t f b) a where
$ :: PassDown t f b
-> Domain (PassDown t f b) a -> Codomain (PassDown t f b) a
($) (PassDown b
i) Domain (PassDown t f b) a
_ = Atts (Inherited t) a -> Inherited t a
forall t a. Atts (Inherited t) a -> Inherited t a
Inherited (b -> Atts (Inherited t) a
forall sup sub. Subtype sup sub => sub -> sup
upcast b
i)
instance (Monoid a, r ~ Atts (Synthesized t) x, Generic r, MayHaveMonoidalField name (Folded a) (Rep r)) =>
Transformation.At (Accumulator t name a) x where
Accumulator t name a
_ $ :: Accumulator t name a
-> Domain (Accumulator t name a) x
-> Codomain (Accumulator t name a) x
$ Synthesized Atts (Synthesized t) x
r = Folded a -> Const (Folded a) x
forall {k} a (b :: k). a -> Const a b
Const (Proxy name -> Rep r Any -> Folded a
forall x. Proxy name -> Rep r x -> Folded a
forall {k} (name :: Symbol) a (f :: k -> *) (x :: k).
MayHaveMonoidalField name a f =>
Proxy name -> f x -> a
getMonoidalField (Proxy name
forall {k} (t :: k). Proxy t
Proxy :: Proxy name) (Rep r Any -> Folded a) -> Rep r Any -> Folded a
forall a b. (a -> b) -> a -> b
$ r -> Rep r Any
forall x. r -> Rep r x
forall a x. Generic a => a -> Rep a x
from r
Atts (Synthesized t) x
r)
instance (HasField name (Atts (Synthesized t) a) (Mapped f a)) => Transformation.At (Replicator t f name) a where
Replicator t f name
_ $ :: Replicator t f name
-> Domain (Replicator t f name) a
-> Codomain (Replicator t f name) a
$ Synthesized Atts (Synthesized t) a
r = Mapped f a -> f a
forall {k} (f :: k -> *) (a :: k). Mapped f a -> f a
getMapped (forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
getField @name Atts (Synthesized t) a
r)
instance (HasField name (Atts (Synthesized t) a) (Traversed m f a)) => Transformation.At (Traverser t m f name) a where
Traverser t m f name
_ $ :: Traverser t m f name
-> Domain (Traverser t m f name) a
-> Codomain (Traverser t m f name) a
$ Synthesized Atts (Synthesized t) a
r = m (f a) -> Compose m f a
forall {k} {k1} (f :: k -> *) (g :: k1 -> k) (a :: k1).
f (g a) -> Compose f g a
Compose (Traversed m f a -> m (f a)
forall {k} {k} (m :: k -> *) (f :: k -> k) (a :: k).
Traversed m f a -> m (f a)
getTraversed (Traversed m f a -> m (f a)) -> Traversed m f a -> m (f a)
forall a b. (a -> b) -> a -> b
$ forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
getField @name Atts (Synthesized t) a
r)
class GenericSynthesizer t g deep shallow result where
genericSynthesis :: forall a sem. sem ~ Semantics t =>
t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> result a
class GenericSynthesizedField (name :: Symbol) result t g deep shallow where
genericSynthesizedField :: forall a sem. sem ~ Semantics t =>
Proxy name
-> t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> result a
class MayHaveMonoidalField (name :: Symbol) a f where
getMonoidalField :: Proxy name -> f x -> a
class FoundField a f where
getFoundField :: f x -> a
instance {-# overlaps #-} (MayHaveMonoidalField name a x, MayHaveMonoidalField name a y, Semigroup a) =>
MayHaveMonoidalField name a (x :*: y) where
getMonoidalField :: forall (x :: k). Proxy name -> (:*:) x y x -> a
getMonoidalField Proxy name
name (x x
x :*: y x
y) = Proxy name -> x x -> a
forall (x :: k). Proxy name -> x x -> a
forall {k} (name :: Symbol) a (f :: k -> *) (x :: k).
MayHaveMonoidalField name a f =>
Proxy name -> f x -> a
getMonoidalField Proxy name
name x x
x a -> a -> a
forall a. Semigroup a => a -> a -> a
<> Proxy name -> y x -> a
forall (x :: k). Proxy name -> y x -> a
forall {k} (name :: Symbol) a (f :: k -> *) (x :: k).
MayHaveMonoidalField name a f =>
Proxy name -> f x -> a
getMonoidalField Proxy name
name y x
y
instance {-# overlaps #-} TypeError ('Text "Cannot get a single field value from a sum type") =>
MayHaveMonoidalField name a (x :+: y) where
getMonoidalField :: forall (x :: k). Proxy name -> (:+:) x y x -> a
getMonoidalField Proxy name
_ (:+:) x y x
_ = String -> a
forall a. HasCallStack => String -> a
error String
"getMonoidalField on sum type"
instance {-# overlaps #-} FoundField a f => MayHaveMonoidalField name a (M1 i ('MetaSel ('Just name) su ss ds) f) where
getMonoidalField :: forall (x :: k).
Proxy name -> M1 i ('MetaSel ('Just name) su ss ds) f x -> a
getMonoidalField Proxy name
_ (M1 f x
x) = f x -> a
forall (x :: k). f x -> a
forall {k} a (f :: k -> *) (x :: k). FoundField a f => f x -> a
getFoundField f x
x
instance {-# overlaps #-} Monoid a => MayHaveMonoidalField name a (M1 i ('MetaSel 'Nothing su ss ds) f) where
getMonoidalField :: forall (x :: k).
Proxy name -> M1 i ('MetaSel 'Nothing su ss ds) f x -> a
getMonoidalField Proxy name
_ M1 i ('MetaSel 'Nothing su ss ds) f x
_ = a
forall a. Monoid a => a
mempty
instance {-# overlaps #-} MayHaveMonoidalField name a f => MayHaveMonoidalField name a (M1 i ('MetaData n m p nt) f) where
getMonoidalField :: forall (x :: k). Proxy name -> M1 i ('MetaData n m p nt) f x -> a
getMonoidalField Proxy name
name (M1 f x
x) = Proxy name -> f x -> a
forall (x :: k). Proxy name -> f x -> a
forall {k} (name :: Symbol) a (f :: k -> *) (x :: k).
MayHaveMonoidalField name a f =>
Proxy name -> f x -> a
getMonoidalField Proxy name
name f x
x
instance {-# overlaps #-} MayHaveMonoidalField name a f => MayHaveMonoidalField name a (M1 i ('MetaCons n fi s) f) where
getMonoidalField :: forall (x :: k). Proxy name -> M1 i ('MetaCons n fi s) f x -> a
getMonoidalField Proxy name
name (M1 f x
x) = Proxy name -> f x -> a
forall (x :: k). Proxy name -> f x -> a
forall {k} (name :: Symbol) a (f :: k -> *) (x :: k).
MayHaveMonoidalField name a f =>
Proxy name -> f x -> a
getMonoidalField Proxy name
name f x
x
instance {-# overlappable #-} Monoid a => MayHaveMonoidalField name a f where
getMonoidalField :: forall (x :: k). Proxy name -> f x -> a
getMonoidalField Proxy name
_ f x
_ = a
forall a. Monoid a => a
mempty
instance FoundField a f => FoundField a (M1 i j f) where
getFoundField :: forall (x :: k). M1 i j f x -> a
getFoundField (M1 f x
f) = f x -> a
forall (x :: k). f x -> a
forall {k} a (f :: k -> *) (x :: k). FoundField a f => f x -> a
getFoundField f x
f
instance FoundField a (K1 i a) where
getFoundField :: forall (x :: k). K1 i a x -> a
getFoundField (K1 a
a) = a
a
instance (GenericSynthesizer t g deep shallow x, GenericSynthesizer t g deep shallow y) =>
GenericSynthesizer t g deep shallow (x :*: y) where
genericSynthesis :: forall (a :: k) (sem :: * -> *).
(sem ~ Semantics t) =>
t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> (:*:) x y a
genericSynthesis t
t shallow (g deep deep)
node Atts (Inherited t) (g sem sem)
i g sem (Synthesized t)
s = t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> x a
forall (a :: k) (sem :: * -> *).
(sem ~ Semantics t) =>
t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> x a
forall {k} t (g :: (* -> *) -> (* -> *) -> *) (deep :: * -> *)
(shallow :: * -> *) (result :: k -> *) (a :: k) (sem :: * -> *).
(GenericSynthesizer t g deep shallow result, sem ~ Semantics t) =>
t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> result a
genericSynthesis t
t shallow (g deep deep)
node Atts (Inherited t) (g sem sem)
i g sem (Synthesized t)
s x a -> y a -> (:*:) x y a
forall k (f :: k -> *) (g :: k -> *) (p :: k).
f p -> g p -> (:*:) f g p
:*: t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> y a
forall (a :: k) (sem :: * -> *).
(sem ~ Semantics t) =>
t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> y a
forall {k} t (g :: (* -> *) -> (* -> *) -> *) (deep :: * -> *)
(shallow :: * -> *) (result :: k -> *) (a :: k) (sem :: * -> *).
(GenericSynthesizer t g deep shallow result, sem ~ Semantics t) =>
t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> result a
genericSynthesis t
t shallow (g deep deep)
node Atts (Inherited t) (g sem sem)
i g sem (Synthesized t)
s
instance {-# overlappable #-} GenericSynthesizer t g deep shallow f =>
GenericSynthesizer t g deep shallow (M1 i meta f) where
genericSynthesis :: forall (a :: k) (sem :: * -> *).
(sem ~ Semantics t) =>
t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> M1 i meta f a
genericSynthesis t
t shallow (g deep deep)
node Atts (Inherited t) (g sem sem)
i g sem (Synthesized t)
s = f a -> M1 i meta f a
forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 (t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> f a
forall (a :: k) (sem :: * -> *).
(sem ~ Semantics t) =>
t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> f a
forall {k} t (g :: (* -> *) -> (* -> *) -> *) (deep :: * -> *)
(shallow :: * -> *) (result :: k -> *) (a :: k) (sem :: * -> *).
(GenericSynthesizer t g deep shallow result, sem ~ Semantics t) =>
t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> result a
genericSynthesis t
t shallow (g deep deep)
node Atts (Inherited t) (g sem sem)
i g sem (Synthesized t)
s)
instance {-# overlaps #-} GenericSynthesizedField name f t g deep shallow =>
GenericSynthesizer t g deep shallow (M1 i ('MetaSel ('Just name) su ss ds) f) where
genericSynthesis :: forall (a :: k) (sem :: * -> *).
(sem ~ Semantics t) =>
t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> M1 i ('MetaSel ('Just name) su ss ds) f a
genericSynthesis t
t shallow (g deep deep)
node Atts (Inherited t) (g sem sem)
i g sem (Synthesized t)
s = f a -> M1 i ('MetaSel ('Just name) su ss ds) f a
forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 (Proxy name
-> t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> f a
forall (a :: k) (sem :: * -> *).
(sem ~ Semantics t) =>
Proxy name
-> t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> f a
forall {k} (name :: Symbol) (result :: k -> *) t
(g :: (* -> *) -> (* -> *) -> *) (deep :: * -> *)
(shallow :: * -> *) (a :: k) (sem :: * -> *).
(GenericSynthesizedField name result t g deep shallow,
sem ~ Semantics t) =>
Proxy name
-> t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> result a
genericSynthesizedField (Proxy name
forall {k} (t :: k). Proxy t
Proxy :: Proxy name) t
t shallow (g deep deep)
node Atts (Inherited t) (g sem sem)
i g sem (Synthesized t)
s)
instance SynthesizedField name a t g deep shallow => GenericSynthesizedField name (K1 i a) t g deep shallow where
genericSynthesizedField :: forall (a :: k) (sem :: * -> *).
(sem ~ Semantics t) =>
Proxy name
-> t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> K1 i a a
genericSynthesizedField Proxy name
name t
t shallow (g deep deep)
node Atts (Inherited t) (g sem sem)
i g sem (Synthesized t)
s = a -> K1 i a a
forall k i c (p :: k). c -> K1 i c p
K1 (Proxy name
-> t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> a
forall (name :: Symbol) result t (g :: (* -> *) -> (* -> *) -> *)
(deep :: * -> *) (shallow :: * -> *) (sem :: * -> *).
(SynthesizedField name result t g deep shallow,
sem ~ Semantics t) =>
Proxy name
-> t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> result
forall (sem :: * -> *).
(sem ~ Semantics t) =>
Proxy name
-> t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> a
synthesizedField Proxy name
name t
t shallow (g deep deep)
node Atts (Inherited t) (g sem sem)
i g sem (Synthesized t)
s)
instance {-# overlappable #-} (Monoid a, Shallow.Foldable (Accumulator t name a) (g (Semantics t))) =>
SynthesizedField name (Folded a) t g deep shallow where
synthesizedField :: forall (sem :: * -> *).
(sem ~ Semantics t) =>
Proxy name
-> t
-> shallow (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> Folded a
synthesizedField Proxy name
name t
t shallow (g deep deep)
_ Atts (Inherited t) (g sem sem)
_ g sem (Synthesized t)
s = Proxy name -> t -> g sem (Synthesized t) -> Folded a
forall {k} (name :: Symbol) t (g :: k -> (* -> *) -> *) a
(sem :: k).
(Monoid a, Foldable (Accumulator t name a) (g sem)) =>
Proxy name -> t -> g sem (Synthesized t) -> Folded a
foldedField Proxy name
name t
t g sem (Synthesized t)
s
instance {-# overlappable #-} (Functor f, Shallow.Functor (Replicator t f name) (g f),
Atts (Synthesized t) (g (Semantics t) (Semantics t)) ~ Atts (Synthesized t) (g f f)) =>
SynthesizedField name (Mapped f (g f f)) t g deep f where
synthesizedField :: forall (sem :: * -> *).
(sem ~ Semantics t) =>
Proxy name
-> t
-> f (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> Mapped f (g f f)
synthesizedField Proxy name
name t
t f (g deep deep)
local Atts (Inherited t) (g sem sem)
_ g sem (Synthesized t)
s = f (g f f) -> Mapped f (g f f)
forall {k} (f :: k -> *) (a :: k). f a -> Mapped f a
Mapped (Proxy name -> t -> g sem (Synthesized t) -> g f f
forall (name :: Symbol) t (g :: (* -> *) -> (* -> *) -> *)
(f :: * -> *) (sem :: * -> *).
(Functor (Replicator t f name) (g f),
Atts (Synthesized t) (g sem sem) ~ Atts (Synthesized t) (g f f)) =>
Proxy name -> t -> g sem (Synthesized t) -> g f f
mappedField Proxy name
name t
t g sem (Synthesized t)
s g f f -> f (g deep deep) -> f (g f f)
forall a b. a -> f b -> f a
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$ f (g deep deep)
local)
instance {-# overlappable #-} (Traversable f, Applicative m, Shallow.Traversable (Traverser t m f name) (g f),
Atts (Synthesized t) (g (Semantics t) (Semantics t)) ~ Atts (Synthesized t) (g f f)) =>
SynthesizedField name (Traversed m f (g f f)) t g deep f where
synthesizedField :: forall (sem :: * -> *).
(sem ~ Semantics t) =>
Proxy name
-> t
-> f (g deep deep)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> Traversed m f (g f f)
synthesizedField Proxy name
name t
t f (g deep deep)
local Atts (Inherited t) (g sem sem)
_ g sem (Synthesized t)
s = m (f (g f f)) -> Traversed m f (g f f)
forall {k} {k} (m :: k -> *) (f :: k -> k) (a :: k).
m (f a) -> Traversed m f a
Traversed ((g deep deep -> m (g f f)) -> f (g deep deep) -> m (f (g f f))
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> f a -> f (f b)
traverse (m (g f f) -> g deep deep -> m (g f f)
forall a b. a -> b -> a
const (m (g f f) -> g deep deep -> m (g f f))
-> m (g f f) -> g deep deep -> m (g f f)
forall a b. (a -> b) -> a -> b
$ Proxy name -> t -> g sem (Synthesized t) -> m (g f f)
forall (name :: Symbol) t (g :: (* -> *) -> (* -> *) -> *)
(m :: * -> *) (f :: * -> *) (sem :: * -> *).
(Traversable (Traverser t m f name) (g f),
Atts (Synthesized t) (g sem sem) ~ Atts (Synthesized t) (g f f)) =>
Proxy name -> t -> g sem (Synthesized t) -> m (g f f)
traversedField Proxy name
name t
t g sem (Synthesized t)
s) f (g deep deep)
local)
bequestDefault :: forall t g shallow sem.
(sem ~ Semantics t, Domain t ~ shallow, Revelation t,
Shallow.Functor (PassDown t sem (Atts (Inherited t) (g sem sem))) (g sem))
=> t -> shallow (g sem sem) -> Atts (Inherited t) (g sem sem) -> g sem (Synthesized t)
-> g sem (Inherited t)
bequestDefault :: forall t (g :: (* -> *) -> (* -> *) -> *) (shallow :: * -> *)
(sem :: * -> *).
(sem ~ Semantics t, Domain t ~ shallow, Revelation t,
Functor
(PassDown t sem (Atts (Inherited t) (g sem sem))) (g sem)) =>
t
-> shallow (g sem sem)
-> Atts (Inherited t) (g sem sem)
-> g sem (Synthesized t)
-> g sem (Inherited t)
bequestDefault t
t shallow (g sem sem)
local Atts (Inherited t) (g sem sem)
inheritance g sem (Synthesized t)
_synthesized = Atts (Inherited t) (g (Semantics t) (Semantics t))
-> g sem (Semantics t) -> g sem (Inherited t)
forall {k} t (g :: k -> (* -> *) -> *) (shallow :: * -> *)
(deep :: k) atts.
Functor (PassDown t shallow atts) (g deep) =>
atts -> g deep shallow -> g deep (Inherited t)
passDown Atts (Inherited t) (g sem sem)
Atts (Inherited t) (g (Semantics t) (Semantics t))
inheritance (t -> Domain t (g sem (Semantics t)) -> g sem (Semantics t)
forall x. t -> Domain t x -> x
forall t x. Revelation t => t -> Domain t x -> x
reveal t
t shallow (g sem sem)
Domain t (g sem (Semantics t))
local)
passDown :: forall t g shallow deep atts. (Shallow.Functor (PassDown t shallow atts) (g deep)) =>
atts -> g deep shallow -> g deep (Inherited t)
passDown :: forall {k} t (g :: k -> (* -> *) -> *) (shallow :: * -> *)
(deep :: k) atts.
Functor (PassDown t shallow atts) (g deep) =>
atts -> g deep shallow -> g deep (Inherited t)
passDown atts
inheritance g deep shallow
local = atts -> PassDown t shallow atts
forall t (f :: * -> *) a. a -> PassDown t f a
PassDown atts
inheritance PassDown t shallow atts
-> g deep (Domain (PassDown t shallow atts))
-> g deep (Codomain (PassDown t shallow atts))
forall t (g :: (* -> *) -> *).
Functor t g =>
t -> g (Domain t) -> g (Codomain t)
Shallow.<$> g deep shallow
g deep (Domain (PassDown t shallow atts))
local
foldedField :: forall name t g a sem. (Monoid a, Shallow.Foldable (Accumulator t name a) (g sem)) =>
Proxy name -> t -> g sem (Synthesized t) -> Folded a
foldedField :: forall {k} (name :: Symbol) t (g :: k -> (* -> *) -> *) a
(sem :: k).
(Monoid a, Foldable (Accumulator t name a) (g sem)) =>
Proxy name -> t -> g sem (Synthesized t) -> Folded a
foldedField Proxy name
_name t
_t g sem (Synthesized t)
s = Accumulator t name a
-> g sem (Domain (Accumulator t name a)) -> Folded a
forall m.
(Codomain (Accumulator t name a) ~ Const m, Monoid m) =>
Accumulator t name a -> g sem (Domain (Accumulator t name a)) -> m
forall t (g :: (* -> *) -> *) m.
(Foldable t g, Codomain t ~ Const m, Monoid m) =>
t -> g (Domain t) -> m
Shallow.foldMap (Accumulator t name a
forall t (name :: Symbol) a. Accumulator t name a
Accumulator :: Accumulator t name a) g sem (Domain (Accumulator t name a))
g sem (Synthesized t)
s
mappedField :: forall name t g f sem.
(Shallow.Functor (Replicator t f name) (g f),
Atts (Synthesized t) (g sem sem) ~ Atts (Synthesized t) (g f f)) =>
Proxy name -> t -> g sem (Synthesized t) -> g f f
mappedField :: forall (name :: Symbol) t (g :: (* -> *) -> (* -> *) -> *)
(f :: * -> *) (sem :: * -> *).
(Functor (Replicator t f name) (g f),
Atts (Synthesized t) (g sem sem) ~ Atts (Synthesized t) (g f f)) =>
Proxy name -> t -> g sem (Synthesized t) -> g f f
mappedField Proxy name
_name t
_t g sem (Synthesized t)
s = (Replicator t f name
forall t (f :: * -> *) (name :: Symbol). Replicator t f name
Replicator :: Replicator t f name) Replicator t f name
-> g f (Domain (Replicator t f name))
-> g f (Codomain (Replicator t f name))
forall t (g :: (* -> *) -> *).
Functor t g =>
t -> g (Domain t) -> g (Codomain t)
Shallow.<$> (g sem (Synthesized t) -> g f (Synthesized t)
forall a b. a -> b
unsafeCoerce g sem (Synthesized t)
s :: g f (Synthesized t))
traversedField :: forall name t g m f sem.
(Shallow.Traversable (Traverser t m f name) (g f),
Atts (Synthesized t) (g sem sem) ~ Atts (Synthesized t) (g f f)) =>
Proxy name -> t -> g sem (Synthesized t) -> m (g f f)
traversedField :: forall (name :: Symbol) t (g :: (* -> *) -> (* -> *) -> *)
(m :: * -> *) (f :: * -> *) (sem :: * -> *).
(Traversable (Traverser t m f name) (g f),
Atts (Synthesized t) (g sem sem) ~ Atts (Synthesized t) (g f f)) =>
Proxy name -> t -> g sem (Synthesized t) -> m (g f f)
traversedField Proxy name
_name t
_t g sem (Synthesized t)
s = Traverser t m f name
-> g f (Domain (Traverser t m f name)) -> m (g f f)
forall t (g :: (* -> *) -> *) (m :: * -> *) (f :: * -> *).
(Traversable t g, Codomain t ~ Compose m f) =>
t -> g (Domain t) -> m (g f)
forall (m :: * -> *) (f :: * -> *).
(Codomain (Traverser t m f name) ~ Compose m f) =>
Traverser t m f name
-> g f (Domain (Traverser t m f name)) -> m (g f f)
Shallow.traverse (Traverser t m f name
forall t (m :: * -> *) (f :: * -> *) (name :: Symbol).
Traverser t m f name
Traverser :: Traverser t m f name) (g sem (Synthesized t) -> g f (Synthesized t)
forall a b. a -> b
unsafeCoerce g sem (Synthesized t)
s :: g f (Synthesized t))