| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Yaya.Retrofit
Description
This module re-exports a subset of Fold, intended for when you want
to define recursion scheme instances for your existing recursive types.
Synopsis
- class Corecursive c t f | t -> f where
- class Recursive c t f | t -> f where
- class Projectable c t f => Steppable c t f | t -> f where
- class Projectable c t f | t -> f where
- recursiveEq :: (Recursive (->) t f, Steppable (->) u f, Functor f, Foldable f, Eq1 f) => t -> u -> Bool
- recursiveShowsPrec :: (Recursive (->) t f, Show1 f) => Int -> t -> ShowS
Documentation
class Corecursive c t f | t -> f where Source #
Coinductive (potentially-infinite) structures that guarantee _productivity_ rather than termination.
Instances
| Corecursive ((->) :: Type -> Type -> Type) (Nu f :: Type) (f :: Type -> Type) Source # | |
| Functor f => Corecursive ((->) :: Type -> Type -> Type) (Fix f :: Type) (f :: Type -> Type) Source # | |
| Corecursive ((->) :: Type -> Type -> Type) ([a] :: Type) (XNor a :: Type -> Type) Source # | |
| Corecursive ((->) :: Type -> Type -> Type) (NonEmpty a :: Type) (AndMaybe a :: Type -> Type) Source # | |
| Corecursive ((->) :: Type -> Type -> Type) (Maybe a :: Type) (Const (Maybe a) :: Type -> Type) Source # | |
| Corecursive ((->) :: Type -> Type -> Type) (Either a b :: Type) (Const (Either a b) :: Type -> Type) Source # | |
| Functor f => Corecursive ((->) :: Type -> Type -> Type) (Cofree f a :: Type) (EnvT a f :: Type -> Type) Source # | |
| Functor f => Corecursive ((->) :: Type -> Type -> Type) (Free f a :: Type) (FreeF f a :: Type -> Type) Source # | |
class Recursive c t f | t -> f where Source #
Inductive structures that can be reasoned about in the way we usually do – with pattern matching.
Instances
| Recursive ((->) :: Type -> Type -> Type) Natural Maybe Source # | |
| Recursive ((->) :: Type -> Type -> Type) Void Identity Source # | |
| Recursive ((->) :: Type -> Type -> Type) (Mu f :: Type) (f :: Type -> Type) Source # | |
| Recursive ((->) :: Type -> Type -> Type) (Maybe a :: Type) (Const (Maybe a) :: Type -> Type) Source # | |
| Recursive ((->) :: Type -> Type -> Type) (Either a b :: Type) (Const (Either a b) :: Type -> Type) Source # | |
class Projectable c t f => Steppable c t f | t -> f where Source #
Structures you can walk through step-by-step.
Instances
class Projectable c t f | t -> f where Source #
This type class is lawless on its own, but there exist types that can’t
implement the corresponding embed operation. Laws are induced by
implementing either Steppable (which extends this) or Corecursive
(which doesn’t).