Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module contains the instances and definitions
supporting Multiwalk
module, along with
the combinators for writing MultiSub
instances.
Synopsis
- type family AllMods (p :: Type -> Constraint) (as :: Spec) :: Constraint where ...
- type family All (p :: k -> Constraint) (as :: [k]) :: Constraint where ...
- data GSubTag
- data SelSpec
- data SubSpec = SubSpec SelSpec Type Type
- data Spec
- data Under (b :: Type) (s :: SelSpec) (a :: Type)
- data MatchWith (s :: Type) (a :: Type)
- data Trav (k :: Type -> Type) (a :: Type)
- class TContains (fs :: [Type]) (t :: Type) where
- tGetW :: Applicative m => FList m fs -> ContainsCarrier t -> m (ContainsCarrier t)
- tGetQ :: Monoid m => QList m fs -> ContainsCarrier t -> m
- class FContains (l :: [Type]) (t :: Type) where
- data FList :: (Type -> Type) -> [Type] -> Type where
- class QContains (l :: [Type]) (t :: Type) where
- data QList :: Type -> [Type] -> Type where
- type ToSpecSel s a = ToSpecSel MWCTag s a
- type ToSpec a = ToSpec MWCTag a
- type Carrier a = Carrier MWCTag a
- type HasSub tag ls t = HasSub MWCTag tag ls t
- type family ContainsCarrier (a :: Type) :: Type where ...
- data MWCTag
- modSubWithFList :: forall tag ls t fs m. (HasSub tag ls t, Applicative m, AllMods (TContains fs) ls) => FList m fs -> t -> m t
- getSubWithQList :: forall tag ls t fs m. (HasSub tag ls t, Monoid m, AllMods (TContains fs) ls) => QList m fs -> t -> m
Documentation
type family AllMods (p :: Type -> Constraint) (as :: Spec) :: Constraint where ... Source #
type family All (p :: k -> Constraint) (as :: [k]) :: Constraint where ... Source #
Instances
(Generic t, HasSub' ctag (l ': ls) ('Nothing :: Maybe Symbol) ('Nothing :: Maybe Symbol) (Rep t)) => HasSub ctag GSubTag ('SpecList (l ': ls)) t Source # | |
Defined in Control.MultiWalk.HasSub modSub :: forall c m. (Applicative m, AllMods c ('SpecList (l ': ls))) => Proxy c -> (forall s. c s => Proxy s -> Carrier ctag s -> m (Carrier ctag s)) -> t -> m t Source # getSub :: forall c m. (Monoid m, AllMods c ('SpecList (l ': ls))) => Proxy c -> (forall s. c s => Proxy s -> Carrier ctag s -> m) -> t -> m Source # |
Instances
(Generic t, HasSub' ctag (l ': ls) ('Nothing :: Maybe Symbol) ('Nothing :: Maybe Symbol) (Rep t)) => HasSub ctag GSubTag ('SpecList (l ': ls)) t Source # | |
Defined in Control.MultiWalk.HasSub modSub :: forall c m. (Applicative m, AllMods c ('SpecList (l ': ls))) => Proxy c -> (forall s. c s => Proxy s -> Carrier ctag s -> m (Carrier ctag s)) -> t -> m t Source # getSub :: forall c m. (Monoid m, AllMods c ('SpecList (l ': ls))) => Proxy c -> (forall s. c s => Proxy s -> Carrier ctag s -> m) -> t -> m Source # |
data Under (b :: Type) (s :: SelSpec) (a :: Type) Source #
Use this for matching a subcomponent nested inside another type. Useful if you don't want to add the middle type to the list of walkable types.
Instances
(TContains fs a, HasSub GSubTag ('SpecList '['SubSpec s a (Carrier a)]) b) => TContains fs (Under b s a) Source # | |
Defined in Control.MultiWalk.Contains tGetW :: Applicative m => FList m fs -> ContainsCarrier (Under b s a) -> m (ContainsCarrier (Under b s a)) Source # tGetQ :: Monoid m => QList m fs -> ContainsCarrier (Under b s a) -> m Source # |
data MatchWith (s :: Type) (a :: Type) Source #
Use this for matching with another type that is coercible to the type you want.
Instances
(TContains fs a, Coercible (Carrier a) s) => TContains fs (MatchWith s a) Source # | |
Defined in Control.MultiWalk.Contains tGetW :: Applicative m => FList m fs -> ContainsCarrier (MatchWith s a) -> m (ContainsCarrier (MatchWith s a)) Source # tGetQ :: Monoid m => QList m fs -> ContainsCarrier (MatchWith s a) -> m Source # |
data Trav (k :: Type -> Type) (a :: Type) Source #
Use this for matching with a type inside a traversable functor.
Instances
(Traversable f, TContains fs a) => TContains fs (Trav f a) Source # | |
Defined in Control.MultiWalk.Contains tGetW :: Applicative m => FList m fs -> ContainsCarrier (Trav f a) -> m (ContainsCarrier (Trav f a)) Source # tGetQ :: Monoid m => QList m fs -> ContainsCarrier (Trav f a) -> m Source # |
class TContains (fs :: [Type]) (t :: Type) where Source #
Auxiliary class that keeps track of how retrieve queries and walks from their lists and apply them according to the combinators.
tGetW :: Applicative m => FList m fs -> ContainsCarrier t -> m (ContainsCarrier t) Source #
tGetQ :: Monoid m => QList m fs -> ContainsCarrier t -> m Source #
Instances
data FList :: (Type -> Type) -> [Type] -> Type where Source #
Heterogeneous list of monadic-valued functions
type family ContainsCarrier (a :: Type) :: Type where ... Source #
ContainsCarrier (Under b s a) = b | |
ContainsCarrier (MatchWith s a) = s | |
ContainsCarrier (Trav f a) = f (Carrier a) | |
ContainsCarrier a = a |
Instances
type Carrier MWCTag a Source # | |
Defined in Control.MultiWalk.Contains | |
type Carrier MWCTag a Source # | |
Defined in Control.MultiWalk.Contains |
modSubWithFList :: forall tag ls t fs m. (HasSub tag ls t, Applicative m, AllMods (TContains fs) ls) => FList m fs -> t -> m t Source #
Modify (only) substructures by applying functions from FList
.