yaya-0.4.2.1: Total recursion schemes.
Safe HaskellSafe-Inferred
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.

absurd :: Recursive (->) t Identity => t -> a Source #

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

zeroN :: Steppable (->) t Maybe => t Source #

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

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

naturals :: (Steppable (->) n Maybe, Corecursive (->) t ((,) n)) => t 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.

at :: (Recursive (->) n Maybe, Projectable (->) s ((,) a)) => n -> s -> a Source #

Extracts the element at a finite index of an infinite sequence (a !! that can't fail).

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

Extracts the element at a finite index of a (co)list (a !! that fails with Nothing).

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 #

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

fibonacci :: Corecursive (->) t ((,) Int) => t 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 #

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

mersenne :: (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.