monus-weighted-search-0.2.0.0: Efficient search weighted by an ordered monoid with monus.
Safe HaskellNone
LanguageHaskell2010

MonusWeightedSearch.Examples.Categorical

Description

 
Synopsis

Documentation

type * = (,) Source #

newtype CofreeF f a k Source #

Constructors

CofreeF 

Fields

Instances

Instances details
Comonoid (CoHeap w a) Source # 
Instance details

Defined in MonusWeightedSearch.Examples.Categorical

Methods

split :: CoHeap w a -> (CoHeap w a, Maybe (CoHeap w a)) Source #

newtype FreeF f a k Source #

Constructors

FreeF 

Fields

type CofreeTF f w a = w . CofreeF f a Source #

type CofreeT f w a = Fix (CofreeTF f w a) Source #

pattern CofreeT :: w (CofreeF f a (CofreeT f w a)) -> CofreeT f w a Source #

pattern FreeT :: m (FreeF f a (FreeT f m a)) -> FreeT f m a Source #

type FreeTF f m a = m . FreeF f a Source #

type FreeT f m a = Fix (FreeTF f m a) Source #

type CoHeapF w a = CofreeTF [] ((,) w) a Source #

type HeapF w a = FreeTF ((,) w) [] a Source #

type CoHeap w a = CofreeT [] ((,) w) a Source #

type Heap w a = FreeT ((,) w) [] a Source #

traceT :: (Comonad w, Functor f) => (w a -> b) -> (w a -> f (w a)) -> w a -> CofreeT f w b Source #

evalT :: (Functor f, Monad m) => (a -> m b) -> (f (m b) -> m b) -> FreeT f m a -> m b Source #

pattern Root :: w -> a -> [CoHeap w a] -> CoHeap w a Source #

pattern RootF :: w -> a -> [CoHeap w a] -> CoHeapF w a (CoHeap w a) Source #

newtype Fix f Source #

Constructors

Fix 

Fields

Instances

Instances details
Comonoid (CoHeap w a) Source # 
Instance details

Defined in MonusWeightedSearch.Examples.Categorical

Methods

split :: CoHeap w a -> (CoHeap w a, Maybe (CoHeap w a)) Source #

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

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

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

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

type NEListF w a = (,) w . CofreeF Maybe a Source #

type Pairing w a = Maybe (CoHeap w a) -> Maybe (CoHeap w a) Source #

pcons :: Monus w => CoHeap w a -> Pairing w a -> Pairing w a Source #

prun :: Pairing w a -> Maybe (CoHeap w a) Source #

popMin :: Monus w => CoHeap w a -> NEListF w a (CoHeap w a) Source #

(<+>) :: Monus w => CoHeap w a -> CoHeap w a -> CoHeap w a Source #

class Comonoid a where Source #

A class for things that can be decomposed in a coassiciative way.

split x == (y :| []) ==> x == y all unital (unfoldr split x) where unital x = snd x == Nothing

Methods

split :: a -> (a, Maybe a) Source #

Instances

Instances details
Comonoid Word Source # 
Instance details

Defined in MonusWeightedSearch.Examples.Categorical

Methods

split :: Word -> (Word, Maybe Word) Source #

Comonoid (NonEmpty a) Source # 
Instance details

Defined in MonusWeightedSearch.Examples.Categorical

Methods

split :: NonEmpty a -> (NonEmpty a, Maybe (NonEmpty a)) Source #

Comonoid (CoHeap w a) Source # 
Instance details

Defined in MonusWeightedSearch.Examples.Categorical

Methods

split :: CoHeap w a -> (CoHeap w a, Maybe (CoHeap w a)) Source #

class Comonoid' a where Source #

Methods

split' :: a -> NonEmpty a Source #

Instances

Instances details
Comonoid' Word Source # 
Instance details

Defined in MonusWeightedSearch.Examples.Categorical

Comonoid' (NonEmpty a) Source # 
Instance details

Defined in MonusWeightedSearch.Examples.Categorical