pandora-0.2.3: A box of patterns and paradigms

Safe HaskellSafe
LanguageHaskell2010

Pandora.Pattern.Functor.Traversable

Synopsis

Documentation

class Covariant t => Traversable t where Source #

Let f :: (Applicative t, Applicative g) => t a -> u a
Let p :: (Pointable t, Pointable g) => t a -> u a
When providing a new instance, you should ensure it satisfies the four laws:
* Naturality of traversing: g . traverse f ≡ traverse (g . f)
* Naturality of sequencing: f . sequence = sequence . comap f
* Preserving point: p (point x) ≡ point x
* Preserving apply: f (x <*> y) ≡ f x <*> f y

Minimal complete definition

(->>)

Methods

(->>) :: (Pointable u, Applicative u) => t a -> (a -> u b) -> (u :. t) := b infixl 5 Source #

Infix version of traverse

traverse :: (Pointable u, Applicative u) => (a -> u b) -> t a -> (u :. t) := b Source #

Prefix version of ->>

sequence :: (Pointable u, Applicative u) => ((t :. u) := a) -> (u :. t) := a Source #

The dual of distribute

(->>>) :: (Pointable u, Applicative u, Traversable v) => ((v :. t) := a) -> (a -> u b) -> (u :. (v :. t)) := b infixl 5 Source #

Infix versions of traverse with various nesting levels

(->>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w) => ((w :. (v :. t)) := a) -> (a -> u b) -> (u :. (w :. (v :. t))) := b infixl 5 Source #

(->>>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w, Traversable j) => ((j :. (w :. (v :. t))) := a) -> (a -> u b) -> (u :. (j :. (w :. (v :. t)))) := b infixl 5 Source #

Instances
Traversable Wye Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Wye

Methods

(->>) :: (Pointable u, Applicative u) => Wye a -> (a -> u b) -> (u :. Wye) := b Source #

traverse :: (Pointable u, Applicative u) => (a -> u b) -> Wye a -> (u :. Wye) := b Source #

sequence :: (Pointable u, Applicative u) => ((Wye :. u) := a) -> (u :. Wye) := a Source #

(->>>) :: (Pointable u, Applicative u, Traversable v) => ((v :. Wye) := a) -> (a -> u b) -> (u :. (v :. Wye)) := b Source #

(->>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w) => ((w :. (v :. Wye)) := a) -> (a -> u b) -> (u :. (w :. (v :. Wye))) := b Source #

(->>>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w, Traversable j) => ((j :. (w :. (v :. Wye))) := a) -> (a -> u b) -> (u :. (j :. (w :. (v :. Wye)))) := b Source #

Traversable Edges Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Edges

Methods

(->>) :: (Pointable u, Applicative u) => Edges a -> (a -> u b) -> (u :. Edges) := b Source #

traverse :: (Pointable u, Applicative u) => (a -> u b) -> Edges a -> (u :. Edges) := b Source #

sequence :: (Pointable u, Applicative u) => ((Edges :. u) := a) -> (u :. Edges) := a Source #

(->>>) :: (Pointable u, Applicative u, Traversable v) => ((v :. Edges) := a) -> (a -> u b) -> (u :. (v :. Edges)) := b Source #

(->>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w) => ((w :. (v :. Edges)) := a) -> (a -> u b) -> (u :. (w :. (v :. Edges))) := b Source #

(->>>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w, Traversable j) => ((j :. (w :. (v :. Edges))) := a) -> (a -> u b) -> (u :. (j :. (w :. (v :. Edges)))) := b Source #

Traversable Maybe Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Maybe

Methods

(->>) :: (Pointable u, Applicative u) => Maybe a -> (a -> u b) -> (u :. Maybe) := b Source #

traverse :: (Pointable u, Applicative u) => (a -> u b) -> Maybe a -> (u :. Maybe) := b Source #

sequence :: (Pointable u, Applicative u) => ((Maybe :. u) := a) -> (u :. Maybe) := a Source #

(->>>) :: (Pointable u, Applicative u, Traversable v) => ((v :. Maybe) := a) -> (a -> u b) -> (u :. (v :. Maybe)) := b Source #

(->>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w) => ((w :. (v :. Maybe)) := a) -> (a -> u b) -> (u :. (w :. (v :. Maybe))) := b Source #

(->>>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w, Traversable j) => ((j :. (w :. (v :. Maybe))) := a) -> (a -> u b) -> (u :. (j :. (w :. (v :. Maybe)))) := b Source #

Traversable Identity Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Identity

Methods

