weave-core
Safe HaskellSafe-Inferred
LanguageHaskell2010

Weave.Lazy

Description

Lazy weaves enable linear-time implementations of breadth-first unfolds.

Synopsis

Documentation

data Weave (m :: Type -> Type) a where Source #

Lazy weaves.

The Applicative operation (liftA2) combines weaves level-wise.

Constructors

Pure :: forall a (m :: Type -> Type). a -> Weave m a 
Weft :: forall (m :: Type -> Type) b a. m (Weave m b) -> (b -> a) -> Weave m a 

Instances

Instances details
Applicative m => Applicative (Weave m) Source # 
Instance details

Defined in Weave.Lazy

Methods

pure :: a -> Weave m a #

(<*>) :: Weave m (a -> b) -> Weave m a -> Weave m b #

liftA2 :: (a -> b -> c) -> Weave m a -> Weave m b -> Weave m c #

(*>) :: Weave m a -> Weave m b -> Weave m b #

(<*) :: Weave m a -> Weave m b -> Weave m a #

Functor (Weave m) Source # 
Instance details

Defined in Weave.Lazy

Methods

fmap :: (a -> b) -> Weave m a -> Weave m b #

(<$) :: a -> Weave m b -> Weave m a #

weft :: m (Weave m a) -> Weave m a Source #

A weft is one level of Weave. It is a computation which returns the remaining levels.

mesh :: Monad m => Weave m a -> m a Source #

Run all the wefts in a Weave sequentially.