yaya-unsafe-0.4.0.0: Non-total extensions to the Yaya recursion scheme library.
Safe HaskellSafe
LanguageHaskell2010

Yaya.Unsafe.Fold.Instances

Description

Type class instances that use direct recursion in a potentially partial way. This is separated from the rest of Fold because you can neither control nor qualify the import of instances. Therefore this module is extra dangerous, as having these instances available applies to the entire module they’re imported into.

This contains instances that you might expect to see, but which aren’t actually total. For example, folding a lazy list [a] is not guaranteed to terminate.

Documentation

seqFreeT :: (Functor f, Functor h) => DistributiveLaw (->) h f -> DistributiveLaw (->) (Free h) f Source #

Orphan instances

Functor f => Corecursive (->) (Mu f :: Type) (f :: Type -> Type) Source # 
Instance details

Methods

ana :: forall (a :: k). Coalgebra (->) f a -> a -> Mu f #

Functor f => Corecursive (->) (Fix f :: Type) (f :: Type -> Type) Source # 
Instance details

Methods

ana :: forall (a :: k). Coalgebra (->) f a -> a -> Fix f #

Functor f => Recursive (->) (Nu f :: Type) (f :: Type -> Type) Source # 
Instance details

Methods

cata :: forall (a :: k1). Algebra (->) f a -> Nu f -> a #

Functor f => Recursive (->) (Cofix f :: Type) (f :: Type -> Type) Source # 
Instance details

Methods

cata :: forall (a :: k1). Algebra (->) f a -> Cofix f -> a #

Recursive (->) (NonEmpty a :: Type) (AndMaybe a :: Type -> Type) Source # 
Instance details

Methods

cata :: forall (a0 :: k1). Algebra (->) (AndMaybe a) a0 -> NonEmpty a -> a0 #

Recursive (->) ([a] :: Type) (XNor a :: Type -> Type) Source # 
Instance details

Methods

cata :: forall (a0 :: k1). Algebra (->) (XNor a) a0 -> [a] -> a0 #

Functor f => Recursive (->) (Cofree f a :: Type) (EnvT a f :: Type -> Type) Source # 
Instance details

Methods

cata :: forall (a0 :: k1). Algebra (->) (EnvT a f) a0 -> Cofree f a -> a0 #

Functor f => Recursive (->) (Free f a :: Type) (FreeF f a :: Type -> Type) Source # 
Instance details

Methods

cata :: forall (a0 :: k1). Algebra (->) (FreeF f a) a0 -> Free f a -> a0 #

IsList (Mu (XNor a)) Source #

fromList in this instance is unsafe, but fromListN is safe, because we have a finite length to fold.

This means that most uses of OverloadedLists should be fine, but not the range (`..`) syntax.

Instance details

Associated Types

type Item (Mu (XNor a)) #

Methods

fromList :: [Item (Mu (XNor a))] -> Mu (XNor a) #

fromListN :: Int -> [Item (Mu (XNor a))] -> Mu (XNor a) #

toList :: Mu (XNor a) -> [Item (Mu (XNor a))] #

IsList (Fix (XNor a)) Source #

fromList in this instance is unsafe, but fromListN is safe, because we have a finite length to fold.

This means that most uses of OverloadedLists should be fine, but not the range (`..`) syntax.

Instance details

Associated Types

type Item (Fix (XNor a)) #

Methods

fromList :: [Item (Fix (XNor a))] -> Fix (XNor a) #

fromListN :: Int -> [Item (Fix (XNor a))] -> Fix (XNor a) #

toList :: Fix (XNor a) -> [Item (Fix (XNor a))] #

(Functor f, Show1 f) => Show (Nu f) Source # 
Instance details

Methods

showsPrec :: Int -> Nu f -> ShowS #

show :: Nu f -> String #

showList :: [Nu f] -> ShowS #

(Functor f, Show1 f) => Show (Cofix f) Source # 
Instance details

Methods

showsPrec :: Int -> Cofix f -> ShowS #

show :: Cofix f -> String #

showList :: [Cofix f] -> ShowS #

(Functor f, Foldable f, Eq1 f) => Eq (Nu f) Source # 
Instance details

Methods

(==) :: Nu f -> Nu f -> Bool #

(/=) :: Nu f -> Nu f -> Bool #

(Functor f, Foldable f, Eq1 f) => Eq (Cofix f) Source # 
Instance details

Methods

(==) :: Cofix f -> Cofix f -> Bool #

(/=) :: Cofix f -> Cofix f -> Bool #