MagicHaskeller-0.9.6.4.4: Automatic inductive functional programmer by systematic search

Safe HaskellNone
LanguageHaskell98

Control.Monad.Search.Combinatorial

Documentation

(/\) :: Monad m => (a -> m b) -> (t -> m a) -> t -> m b Source

(\/) :: MonadPlus m => (t -> m a) -> (t -> m a) -> t -> m a Source

newtype RecompT m a Source

Constructors

RcT 

Fields

unRcT :: Int -> m (Bag a)
 

class (Delay m, MonadPlus m, Functor m) => Search m where Source

Minimal complete definition

fromRc, toRc, fromMx, toMx, fromDB, fromDF, toDF, mapDepth, ifDepth

Methods

fromRc :: Recomp a -> m a Source

toRc :: m a -> Recomp a Source

fromMx :: Matrix a -> m a Source

toMx :: m a -> Matrix a Source

fromDB :: DBound a -> m a Source

fromDF :: [a] -> m a Source

toDF :: m a -> [a] Source

mapDepth :: (Bag a -> Bag b) -> m a -> m b Source

mapDepth applies a function to the bag at each depth.

catBags :: m (Bag a) -> m a Source

catBags flattens each bag.

mergesortDepthWithBy Source

Arguments

:: (k -> k -> k)

Combiner, which is used when there are equivalent elements (compared by the comparer specified by the next argument). The return value of this combiner should also be equivalent to the two arguments.

-> (k -> k -> Ordering)

Comparer

-> m k 
-> m k 

mergesortDepthWithBy converts bags to sets, by (possibly sorting each bag and) removing duplicates. Efficiency on lists with lots of duplicates is required.

ifDepth :: (Int -> Bool) -> m a -> m a -> m a Source

class Delay m where Source

Minimal complete definition

getDepth

Methods

delay :: m a -> m a Source

ndelay :: Int -> m a -> m a Source

getDepth :: m Int Source

consMx :: Bag a -> Matrix a -> Matrix a Source

consRc :: Bag a -> Recomp a -> Recomp a Source

zipWithBF :: Monad m => (a -> b -> m c) -> m a -> m b -> m c Source

printMx :: Show a => Matrix a -> IO () Source

printNMx :: Show a => Int -> Matrix a -> IO () Source

type Bag a = [a] Source

type Stream a = [a] Source

cat :: [[a]] -> [a] Source

toList :: a -> a Source

scanl1BF :: Search m => m x -> m x Source

zipDepthMx :: (Int -> Bag a -> Bag b) -> Matrix a -> Matrix b Source

zipDepthRc :: (Int -> Bag a -> Bag b) -> Recomp a -> Recomp b Source

zipDepth3Mx :: (Int -> Bag a -> Bag b -> Bag c) -> Matrix a -> Matrix b -> Matrix c Source

zipDepth3Rc :: (Int -> Bag a -> Bag b -> Bag c) -> Recomp a -> Recomp b -> Recomp c Source

scanlRc :: (Bag a -> Bag b -> Bag a) -> Bag a -> Recomp b -> Recomp a Source

newtype DBoundT m a Source

Constructors

DBT 

Fields

unDBT :: Int -> m (Bag (a, Int))
 

newtype DBMemo a Source

Constructors

DBM 

Fields

unDBM :: Stream (Bag (a, Int))
 

class Search n => Memoable m n where Source

Methods

tabulate :: n a -> m a Source

applyMemo :: m a -> n a Source

shrink :: (Num t1, Ix t1) => (t -> t -> t) -> (t -> t -> Maybe Ordering) -> t1 -> [(t, t1)] -> [(t, t1)] Source

class Search m => DB m where Source

Methods

mapDepthDB :: (Bag (a, Int) -> Bag (b, Int)) -> m a -> m b Source

zipDepthDB :: (Int -> Bag (a, Int) -> Bag (b, Int)) -> m a -> m b Source

Instances

dbtToRcT :: Monad m => DBoundT m a -> RecompT m a Source