(->>) :: (Pointable u, Applicative u) => Identity a -> (a -> u b) -> (u :. Identity) := b Source #

traverse :: (Pointable u, Applicative u) => (a -> u b) -> Identity a -> (u :. Identity) := b Source #

sequence :: (Pointable u, Applicative u) => ((Identity :. u) := a) -> (u :. Identity) := a Source #

(->>>) :: (Pointable u, Applicative u, Traversable v) => ((v :. Identity) := a) -> (a -> u b) -> (u :. (v :. Identity)) := b Source #

(->>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w) => ((w :. (v :. Identity)) := a) -> (a -> u b) -> (u :. (w :. (v :. Identity))) := b Source #

(->>>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w, Traversable j) => ((j :. (w :. (v :. Identity))) := a) -> (a -> u b) -> (u :. (j :. (w :. (v :. Identity)))) := b Source #

Traversable (Variation e) Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Variation

Methods

(->>) :: (Pointable u, Applicative u) => Variation e a -> (a -> u b) -> (u :. Variation e) := b Source #

traverse :: (Pointable u, Applicative u) => (a -> u b) -> Variation e a -> (u :. Variation e) := b Source #

sequence :: (Pointable u, Applicative u) => ((Variation e :. u) := a) -> (u :. Variation e) := a Source #

(->>>) :: (Pointable u, Applicative u, Traversable v) => ((v :. Variation e) := a) -> (a -> u b) -> (u :. (v :. Variation e)) := b Source #

(->>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w) => ((w :. (v :. Variation e)) := a) -> (a -> u b) -> (u :. (w :. (v :. Variation e))) := b Source #

(->>>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w, Traversable j) => ((j :. (w :. (v :. Variation e))) := a) -> (a -> u b) -> (u :. (j :. (w :. (v :. Variation e)))) := b Source #

Traversable t => Traversable (Jet t) Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Jet

Methods

(->>) :: (Pointable u, Applicative u) => Jet t a -> (a -> u b) -> (u :. Jet t) := b Source #

traverse :: (Pointable u, Applicative u) => (a -> u b) -> Jet t a -> (u :. Jet t) := b Source #

sequence :: (Pointable u, Applicative u) => ((Jet t :. u) := a) -> (u :. Jet t) := a Source #

(->>>) :: (Pointable u, Applicative u, Traversable v) => ((v :. Jet t) := a) -> (a -> u b) -> (u :. (v :. Jet t)) := b Source #

(->>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w) => ((w :. (v :. Jet t)) := a) -> (a -> u b) -> (u :. (w :. (v :. Jet t))) := b Source #

(->>>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w, Traversable j) => ((j :. (w :. (v :. Jet t))) := a) -> (a -> u b) -> (u :. (j :. (w :. (v :. Jet t)))) := b Source #

Traversable t => Traversable (Free t) Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Free

Methods

(->>) :: (Pointable u, Applicative u) => Free t a -> (a -> u b) -> (u :. Free t) := b Source #

traverse :: (Pointable u, Applicative u) => (a -> u b) -> Free t a -> (u :. Free t) := b Source #

sequence :: (Pointable u, Applicative u) => ((Free t :. u) := a) -> (u :. Free t) := a Source #

(->>>) :: (Pointable u, Applicative u, Traversable v) => ((v :. Free t) := a) -> (a -> u b) -> (u :. (v :. Free t)) := b Source #

(->>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w) => ((w :. (v :. Free t)) := a) -> (a -> u b) -> (u :. (w :. (v :. Free t))) := b Source #

(->>>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w, Traversable j) => ((j :. (w :. (v :. Free t))) := a) -> (a -> u b) -> (u :. (j :. (w :. (v :. Free t)))) := b Source #

Traversable (Validation e) Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Validation

Methods

(->>) :: (Pointable u, Applicative u) => Validation e a -> (a -> u b) -> (u :. Validation e) := b Source #

traverse :: (Pointable u, Applicative u) => (a -> u b) -> Validation e a -> (u :. Validation e) := b Source #

sequence :: (Pointable u, Applicative u) => ((Validation e :. u) := a) -> (u :. Validation e) := a Source #

(->>>) :: (Pointable u, Applicative u, Traversable v) => ((v :. Validation e) := a) -> (a -> u b) -> (u :. (v :. Validation e)) := b Source #

(->>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w) => ((w :. (v :. Validation e)) := a) -> (a -> u b) -> (u :. (w :. (v :. Validation e))) := b Source #

(->>>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w, Traversable j) => ((j :. (w :. (v :. Validation e))) := a) -> (a -> u b) -> (u :. (j :. (w :. (v :. Validation e)))) := b Source #

