Obtain the base functor for a recursive datatype.
The core idea of this library is that instead of writing recursive functions on a recursive datatype, we prefer to write non-recursive functions on a related, non-recursive datatype we call the "base functor".
For example, [a] is a recursive type, and its corresponding base functor is
ListF a:
data ListF a b = Nil | Cons a b
type instance Base [a] = ListF a
The relationship between those two types is that if we replace b with
ListF a, we obtain a type which is isomorphic to [a].
Instances14Base, …
type Base Natural = MaybeDefined in recursion-schemes-5.2.3 · Data.Functor.Foldabletype Base (Tree a) = TreeF aDefined in recursion-schemes-5.2.3 · Data.Functor.Foldabletype Base (Fix f) = fDefined in recursion-schemes-5.2.3 · Data.Functor.Foldabletype Base (Mu f) = fDefined in recursion-schemes-5.2.3 · Data.Functor.Foldabletype Base (Nu f) = fDefined in recursion-schemes-5.2.3 · Data.Functor.Foldabletype Base (Cofree f a) = CofreeF f aDefined in recursion-schemes-5.2.3 · Data.Functor.FoldableCofree comonads are Recursive/Corecursive
type Base (CofreeT f w a) = Compose w (CofreeF f a)Defined in recursion-schemes-5.2.3 · Data.Functor.FoldableCofree tranformations of comonads are Recursive/Corecusive
type Base (Free f a) = FreeF f aDefined in recursion-schemes-5.2.3 · Data.Functor.FoldableFree monads are Recursive/Corecursive
type Base (F f a) = FreeF f aDefined in recursion-schemes-5.2.3 · Data.Functor.FoldableChurch encoded free monads are Recursive/Corecursive, in the same way that Mu is.
type Base (FreeT f m a) = Compose m (FreeF f a)Defined in recursion-schemes-5.2.3 · Data.Functor.FoldableFree transformations of monads are Recursive/Corecursive
type Base (NonEmpty a) = NonEmptyF aDefined in recursion-schemes-5.2.3 · Data.Functor.Foldabletype Base (Either a b) = Const (Either a b)Defined in recursion-schemes-5.2.3 · Data.Functor.FoldableExample boring stub for non-recursive data types
type Base (Maybe a) = Const (Maybe a)Defined in recursion-schemes-5.2.3 · Data.Functor.FoldableExample boring stub for non-recursive data types
type Base [a] = ListF aDefined in recursion-schemes-5.2.3 · Data.Functor.Foldable