module Graphics.Rendering.Chart.Utils(
isValidNumber,
log10,
maybeM,
whenJust,
) where
isValidNumber :: (RealFloat a) => a -> Bool
isValidNumber :: forall a. RealFloat a => a -> Bool
isValidNumber a
v = Bool -> Bool
not (forall a. RealFloat a => a -> Bool
isNaN a
v) Bool -> Bool -> Bool
&& Bool -> Bool
not (forall a. RealFloat a => a -> Bool
isInfinite a
v)
log10 :: (Floating a) => a -> a
log10 :: forall a. Floating a => a -> a
log10 = forall a. Floating a => a -> a -> a
logBase a
10
maybeM :: (Monad m) => b -> (a -> m b) -> Maybe a -> m b
maybeM :: forall (m :: * -> *) b a.
Monad m =>
b -> (a -> m b) -> Maybe a -> m b
maybeM b
v = forall b a. b -> (a -> b) -> Maybe a -> b
maybe (forall (m :: * -> *) a. Monad m => a -> m a
return b
v)
whenJust :: (Monad m) => Maybe a -> (a -> m ()) -> m ()
whenJust :: forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
m a -> m ()
f = forall (m :: * -> *) b a.
Monad m =>
b -> (a -> m b) -> Maybe a -> m b
maybeM () a -> m ()
f Maybe a
m