Traversable t => Traversable (Twister t) Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Twister

Methods

(->>) :: (Pointable u, Applicative u) => Twister t a -> (a -> u b) -> (u :. Twister t) := b Source #

traverse :: (Pointable u, Applicative u) => (a -> u b) -> Twister t a -> (u :. Twister t) := b Source #

sequence :: (Pointable u, Applicative u) => ((Twister t :. u) := a) -> (u :. Twister t) := a Source #

(->>>) :: (Pointable u, Applicative u, Traversable v) => ((v :. Twister t) := a) -> (a -> u b) -> (u :. (v :. Twister t)) := b Source #

(->>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w) => ((w :. (v :. Twister t)) := a) -> (a -> u b) -> (u :. (w :. (v :. Twister t))) := b Source #

(->>>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w, Traversable j) => ((j :. (w :. (v :. Twister t))) := a) -> (a -> u b) -> (u :. (j :. (w :. (v :. Twister t)))) := b Source #

Traversable (Product a) Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Product

Methods

(->>) :: (Pointable u, Applicative u) => Product a a0 -> (a0 -> u b) -> (u :. Product a) := b Source #

traverse :: (Pointable u, Applicative u) => (a0 -> u b) -> Product a a0 -> (u :. Product a) := b Source #

sequence :: (Pointable u, Applicative u) => ((Product a :. u) := a0) -> (u :. Product a) := a0 Source #

(->>>) :: (Pointable u, Applicative u, Traversable v) => ((v :. Product a) := a0) -> (a0 -> u b) -> (u :. (v :. Product a)) := b Source #

(->>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w) => ((w :. (v :. Product a)) := a0) -> (a0 -> u b) -> (u :. (w :. (v :. Product a))) := b Source #

(->>>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w, Traversable j) => ((j :. (w :. (v :. Product a))) := a0) -> (a0 -> u b) -> (u :. (j :. (w :. (v :. Product a)))) := b Source #

Traversable t => Traversable (Jack t) Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Jack

Methods

(->>) :: (Pointable u, Applicative u) => Jack t a -> (a -> u b) -> (u :. Jack t) := b Source #

traverse :: (Pointable u, Applicative u) => (a -> u b) -> Jack t a -> (u :. Jack t) := b Source #

sequence :: (Pointable u, Applicative u) => ((Jack t :. u) := a) -> (u :. Jack t) := a Source #

(->>>) :: (Pointable u, Applicative u, Traversable v) => ((v :. Jack t) := a) -> (a -> u b) -> (u :. (v :. Jack t)) := b Source #

(->>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w) => ((w :. (v :. Jack t)) := a) -> (a -> u b) -> (u :. (w :. (v :. Jack t))) := b Source #

(->>>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w, Traversable j) => ((j :. (w :. (v :. Jack t))) := a) -> (a -> u b) -> (u :. (j :. (w :. (v :. Jack t)))) := b Source #

Traversable (Conclusion e) Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Conclusion

Methods

(->>) :: (Pointable u, Applicative u) => Conclusion e a -> (a -> u b) -> (u :. Conclusion e) := b Source #

traverse :: (Pointable u, Applicative u) => (a -> u b) -> Conclusion e a -> (u :. Conclusion e) := b Source #

sequence :: (Pointable u, Applicative u) => ((Conclusion e :. u) := a) -> (u :. Conclusion e) := a Source #

(->>>) :: (Pointable u, Applicative u, Traversable v) => ((v :. Conclusion e) := a) -> (a -> u b) -> (u :. (v :. Conclusion e)) := b Source #

(->>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w) => ((w :. (v :. Conclusion e)) := a) -> (a -> u b) -> (u :. (w :. (v :. Conclusion e))) := b Source #

(->>>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w, Traversable j) => ((j :. (w :. (v :. Conclusion e))) := a) -> (a -> u b) -> (u :. (j :. (w :. (v :. Conclusion e)))) := b Source #

Traversable (Schematic Monad t u) => Traversable (t :> u) Source # 
Instance details

Defined in Pandora.Paradigm.Controlflow.Joint.Transformer.Monadic

Methods

(->>) :: (Pointable u0, Applicative u0) => (t :> u) a -> (a -> u0 b) -> (u0 :. (t :> u)) := b Source #

traverse :: (Pointable u0, Applicative u0) => (a -> u0 b) -> (t :> u) a -> (u0 :. (t :> u)) := b Source #

sequence :: (Pointable u0, Applicative u0) => (((t :> u) :. u0) := a) -> (u0 :. (t :> u)) := a Source #

