Portability | portable |
---|---|

Stability | provisional |

Maintainer | masahiro.sakai@gmail.com |

Safe Haskell | Safe-Inferred |

Some utility functions.

- combineMaybe :: (a -> a -> a) -> Maybe a -> Maybe a -> Maybe a
- isInteger :: RealFrac a => a -> Bool
- fracPart :: RealFrac a => a -> a
- showRational :: Bool -> Rational -> String
- showRationalAsFiniteDecimal :: Rational -> Maybe String
- revSequence :: Monad m => [m a] -> m [a]
- revMapM :: Monad m => (a -> m b) -> [a] -> m [b]
- revForM :: Monad m => [a] -> (a -> m b) -> m [b]

# Documentation

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

Combining two `Maybe`

values using given function.

isInteger :: RealFrac a => a -> BoolSource

is the number integral?

isInteger x = fromInteger (round x) == x

showRational :: Bool -> Rational -> StringSource

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