toysolver-0.1.0: Assorted decision procedures for SAT, Max-SAT, PB, MIP, etc

Copyright(c) Masahiro Sakai 2011-2012
LicenseBSD-style
Maintainermasahiro.sakai@gmail.com
Stabilityprovisional
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

ToySolver.Internal.Util

Description

Some utility functions.

Synopsis

Documentation

combineMaybe :: (a -> a -> a) -> Maybe a -> Maybe a -> Maybe a Source

Combining two Maybe values using given function.

isInteger :: RealFrac a => a -> Bool Source

is the number integral?

   isInteger x = fromInteger (round x) == x

fracPart :: RealFrac a => a -> a Source

fractional part

  fracPart x = x - fromInteger (floor x)

revSequence :: Monad m => [m a] -> m [a] Source

revMapM :: Monad m => (a -> m b) -> [a] -> m [b] Source

revForM :: Monad m => [a] -> (a -> m b) -> m [b] Source