manatee-core-0.0.1: The core of Manatee.

Manatee.Toolkit.General.Basic

Synopsis

Documentation

swap :: (a, b) -> (b, a)Source

Swap tuple.

ifSwap :: Bool -> (a, a) -> (a, a)Source

Try to swap tuple.

dup :: a -> (a, a)Source

Duplicate current value with tuple.

integralToDouble :: Integral a => a -> DoubleSource

Transform Int to Double

integerToInt :: Integer -> IntSource

Integer to Int.

(<<) :: Monad m => m b -> m a -> m bSource

Flip >>

liftM2' :: Monad m => m a -> (a -> b -> c) -> m b -> m cSource

Like LiftM2, but make function at middle of two arguments.

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

ifM :: Monad m => m Bool -> m a -> m a -> m aSource

If monad.

ifF :: Monad m => a -> (a -> m Bool) -> (a -> m b) -> (a -> m b) -> m bSource

If monad.

whenM :: Monad m => m Bool -> m () -> m ()Source

When monad.

unlessM :: Monad m => m Bool -> m () -> m ()Source

Unless monad.

zip' :: a -> b -> (a, b)Source

Zip'

zipM' :: Monad m => m a -> m b -> m (a, b)Source

ZipM'

firstMap :: (b -> c) -> [(b, d)] -> [(c, d)]Source

FirstMap.

zipMap :: (a -> b, a -> c) -> a -> (b, c)Source

Zip with map.

unzipMap :: (a -> (b, c)) -> (a -> b, a -> c)Source

Unzip with map.

trace :: ((a, c) -> (b, c)) -> a -> bSource

Trace.

floorToMultiple :: Integral a => a -> a -> aSource

Floor to multiple.

cond :: Monad m => [(Bool, m ())] -> m ()Source

Like a switch statement, and less cluttered than if else if

 cond [ (t1,a1), (t2,a2), ... ]

condM :: Monad m => [(m Bool, m ())] -> m ()Source

Like a switch statement, and less cluttered than if else if

 condM [ (t1,a1), (t2,a2), ... ]