plots-0.1.1.2: Diagrams based plotting library.

Safe HaskellNone
LanguageHaskell2010

Plots.Util

Contents

Synopsis

Documentation

pathFromVertices :: (Metric v, OrderedField n) => [Point v n] -> Path v n Source #

Type specialised version of fromVertices.

minMaxOf :: (Fractional a, Ord a) => Getting (Endo (Endo (V2 a))) s a -> s -> (a, a) Source #

Minmax of a getter in the form V2 min max. Returns (V2 (-Infinity) Infinity) for empty folds.

enumFromToN :: Fractional n => n -> n -> Int -> [n] Source #

enumFromToN a b n calculates a list from a to b in n steps.

whenever :: Bool -> (a -> a) -> a -> a Source #

Apply a function if the predicate is true.

State helpers

(&=) :: MonadState s m => ASetter' s b -> State b a -> m () infix 3 Source #

Similar to '(%=)' but takes a state modification instead of a function.

(&~~) :: Monad m => s -> StateT s m a -> m s infix 1 Source #

Similar to '(&~)' but works with StateT and returns it in m.