Copyright | (c) Masahiro Sakai 2011-2012 |
---|---|

License | BSD-style |

Maintainer | masahiro.sakai@gmail.com |

Stability | provisional |

Portability | portable |

Safe Haskell | Safe-Inferred |

Language | Haskell2010 |

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 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

showRational :: Bool -> Rational -> String Source

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