yaya-0.2.1.0: Total recursion schemes.

Safe HaskellSafe
LanguageHaskell2010

Yaya.Applied

Synopsis

Documentation

now :: Steppable t (Either a) => a -> t Source #

runToEnd :: Recursive t (Either a) => t -> a Source #

This will collapse all the intermediate steps to get to the value that must exist at the end.

fromMaybe :: (Steppable t (Either a), Corecursive t (Either a)) => Maybe a -> t Source #

Converts exceptional divergence to non-termination.

vacuous :: (Functor f, Recursive t Identity) => f t -> f a Source #

succN :: Steppable t Maybe => t -> t Source #

height :: (Foldable f, Steppable n Maybe, Ord n) => f n -> n Source #

takeUpTo :: (Recursive n Maybe, Projectable s (XNor a), Steppable l (XNor a)) => n -> s -> l Source #

Extracts _no more than_ n elements from the possibly-infinite sequence s.

take :: (Recursive n Maybe, Projectable s ((,) a), Steppable l (XNor a)) => n -> s -> l Source #

Extracts _exactly_ n elements from the infinite stream s.

maybeReify :: (Projectable s f, Steppable l (FreeF f s), Functor f) => Algebra Maybe (s -> l) Source #

Turns part of a structure inductive, so it can be analyzed, without forcing the entire tree.

reifyUpTo :: (Recursive n Maybe, Projectable s f, Steppable l (FreeF f s), Functor f) => n -> s -> l Source #

lucasSequenceU :: (Integral i, Corecursive t ((,) i)) => i -> i -> t Source #

lucasSequenceV :: (Integral i, Corecursive t ((,) i)) => i -> i -> t Source #

lucas :: Integral i => Corecursive t ((,) i) => t Source #

pell :: (Integral i, Corecursive t ((,) i)) => t Source #

constantly :: Corecursive t ((,) a) => a -> t Source #

Creates an infinite stream of the provided value.

truncate :: (Recursive n Maybe, Projectable t f, Steppable u (FreeF f ()), Functor f) => n -> t -> u Source #

Lops off the branches of the tree below a certain depth, turning a potentially-infinite structure into a finite one. Like a generalized take.