-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | see readme.md -- -- see readme.md for description. @package numhask-range @version 0.0.1 module NumHask.Range -- | a range represented by a (minimum, maximum) tuple very similar to -- https://hackage.haskell.org/package/intervals-0.7.2 but the -- metaphor and purpose there is closer to a fuzzy value around a central -- point. newtype Range a Range :: (a, a) -> Range a [range_] :: Range a -> (a, a) (...) :: Ord a => a -> a -> Range a posit :: (Ord a) => Range a -> Range a low :: Lens' (Range a) a high :: Lens' (Range a) a mid :: (BoundedField a) => Lens' (Range a) a width :: (BoundedField a) => Lens' (Range a) a -- | determine whether a point is within the range element :: (Ord a) => a -> Range a -> Bool singleton :: a -> Range a -- | is the range a singleton point singular :: (Eq a) => Range a -> Bool -- | is the range low higher than the high there well may be an interesting -- complex-like set of operations on mirrored ranges mirrored :: (Ord a) => Range a -> Bool intersection :: (Ord a) => Range a -> Range a -> Range a contains :: (Ord a) => Range a -> Range a -> Bool -- | range of a foldable range :: (Foldable f, Ord a, BoundedField a) => f a -> Range a -- | `rescaleP rold rnew p` rescales a data point from an old range to a -- new range rescaleP o n (view low o) == view low n rescaleP o n (view -- high o) == view high n rescaleP a a == id rescaleP :: (Field b) => Range b -> Range b -> b -> b -- | where on the Range should the ticks be placed data TickPos OuterPos :: TickPos InnerPos :: TickPos LowerPos :: TickPos UpperPos :: TickPos MidPos :: TickPos -- | turn a range into a ist of n as, that are (view width x/n) -- apart ticks :: (Field a, FromInteger a) => TickPos -> Range a -> Int -> [a] -- | turn a range into n as pleasing to human sense and -- sensibility the as may well lie outside the original range as -- a result ticksSensible :: (Fractional a, Ord a, FromInteger a, QuotientField a, ExpRing a, MultiplicativeGroup a) => TickPos -> Range a -> Int -> [a] -- | take a list of (ascending) as and make some (ascending) -- ranges based on OuterPos fromTicks . ticks OuterPos == id ticks -- OuterPos . fromTicks == id fromTicks :: [a] -> [Range a] instance GHC.Classes.Eq NumHask.Range.TickPos instance GHC.Base.Functor NumHask.Range.Range instance GHC.Show.Show a => GHC.Show.Show (NumHask.Range.Range a) instance GHC.Classes.Ord a => GHC.Classes.Ord (NumHask.Range.Range a) instance GHC.Classes.Eq a => GHC.Classes.Eq (NumHask.Range.Range a) instance (GHC.Classes.Ord a, Test.QuickCheck.Arbitrary.Arbitrary a) => Test.QuickCheck.Arbitrary.Arbitrary (NumHask.Range.Range a) instance GHC.Classes.Ord a => NumHask.Algebra.Additive.AdditiveMagma (NumHask.Range.Range a) instance (GHC.Classes.Ord a, NumHask.Algebra.Metric.BoundedField a) => NumHask.Algebra.Additive.AdditiveUnital (NumHask.Range.Range a) instance GHC.Classes.Ord a => NumHask.Algebra.Additive.AdditiveAssociative (NumHask.Range.Range a) instance GHC.Classes.Ord a => NumHask.Algebra.Additive.AdditiveCommutative (NumHask.Range.Range a) instance (GHC.Classes.Ord a, NumHask.Algebra.Metric.BoundedField a) => NumHask.Algebra.Additive.Additive (NumHask.Range.Range a) instance GHC.Classes.Ord a => Data.Semigroup.Semigroup (NumHask.Range.Range a) instance (NumHask.Algebra.Additive.AdditiveUnital (NumHask.Range.Range a), Data.Semigroup.Semigroup (NumHask.Range.Range a)) => GHC.Base.Monoid (NumHask.Range.Range a) instance NumHask.Algebra.Metric.BoundedField a => NumHask.Algebra.Additive.AdditiveHomomorphic (NumHask.Range.Range a) a instance GHC.Classes.Ord a => NumHask.Algebra.Additive.AdditiveHomomorphic a (NumHask.Range.Range a) instance NumHask.Algebra.Metric.BoundedField a => NumHask.Algebra.Multiplicative.MultiplicativeMagma (NumHask.Range.Range a) instance NumHask.Algebra.Metric.BoundedField a => NumHask.Algebra.Multiplicative.MultiplicativeUnital (NumHask.Range.Range a) instance NumHask.Algebra.Metric.BoundedField a => NumHask.Algebra.Multiplicative.MultiplicativeAssociative (NumHask.Range.Range a) instance (GHC.Classes.Ord a, NumHask.Algebra.Metric.BoundedField a) => NumHask.Algebra.Multiplicative.MultiplicativeInvertible (NumHask.Range.Range a) instance (GHC.Classes.Ord a, NumHask.Algebra.Metric.BoundedField a) => NumHask.Algebra.Multiplicative.MultiplicativeRightCancellative (NumHask.Range.Range a) instance (GHC.Classes.Ord a, NumHask.Algebra.Metric.BoundedField a) => NumHask.Algebra.Multiplicative.MultiplicativeLeftCancellative (NumHask.Range.Range a) instance NumHask.Algebra.Additive.AdditiveGroup a => NumHask.Algebra.Metric.Normed (NumHask.Range.Range a) a instance (GHC.Classes.Ord a, NumHask.Algebra.Additive.AdditiveGroup a) => NumHask.Algebra.Metric.Metric (NumHask.Range.Range a) a module NumHask.Rect -- | a two-dimensional plane, bounded by ranges. newtype Rect a Rect :: V2 (Range a) -> Rect a [xy] :: Rect a -> V2 (Range a) -- | an alternative specification; as a 4-dim vector `V4 x y z w` where: - -- (x,y) is the lower left corner of a rectangle, and - (z,w) is the -- upper right corner of a rectangle rect :: Iso' (V4 a) (Rect a) positRect :: (Ord a) => Rect a -> Rect a corners :: Rect a -> [V2 a] midRect :: (BoundedField a) => Rect a -> V2 a -- | determine whether a point is within the range elementRect :: (Ord a) => V2 a -> Rect a -> Bool singletonRect :: V2 a -> Rect a -- | is the range a singleton V2 (has zero area) singularRect :: (Eq a) => Rect a -> Bool intersectionRect :: (Ord a) => Rect a -> Rect a -> Rect a containsRect :: (Ord a) => Rect a -> Rect a -> Bool -- | `rescaleP rold rnew p` rescales a data point from an old range to a -- new range rescaleP o n (view low o) == view low n rescaleP o n (view -- high o) == view high n rescaleP a a == id rescaleP :: (Field b) => Range b -> Range b -> b -> b -- | range specialized to double traversables rangeR2s :: (BoundedField a, Traversable g, Traversable f, R2 r, Ord a) => g (f (r a)) -> Rect a -- | scale a double container of r2s from the current range scaleR2s :: (R2 r, BoundedField a, Traversable f, Traversable g, Ord a) => Rect a -> g (f (r a)) -> g (f (r a)) -- | the range of a container of Rects rangeRects :: (Ord a, BoundedField a, Traversable f) => f (Rect a) -> Rect a -- | rescales a Rect from an old Rect range to a new one rescaleRect :: (Field a) => Rect a -> Rect a -> Rect a -> Rect a -- | scale a double container of Rects from the current range scaleRects :: (BoundedField a, Traversable f, Ord a) => Rect a -> f (Rect a) -> f (Rect a) -- | scale a double container of Rects from the current range scaleRectss :: (BoundedField a, Traversable f, Traversable g, Ord a) => Rect a -> g (f (Rect a)) -> g (f (Rect a)) -- | grid points on a rectange, divided up by a V2 Int gridP :: (Field a, FromInteger a) => TickPos -> Rect a -> V2 Int -> [V2 a] -- | a rectangle divided up by a V2 Int, making a list of smaller -- rectangles grid :: (BoundedField a, FromInteger a) => Rect a -> V2 Int -> [Rect a] instance GHC.Base.Functor NumHask.Rect.Rect instance GHC.Classes.Ord a => GHC.Classes.Ord (NumHask.Rect.Rect a) instance GHC.Classes.Eq a => GHC.Classes.Eq (NumHask.Rect.Rect a) instance GHC.Show.Show a => GHC.Show.Show (NumHask.Rect.Rect a) instance GHC.Classes.Ord a => NumHask.Algebra.Additive.AdditiveMagma (NumHask.Rect.Rect a) instance (GHC.Classes.Ord a, NumHask.Algebra.Metric.BoundedField a) => NumHask.Algebra.Additive.AdditiveUnital (NumHask.Rect.Rect a) instance GHC.Classes.Ord a => NumHask.Algebra.Additive.AdditiveAssociative (NumHask.Rect.Rect a) instance GHC.Classes.Ord a => NumHask.Algebra.Additive.AdditiveCommutative (NumHask.Rect.Rect a) instance (GHC.Classes.Ord a, NumHask.Algebra.Metric.BoundedField a) => NumHask.Algebra.Additive.Additive (NumHask.Rect.Rect a) instance GHC.Classes.Ord a => Data.Semigroup.Semigroup (NumHask.Rect.Rect a) instance (NumHask.Algebra.Additive.AdditiveUnital (NumHask.Rect.Rect a), Data.Semigroup.Semigroup (NumHask.Rect.Rect a)) => GHC.Base.Monoid (NumHask.Rect.Rect a) instance GHC.Classes.Ord a => NumHask.Algebra.Additive.AdditiveHomomorphic (Linear.V2.V2 a) (NumHask.Rect.Rect a) instance NumHask.Algebra.Metric.BoundedField a => NumHask.Algebra.Multiplicative.MultiplicativeMagma (NumHask.Rect.Rect a) instance NumHask.Algebra.Metric.BoundedField a => NumHask.Algebra.Multiplicative.MultiplicativeUnital (NumHask.Rect.Rect a) instance NumHask.Algebra.Metric.BoundedField a => NumHask.Algebra.Multiplicative.MultiplicativeAssociative (NumHask.Rect.Rect a) instance (GHC.Classes.Ord a, NumHask.Algebra.Metric.BoundedField a) => NumHask.Algebra.Multiplicative.MultiplicativeInvertible (NumHask.Rect.Rect a) instance (GHC.Classes.Ord a, NumHask.Algebra.Metric.BoundedField a) => NumHask.Algebra.Multiplicative.MultiplicativeLeftCancellative (NumHask.Rect.Rect a) instance (GHC.Classes.Ord a, NumHask.Algebra.Metric.BoundedField a) => NumHask.Algebra.Multiplicative.MultiplicativeRightCancellative (NumHask.Rect.Rect a) instance NumHask.Algebra.Additive.AdditiveGroup a => NumHask.Algebra.Metric.Normed (NumHask.Rect.Rect a) (Linear.V2.V2 a) instance (GHC.Classes.Ord a, NumHask.Algebra.Additive.AdditiveGroup a) => NumHask.Algebra.Metric.Metric (NumHask.Rect.Rect a) (Linear.V2.V2 a) module NumHask.Histogram data Histogram Histogram :: [Double] -> Map Int Double -> Histogram [_cuts] :: Histogram -> [Double] [_values] :: Histogram -> Map Int Double freq :: Histogram -> Histogram fill :: [Double] -> [Double] -> Histogram data DealOvers IgnoreOvers :: DealOvers IncludeOvers :: Double -> DealOvers fromHist :: DealOvers -> Histogram -> [Rect Double] hist :: [Double] -> Double -> Fold Double Histogram labels :: DealOvers -> [Double] -> [Text] -- | The insert function takes an element and a list and inserts the -- element into the list at the first position where it is less than or -- equal to the next element. In particular, if the list is sorted before -- the call, the result will also be sorted. It is a special case of -- insertBy, which allows the programmer to supply their own -- comparison function. insert :: Ord a => a -> [a] -> [a] insertW :: Histogram -> Double -> Double -> Histogram insertWs :: Histogram -> [(Double, Double)] -> Histogram instance GHC.Classes.Eq NumHask.Histogram.Histogram instance GHC.Show.Show NumHask.Histogram.Histogram