(->>>) :: (Pointable u0, Applicative u0, Traversable v) => ((v :. (t :> u)) := a) -> (a -> u0 b) -> (u0 :. (v :. (t :> u))) := b Source #

(->>>>) :: (Pointable u0, Applicative u0, Traversable v, Traversable w) => ((w :. (v :. (t :> u))) := a) -> (a -> u0 b) -> (u0 :. (w :. (v :. (t :> u)))) := b Source #

(->>>>>) :: (Pointable u0, Applicative u0, Traversable v, Traversable w, Traversable j) => ((j :. (w :. (v :. (t :> u)))) := a) -> (a -> u0 b) -> (u0 :. (j :. (w :. (v :. (t :> u))))) := b Source #

Traversable (Schematic Comonad t u) => Traversable (t :< u) Source # 
Instance details

Defined in Pandora.Paradigm.Controlflow.Joint.Transformer.Comonadic

Methods

(->>) :: (Pointable u0, Applicative u0) => (t :< u) a -> (a -> u0 b) -> (u0 :. (t :< u)) := b Source #

traverse :: (Pointable u0, Applicative u0) => (a -> u0 b) -> (t :< u) a -> (u0 :. (t :< u)) := b Source #

sequence :: (Pointable u0, Applicative u0) => (((t :< u) :. u0) := a) -> (u0 :. (t :< u)) := a Source #

(->>>) :: (Pointable u0, Applicative u0, Traversable v) => ((v :. (t :< u)) := a) -> (a -> u0 b) -> (u0 :. (v :. (t :< u))) := b Source #

(->>>>) :: (Pointable u0, Applicative u0, Traversable v, Traversable w) => ((w :. (v :. (t :< u))) := a) -> (a -> u0 b) -> (u0 :. (w :. (v :. (t :< u)))) := b Source #

(->>>>>) :: (Pointable u0, Applicative u0, Traversable v, Traversable w, Traversable j) => ((j :. (w :. (v :. (t :< u)))) := a) -> (a -> u0 b) -> (u0 :. (j :. (w :. (v :. (t :< u))))) := b Source #

Traversable (Tagged tag) Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Tagged

Methods

(->>) :: (Pointable u, Applicative u) => Tagged tag a -> (a -> u b) -> (u :. Tagged tag) := b Source #

traverse :: (Pointable u, Applicative u) => (a -> u b) -> Tagged tag a -> (u :. Tagged tag) := b Source #

sequence :: (Pointable u, Applicative u) => ((Tagged tag :. u) := a) -> (u :. Tagged tag) := a Source #

(->>>) :: (Pointable u, Applicative u, Traversable v) => ((v :. Tagged tag) := a) -> (a -> u b) -> (u :. (v :. Tagged tag)) := b Source #

(->>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w) => ((w :. (v :. Tagged tag)) := a) -> (a -> u b) -> (u :. (w :. (v :. Tagged tag))) := b Source #

(->>>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w, Traversable j) => ((j :. (w :. (v :. Tagged tag))) := a) -> (a -> u b) -> (u :. (j :. (w :. (v :. Tagged tag)))) := b Source #

Traversable (Constant a :: Type -> Type) Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Constant

Methods

(->>) :: (Pointable u, Applicative u) => Constant a a0 -> (a0 -> u b) -> (u :. Constant a) := b Source #

traverse :: (Pointable u, Applicative u) => (a0 -> u b) -> Constant a a0 -> (u :. Constant a) := b Source #

sequence :: (Pointable u, Applicative u) => ((Constant a :. u) := a0) -> (u :. Constant a) := a0 Source #

(->>>) :: (Pointable u, Applicative u, Traversable v) => ((v :. Constant a) := a0) -> (a0 -> u b) -> (u :. (v :. Constant a)) := b Source #

(->>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w) => ((w :. (v :. Constant a)) := a0) -> (a0 -> u b) -> (u :. (w :. (v :. Constant a))) := b Source #

(->>>>>) :: (Pointable u, Applicative u, Traversable v, Traversable w, Traversable j) => ((j :. (w :. (v :. Constant a))) := a0) -> (a0 -> u b) -> (u :. (j :. (w :. (v :. Constant a)))) := b Source #

Traversable (UT Covariant Covariant (Twister Edges) Edges) Source # 
Instance details

Defined in Pandora.Paradigm.Structure.Specific.Graph

Traversable (UT Covariant Covariant (Twister Maybe) Maybe) Source # 
Instance details

Defined in Pandora.Paradigm.Structure.Specific.Stack