srtree-1.0.0.3: A general framework to work with Symbolic Regression expression trees.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.SRTree.Recursion

Documentation

data ListF a b Source #

Constructors

NilF 
ConsF a b 

Instances

Instances details
Functor (ListF a) Source # 
Instance details

Defined in Data.SRTree.Recursion

Methods

fmap :: (a0 -> b) -> ListF a a0 -> ListF a b #

(<$) :: a0 -> ListF a b -> ListF a a0 #

data NatF a Source #

Constructors

ZeroF 
SuccF a 

Instances

Instances details
Functor NatF Source # 
Instance details

Defined in Data.SRTree.Recursion

Methods

fmap :: (a -> b) -> NatF a -> NatF b #

(<$) :: a -> NatF b -> NatF a #

data StreamF a b Source #

Constructors

StreamF a b 

Instances

Instances details
Functor (StreamF a) Source # 
Instance details

Defined in Data.SRTree.Recursion

Methods

fmap :: (a0 -> b) -> StreamF a a0 -> StreamF a b #

(<$) :: a0 -> StreamF a b -> StreamF a a0 #

data TreeF a b Source #

Constructors

LeafF 
NodeF b a b 

Instances

Instances details
Functor (TreeF a) Source # 
Instance details

Defined in Data.SRTree.Recursion

Methods

fmap :: (a0 -> b) -> TreeF a a0 -> TreeF a b #

(<$) :: a0 -> TreeF a b -> TreeF a a0 #

newtype Fix f Source #

Constructors

Fix 

Fields

type Algebra f a = f a -> a Source #

type CoAlgebra f a = a -> f a Source #

data Cofree f a Source #

Constructors

a :< (f (Cofree f a)) 

data Free f a Source #

Constructors

Ret a 
Op (f (Free f a)) 

extract :: Cofree f a -> a Source #

unOp :: Free f a -> f (Free f a) Source #

cata :: Functor f => (f a -> a) -> Fix f -> a Source #

cataM :: (Functor f, Monad m) => (forall x. f (m x) -> m (f x)) -> (f a -> m a) -> Fix f -> m a Source #

ana :: Functor f => (a -> f a) -> a -> Fix f Source #

hylo :: Functor f => (f b -> b) -> (a -> f a) -> a -> b Source #

para :: Functor f => (f (Fix f, a) -> a) -> Fix f -> a Source #

mutu :: Functor f => (f (a, b) -> a) -> (f (a, b) -> b) -> (Fix f -> a, Fix f -> b) Source #

apo :: Functor f => (a -> f (Either (Fix f) a)) -> a -> Fix f Source #

accu :: Functor f => (forall x. f x -> p -> f (x, p)) -> (f a -> p -> a) -> Fix f -> p -> a Source #

histo :: Functor f => (f (Cofree f a) -> a) -> Fix f -> a Source #

futu :: Functor f => (a -> f (Free f a)) -> a -> Fix f Source #

chrono :: Functor f => (f (Cofree f b) -> b) -> (a -> f (Free f a)) -> a -> b Source #

fromList :: [a] -> Fix (ListF a) Source #

toList :: Fix (ListF a) -> [a] Source #

stream2list :: StreamF a [a] -> [a] Source #