-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | API for hierarchical multilevel collections.
--   
--   Two-argument typeclass that generalizes Foldable, Functor, and
--   Traversable for monomorphic multi-level collections. Transitive
--   instances allow for folding and mapping over any subordinate level of
--   the hierarchy.
--   
--   Main interface for hPDB library.
--   
--   Contains convenience TemplateHaskell methods for generating Iterable
--   instances that have Vector containers.
@package iterable
@version 3.0


-- | Declares Iterable class for handling multi-level, heterogeneous,
--   monomorphic collections that allow nested iteration.
module Data.Iterable

-- | Class for iterating all nested components <tt>b</tt> of type
--   <tt>a</tt>.
class Iterable a b
itmapM :: (Iterable a b, Monad m) => (b -> m b) -> a -> m a
itmap :: Iterable a b => (b -> b) -> a -> a
itfoldM :: (Iterable a b, Monad m) => (c -> b -> m c) -> c -> a -> m c
itfoldr :: Iterable a b => (b -> c -> c) -> c -> a -> c
itfoldl :: Iterable a b => (c -> b -> c) -> c -> a -> c
itfoldl' :: Iterable a b => (c -> b -> c) -> c -> a -> c
itlength :: Iterable a b => Proxy b -> a -> Int


-- | Helpers for instantiating transitive and reflexive instances of
--   Iterable.
module Data.Iterable.Instantiate

-- | Generates convenience function for iterating over a single object.
--   self_iterable typA = gen_iterable typA typA [e| id |] [e| L.singleton
--   |]
self_iterable :: TypeQ -> DecsQ

-- | Generates a transitive instance of <a>Iterable</a> between $typA and
--   $typC, assuming existence of <a>Iterable</a> $typA $typB, and
--   <a>Iterable</a> $typB $typC.
trans_iterable :: TypeQ -> TypeQ -> TypeQ -> DecsQ


-- | Helpers for instantiating Iterable for types with Vector containers.
module Data.Iterable.Instantiate.Vector

-- | Generates a direct instance of iterable between $typA and $typB with
--   given names of getter and setter, so that: $getter :: $typA -&gt;
--   $typB $setter :: $typB -&gt; $typA -&gt; $typA
gen_vector_iterable :: TypeQ -> TypeQ -> ExpQ -> ExpQ -> DecsQ
