-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | numerical spaces -- -- Spaces and the numerical elements that inhabit them. @package numhask-space @version 0.5.0 -- | data algorithms related to time (as a Space) module NumHask.Space.Time -- | parse text as per iso8601 -- --
--   >>> :set -XOverloadedStrings
--   
--   >>> let t0 = parseUTCTime ("2017-12-05" :: Text)
--   
--   >>> t0
--   Just 2017-12-05 00:00:00 UTC
--   
parseUTCTime :: Text -> Maybe UTCTime -- | a step in time data TimeGrain Years :: Integer -> TimeGrain Months :: Int -> TimeGrain Days :: Int -> TimeGrain Hours :: Int -> TimeGrain Minutes :: Int -> TimeGrain Seconds :: Double -> TimeGrain -- | compute the floor UTCTime based on the timegrain -- --
--   >>> floorGrain (Years 5) (UTCTime (fromGregorian 1999 1 1) 0)
--   1995-12-31 00:00:00 UTC
--   
-- --
--   >>> floorGrain (Months 3) (UTCTime (fromGregorian 2016 12 30) 0)
--   2016-09-30 00:00:00 UTC
--   
-- --
--   >>> floorGrain (Days 5) (UTCTime (fromGregorian 2016 12 30) 1)
--   2016-12-30 00:00:00 UTC
--   
-- --
--   >>> floorGrain (Minutes 15) (UTCTime (fromGregorian 2016 12 30) (fromDouble' $ 15*60+1))
--   2016-12-30 00:15:00 UTC
--   
-- --
--   >>> floorGrain (Seconds 0.1) (UTCTime (fromGregorian 2016 12 30) 0.12)
--   2016-12-30 00:00:00.1 UTC
--   
floorGrain :: TimeGrain -> UTCTime -> UTCTime -- | compute the ceiling UTCTime based on the timegrain -- --
--   >>> ceilingGrain (Years 5) (UTCTime (fromGregorian 1999 1 1) 0)
--   2000-12-31 00:00:00 UTC
--   
-- --
--   >>> ceilingGrain (Months 3) (UTCTime (fromGregorian 2016 12 30) 0)
--   2016-12-31 00:00:00 UTC
--   
-- --
--   >>> ceilingGrain (Days 5) (UTCTime (fromGregorian 2016 12 30) 1)
--   2016-12-31 00:00:00 UTC
--   
-- --
--   >>> ceilingGrain (Minutes 15) (UTCTime (fromGregorian 2016 12 30) (fromDouble' $ 15*60+1))
--   2016-12-30 00:30:00 UTC
--   
-- --
--   >>> ceilingGrain (Seconds 0.1) (UTCTime (fromGregorian 2016 12 30) 0.12)
--   2016-12-30 00:00:00.2 UTC
--   
ceilingGrain :: TimeGrain -> UTCTime -> UTCTime -- | compute a sensible TimeGrain and list of UTCTimes -- --
--   >>> sensibleTimeGrid InnerPos 2 (UTCTime (fromGregorian 2016 12 31) 0, UTCTime (fromGregorian 2017 12 31) 0)
--   (Months 6,[2016-12-31 00:00:00 UTC,2017-06-30 00:00:00 UTC,2017-12-31 00:00:00 UTC])
--   
-- --
--   >>> sensibleTimeGrid InnerPos 2 (UTCTime (fromGregorian 2017 1 1) 0, UTCTime (fromGregorian 2017 12 30) 0)
--   (Months 6,[2017-06-30 00:00:00 UTC])
--   
-- --
--   >>> sensibleTimeGrid UpperPos 2 (UTCTime (fromGregorian 2017 1 1) 0, UTCTime (fromGregorian 2017 12 30) 0)
--   (Months 6,[2017-06-30 00:00:00 UTC,2017-12-31 00:00:00 UTC])
--   
-- --
--   >>> sensibleTimeGrid LowerPos 2 (UTCTime (fromGregorian 2017 1 1) 0, UTCTime (fromGregorian 2017 12 30) 0)
--   (Months 6,[2016-12-31 00:00:00 UTC,2017-06-30 00:00:00 UTC])
--   
sensibleTimeGrid :: Pos -> Int -> (UTCTime, UTCTime) -> (TimeGrain, [UTCTime]) -- | whether to include lower and upper times data PosDiscontinuous PosInnerOnly :: PosDiscontinuous PosIncludeBoundaries :: PosDiscontinuous -- | Dates used for time series analysis or attached to charts are often -- discontinuous, but we want to smooth that reality over and show a -- continuous range on the axis. -- -- The assumption with getSensibleTimeGrid is that there is a list of -- discountinuous UTCTimes rather than a continuous range. Output is a -- list of index points for the original [UTCTime] and label tuples, and -- a list of unused list elements. -- --
--   >>> placedTimeLabelDiscontinuous PosIncludeBoundaries (Just "%d %b") 2 [UTCTime (fromGregorian 2017 12 6) 0, UTCTime (fromGregorian 2017 12 29) 0, UTCTime (fromGregorian 2018 1 31) 0, UTCTime (fromGregorian 2018 3 3) 0]
--   ([(0,"06 Dec"),(1,"31 Dec"),(2,"28 Feb"),(3,"03 Mar")],[])
--   
placedTimeLabelDiscontinuous :: PosDiscontinuous -> Maybe Text -> Int -> [UTCTime] -> ([(Int, Text)], [UTCTime]) -- | A sensible time grid between two dates, projected onto (0,1) with no -- attempt to get finnicky. -- --
--   >>> placedTimeLabelContinuous PosIncludeBoundaries (Just "%d %b") 2 (UTCTime (fromGregorian 2017 12 6) 0, UTCTime (fromGregorian 2017 12 29) 0)
--   [(0.0,"06 Dec"),(0.43478260869565216,"16 Dec"),(0.8695652173913043,"26 Dec"),(1.0,"29 Dec")]
--   
placedTimeLabelContinuous :: PosDiscontinuous -> Maybe Text -> Int -> (UTCTime, UTCTime) -> [(Double, Text)] instance GHC.Generics.Generic NumHask.Space.Time.TimeGrain instance GHC.Classes.Eq NumHask.Space.Time.TimeGrain instance GHC.Show.Show NumHask.Space.Time.TimeGrain -- | A Space containing numerical elements module NumHask.Space.Range -- | A continuous range over type a -- --
--   >>> let a = Range (-1) 1
--   
--   >>> a
--   Range -1 1
--   
-- -- Num instance based on interval arithmetic (with Ranges normalising to -- lower ... upper) -- --
--   >>> a + a
--   Range -2 2
--   
--   >>> a * a
--   Range -1 1
--   
--   >>> (+1) <$> (Range 1 2)
--   Range 2 3
--   
-- -- Ranges are very useful in shifting a bunch of numbers from one Range -- to another. eg project 0.5 from the range 0 to 1 to the range 1 to 4 -- --
--   >>> project (Range 0 1) (Range 1 4) 0.5
--   2.5
--   
-- -- Create an equally spaced grid including outer bounds over a Range -- --
--   >>> grid OuterPos (Range 0 10) 5
--   [0.0,2.0,4.0,6.0,8.0,10.0]
--   
-- -- divide up a Range into equal-sized sections -- --
--   >>> gridSpace (Range 0 1) 4
--   [Range 0.0 0.25,Range 0.25 0.5,Range 0.5 0.75,Range 0.75 1.0]
--   
data Range a Range :: a -> a -> Range a -- | a grid for five-digits per limb species -- --
--   >>> gridSensible OuterPos False (Range (-12.0) 23.0) 6
--   [-15.0,-10.0,-5.0,0.0,5.0,10.0,15.0,20.0,25.0]
--   
gridSensible :: (Ord a, RealFrac a, Floating a, Integral b) => Pos -> Bool -> Range a -> b -> [a] instance GHC.Generics.Generic (NumHask.Space.Range.Range a) instance GHC.Classes.Eq a => GHC.Classes.Eq (NumHask.Space.Range.Range a) instance GHC.Show.Show a => GHC.Show.Show (NumHask.Space.Range.Range a) instance Data.Functor.Classes.Eq1 NumHask.Space.Range.Range instance Data.Functor.Classes.Show1 NumHask.Space.Range.Range instance GHC.Base.Functor NumHask.Space.Range.Range instance Data.Functor.Bind.Class.Apply NumHask.Space.Range.Range instance GHC.Base.Applicative NumHask.Space.Range.Range instance Data.Foldable.Foldable NumHask.Space.Range.Range instance Data.Semigroup.Foldable.Class.Foldable1 NumHask.Space.Range.Range instance Data.Traversable.Traversable NumHask.Space.Range.Range instance Data.Semigroup.Traversable.Class.Traversable1 NumHask.Space.Range.Range instance Data.Distributive.Distributive NumHask.Space.Range.Range instance Data.Functor.Rep.Representable NumHask.Space.Range.Range instance GHC.Classes.Ord a => Algebra.Lattice.Lattice (NumHask.Space.Range.Range a) instance (GHC.Classes.Eq a, GHC.Classes.Ord a) => NumHask.Space.Types.Space (NumHask.Space.Range.Range a) instance (GHC.Classes.Ord a, GHC.Real.Fractional a) => NumHask.Space.Types.FieldSpace (NumHask.Space.Range.Range a) instance (GHC.Classes.Eq a, GHC.Classes.Ord a) => GHC.Base.Semigroup (NumHask.Space.Range.Range a) instance (GHC.Num.Num a, GHC.Classes.Eq a, GHC.Classes.Ord a) => GHC.Num.Num (NumHask.Space.Range.Range a) -- | A 2-dimensional point. module NumHask.Space.Point -- | A 2-dim point of a's -- -- A Point is functorial over both arguments, and is a Num instance. -- --
--   >>> let p = Point 1 1
--   
--   >>> p + p
--   Point 2 2
--   
--   >>> (2*) <$> p
--   Point 2 2
--   
-- -- A major reason for this bespoke treatment of a point is that Points do -- not have maximums and minimums but they form a lattice, and this is -- useful for folding points to find out the (rectangular) Space they -- occupy. -- --
--   >>> Point 0 1 /\ Point 1 0
--   Point 0 0
--   
--   >>> Point 0 1 \/ Point 1 0
--   Point 1 1
--   
data Point a Point :: a -> a -> Point a -- | rotate a point by x degrees relative to the origin -- --
--   >>> rotate 90 (Point 0 1)
--   Point 1.0 6.123233995736766e-17
--   
rotate :: Floating a => a -> Point a -> Point a -- | Create Points for a formulae y = f(x) across an x range -- --
--   >>> gridP (**2) (Range 0 4) 4
--   [Point 0.0 0.0,Point 1.0 1.0,Point 2.0 4.0,Point 3.0 9.0,Point 4.0 16.0]
--   
gridP :: (Ord a, Fractional a) => (a -> a) -> Range a -> Int -> [Point a] instance GHC.Generics.Generic (NumHask.Space.Point.Point a) instance GHC.Classes.Eq a => GHC.Classes.Eq (NumHask.Space.Point.Point a) instance GHC.Show.Show a => GHC.Show.Show (NumHask.Space.Point.Point a) instance GHC.Base.Functor NumHask.Space.Point.Point instance Data.Functor.Classes.Eq1 NumHask.Space.Point.Point instance Data.Functor.Classes.Show1 NumHask.Space.Point.Point instance GHC.Base.Applicative NumHask.Space.Point.Point instance GHC.Base.Monad NumHask.Space.Point.Point instance Data.Foldable.Foldable NumHask.Space.Point.Point instance Data.Traversable.Traversable NumHask.Space.Point.Point instance GHC.Base.Semigroup a => GHC.Base.Semigroup (NumHask.Space.Point.Point a) instance (GHC.Base.Semigroup a, GHC.Base.Monoid a) => GHC.Base.Monoid (NumHask.Space.Point.Point a) instance GHC.Enum.Bounded a => GHC.Enum.Bounded (NumHask.Space.Point.Point a) instance GHC.Num.Num a => GHC.Num.Num (NumHask.Space.Point.Point a) instance GHC.Real.Fractional a => GHC.Real.Fractional (NumHask.Space.Point.Point a) instance Data.Distributive.Distributive NumHask.Space.Point.Point instance Data.Functor.Rep.Representable NumHask.Space.Point.Point instance GHC.Classes.Ord a => Algebra.Lattice.Lattice (NumHask.Space.Point.Point a) -- | a two-dimensional plane, implemented as a composite of a Point -- of Ranges. module NumHask.Space.Rect -- | a rectangular space often representing a 2-dimensional or XY plane. -- --
--   >>> let a = Rect (-1) 1 (-2) 4
--   
--   >>> a
--   Rect -1 1 -2 4
--   
--   >>> let (Ranges x y) = a
--   
--   >>> x
--   Range -1 1
--   
--   >>> y
--   Range -2 4
--   
--   >>> fmap (+1) (Rect 1 2 3 4)
--   Rect 2 3 4 5
--   
-- -- as a Space instance with Points as Elements -- --
--   >>> project (Rect 0 1 (-1) 0) (Rect 1 4 10 0) (Point 0.5 1)
--   Point 2.5 -10.0
--   
--   >>> gridSpace (Rect 0 10 0 1) (Point 2 2)
--   [Rect 0.0 5.0 0.0 0.5,Rect 0.0 5.0 0.5 1.0,Rect 5.0 10.0 0.0 0.5,Rect 5.0 10.0 0.5 1.0]
--   
--   >>> grid MidPos (Rect 0 10 0 1) (Point 2 2)
--   [Point 2.5 0.25,Point 2.5 0.75,Point 7.5 0.25,Point 7.5 0.75]
--   
newtype Rect a Rect' :: Compose Point Range a -> Rect a -- | pattern of Rect lowerx upperx lowery uppery pattern Rect :: a -> a -> a -> a -> Rect a -- | pattern of Ranges xrange yrange pattern Ranges :: Range a -> Range a -> Rect a -- | create a list of points representing the lower left and upper right -- corners of a rectangle. -- --
--   >>> corners unitRect
--   [Point -0.5 -0.5,Point 0.5 0.5]
--   
corners :: Ord a => Rect a -> [Point a] -- | the 4 corners -- --
--   >>> corners4 unitRect
--   [Point -0.5 -0.5,Point -0.5 0.5,Point 0.5 -0.5,Point 0.5 0.5]
--   
corners4 :: Rect a -> [Point a] -- | project a Rect from an old Space (Rect) to a new one. -- -- The Space instance of Rect uses Points as Elements, but a Rect can -- also be a Space over Rects. -- --
--   >>> projectRect (Rect 0 1 (-1) 0) (Rect 0 4 0 8) (Rect 0.25 0.75 (-0.75) (-0.25))
--   Rect 1.0 3.0 2.0 6.0
--   
projectRect :: (Ord a, Fractional a) => Rect a -> Rect a -> Rect a -> Rect a -- | Rect addition -- --
--   >>> unitRect `addRect` unitRect
--   Rect -1.0 1.0 -1.0 1.0
--   
addRect :: Num a => Rect a -> Rect a -> Rect a -- | Rect multiplication -- --
--   >>> unitRect `multRect` Rect 0 2 0 4
--   Rect 0.0 2.0 0.0 4.0
--   
multRect :: (Ord a, Fractional a) => Rect a -> Rect a -> Rect a -- | a unit Rectangle, with values chosen so that width and height are one -- and mid is zero -- --
--   >>> unitRect :: Rect Double
--   Rect -0.5 0.5 -0.5 0.5
--   
unitRect :: Fractional a => Rect a -- | convex hull union of Rect's -- --
--   >>> foldRect [Rect 0 1 0 1, unitRect]
--   Just Rect -0.5 1.0 -0.5 1.0
--   
foldRect :: Ord a => [Rect a] -> Maybe (Rect a) -- | add a Point to a Rect -- --
--   >>> addPoint (Point 0 1) unitRect
--   Rect -0.5 0.5 0.5 1.5
--   
addPoint :: Num a => Point a -> Rect a -> Rect a -- | rotate the corners of a Rect by x degrees relative to the origin, and -- fold to a new Rect -- --
--   >>> rotateRect 45 unitRect
--   Rect -0.7071067811865475 0.7071067811865475 -5.551115123125783e-17 5.551115123125783e-17
--   
rotateRect :: (Floating a, Ord a) => a -> Rect a -> Rect a -- | Create Rects for a formulae y = f(x) across an x range where the y -- range is Range 0 y -- --
--   >>> gridR (**2) (Range 0 4) 4
--   [Rect 0.0 1.0 0.0 0.25,Rect 1.0 2.0 0.0 2.25,Rect 2.0 3.0 0.0 6.25,Rect 3.0 4.0 0.0 12.25]
--   
gridR :: (Ord a, Fractional a) => (a -> a) -> Range a -> Int -> [Rect a] -- | Create values c for Rects data for a formulae c = f(x,y) -- --
--   >>> gridF (\(Point x y) -> x * y) (Rect 0 4 0 4) (Point 2 2)
--   [(Rect 0.0 2.0 0.0 2.0,1.0),(Rect 0.0 2.0 2.0 4.0,3.0),(Rect 2.0 4.0 0.0 2.0,3.0),(Rect 2.0 4.0 2.0 4.0,9.0)]
--   
gridF :: (Ord a, Fractional a) => (Point a -> b) -> Rect a -> Grid (Rect a) -> [(Rect a, b)] -- | convert a ratio (eg x:1) to a Rect with a height of one. -- --
--   >>> aspect 2
--   Rect -1.0 1.0 -0.5 0.5
--   
aspect :: Fractional a => a -> Rect a -- | convert a Rect to a ratio -- --
--   >>> ratio (Rect (-1) 1 (-0.5) 0.5)
--   2.0
--   
ratio :: Fractional a => Rect a -> a instance GHC.Generics.Generic (NumHask.Space.Rect.Rect a) instance Data.Traversable.Traversable NumHask.Space.Rect.Rect instance Data.Foldable.Foldable NumHask.Space.Rect.Rect instance GHC.Base.Applicative NumHask.Space.Rect.Rect instance GHC.Base.Functor NumHask.Space.Rect.Rect instance GHC.Classes.Eq a => GHC.Classes.Eq (NumHask.Space.Rect.Rect a) instance GHC.Show.Show a => GHC.Show.Show (NumHask.Space.Rect.Rect a) instance Data.Distributive.Distributive NumHask.Space.Rect.Rect instance Data.Functor.Rep.Representable NumHask.Space.Rect.Rect instance GHC.Classes.Ord a => GHC.Base.Semigroup (NumHask.Space.Rect.Rect a) instance GHC.Classes.Ord a => NumHask.Space.Types.Space (NumHask.Space.Rect.Rect a) instance (GHC.Classes.Ord a, GHC.Real.Fractional a, GHC.Num.Num a) => NumHask.Space.Types.FieldSpace (NumHask.Space.Rect.Rect a) instance (GHC.Real.Fractional a, GHC.Num.Num a, GHC.Classes.Eq a, GHC.Classes.Ord a) => GHC.Num.Num (NumHask.Space.Rect.Rect a) -- | A histogram, if you squint, is a series of contiguous ranges, -- annotated with values. module NumHask.Space.Histogram -- | This Histogram is a list of contiguous boundaries (a boundary being -- the lower edge of one bucket and the upper edge of another), and a -- value (usually a count) for each bucket, represented here as a map -- -- Overs and Unders are contained in key = 0 and key = length cuts data Histogram Histogram :: [Double] -> Map Int Double -> Histogram [cuts] :: Histogram -> [Double] [values] :: Histogram -> Map Int Double -- | Whether or not to ignore unders and overs. If overs and unders are -- dealt with, IncludeOvers supplies an assumed width for the outer -- buckets. data DealOvers IgnoreOvers :: DealOvers IncludeOvers :: Double -> DealOvers -- | Fill a Histogram using pre-specified cuts -- --
--   >>> fill [0,50,100] [1..100]
--   Histogram {cuts = [0.0,50.0,100.0], values = fromList [(1,50.0),(2,50.0)]}
--   
fill :: Foldable f => [Double] -> f Double -> Histogram -- | find the index of the bucket the value is contained in. cutI :: Ord a => [a] -> a -> Int -- | Make a histogram using n equally spaced cuts over the entire range of -- the data -- --
--   >>> regular 4 [0..100]
--   Histogram {cuts = [0.0,25.0,50.0,75.0,100.0], values = fromList [(0,1.0),(1,25.0),(2,25.0),(3,25.0),(4,25.0)]}
--   
regular :: Int -> [Double] -> Histogram -- | Transform a Histogram to Rects -- --
--   >>> makeRects IgnoreOvers (regular 4 [0..100])
--   [Rect 0.0 25.0 0.0 0.25,Rect 25.0 50.0 0.0 0.25,Rect 50.0 75.0 0.0 0.25,Rect 75.0 100.0 0.0 0.25]
--   
makeRects :: DealOvers -> Histogram -> [Rect Double] -- | approx regular n-quantiles -- --
--   >>> regularQuantiles 4 [0..100]
--   [0.0,24.75,50.0,75.25,100.0]
--   
regularQuantiles :: Double -> [Double] -> [Double] -- | one-pass approximate quantiles fold quantileFold :: [Double] -> Fold Double [Double] -- | take a specification of quantiles and make a Histogram -- --
--   >>> fromQuantiles [0,0.25,0.5,0.75,1] (regularQuantiles 4 [0..100])
--   Histogram {cuts = [0.0,24.75,50.0,75.25,100.0], values = fromList [(1,0.25),(2,0.25),(3,0.25),(4,0.25)]}
--   
fromQuantiles :: [Double] -> [Double] -> Histogram -- | normalize a histogram so that sum values = one -- --
--   >>> freq $ fill [0,50,100] [1..100]
--   Histogram {cuts = [0.0,50.0,100.0], values = fromList [(1,0.5),(2,0.5)]}
--   
freq :: Histogram -> Histogram instance GHC.Classes.Eq NumHask.Space.Histogram.Histogram instance GHC.Show.Show NumHask.Space.Histogram.Histogram -- | A continuous set of numbers. -- -- Mathematics does not define a space, leaving library devs to -- experiment. -- -- https://en.wikipedia.org/wiki/Space_(mathematics) module NumHask.Space -- | Space is a continuous range of numbers that contains elements and has -- an upper and lower value. -- --
--   a `union` b == b `union` a
--   a `intersection` b == b `intersection` a
--   (a `union` b) `intersection` c == (a `intersection` b) `union` (a `intersection` c)
--   (a `intersection` b) `union` c == (a `union` b) `intersection` (a `union` c)
--   norm (norm a) = norm a
--   a |>| b == b |<| a
--   a |.| singleton a
--   
class Space s where { -- | the underlying element in the space type family Element s :: Type; } -- | lower boundary lower :: Space s => s -> Element s -- | upper boundary upper :: Space s => s -> Element s -- | space containing a single element singleton :: Space s => Element s -> s -- | the intersection of two spaces intersection :: Space s => s -> s -> s -- | the intersection of two spaces intersection :: (Space s, Ord (Element s)) => s -> s -> s -- | the union of two spaces union :: Space s => s -> s -> s -- | the union of two spaces union :: (Space s, Ord (Element s)) => s -> s -> s -- | Normalise a space so that -- --
--   lower a \/ upper a == lower a
--   lower a /\ upper a == upper a
--   
norm :: Space s => s -> s -- | create a normalised space from two elements (...) :: Space s => Element s -> Element s -> s -- | create a normalised space from two elements (...) :: (Space s, Ord (Element s)) => Element s -> Element s -> s -- | create a space from two elements without normalising (>.<) :: Space s => Element s -> Element s -> s -- | is an element in the space (|.|) :: Space s => Element s -> s -> Bool -- | is an element in the space (|.|) :: (Space s, Ord (Element s)) => Element s -> s -> Bool -- | is one space completely above the other (|>|) :: Space s => s -> s -> Bool -- | is one space completely above the other (|>|) :: (Space s, Ord (Element s)) => s -> s -> Bool -- | is one space completely below the other (|<|) :: Space s => s -> s -> Bool -- | is one space completely below the other (|<|) :: (Space s, Ord (Element s)) => s -> s -> Bool infix 3 >.< infix 3 ... infixl 7 |.| infixl 7 |>| infixl 7 |<| -- | a convex hull newtype Union a Union :: a -> Union a [getUnion] :: Union a -> a -- | https://en.wikipedia.org/wiki/Intersection_(set_theory) newtype Intersection a Intersection :: a -> Intersection a [getIntersection] :: Intersection a -> a -- | a space that can be divided neatly -- --
--   space1 (grid OuterPos s g) == s
--   getUnion (sconcat (Union <$> (gridSpace s g))) == s
--   
class (Space s, Num (Element s)) => FieldSpace s where { type family Grid s :: Type; } -- | create equally-spaced elements across a space grid :: FieldSpace s => Pos -> s -> Grid s -> [Element s] -- | create equally-spaced spaces from a space gridSpace :: FieldSpace s => s -> Grid s -> [s] -- | middle element of the space mid :: (Space s, Fractional (Element s)) => s -> Element s -- | project a data point from one space to another, preserving relative -- position -- --
--   project o n (lower o) = lower n
--   project o n (upper o) = upper n
--   project o n (mid o) = mid n
--   project a a x = x
--   
project :: (Space s, Fractional (Element s)) => s -> s -> Element s -> Element s -- | Pos suggests where points should be placed in forming a grid across a -- field space. data Pos -- | include boundaries OuterPos :: Pos -- | don't include boundaries InnerPos :: Pos -- | include the lower boundary LowerPos :: Pos -- | include the upper boundary UpperPos :: Pos -- | use the mid-point of the space MidPos :: Pos -- | the containing space of a non-empty Traversable -- --
--   all $ space1 a `contains` <$> a
--   
space1 :: (Space s, Traversable f) => f (Element s) -> s -- | is an element contained within a space memberOf :: Space s => Element s -> s -> Bool -- | is a space contained within another? -- --
--   (a `union` b) `contains` a
--   (a `union` b) `contains` b
--   
contains :: Space s => s -> s -> Bool -- | are two spaces disjoint? disjoint :: Space s => s -> s -> Bool -- | distance between boundaries width :: (Space s, Num (Element s)) => s -> Element s -- | create a space centered on a plus or minus b (+/-) :: (Space s, Num (Element s)) => Element s -> Element s -> s infixl 6 +/- -- | lift a monotone function (increasing or decreasing) over a given space monotone :: (Space a, Space b) => (Element a -> Element b) -> a -> b -- | a small space eps :: (Space s, Fractional (Element s)) => Element s -> Element s -> s -- | widen a space widen :: (Space s, Num (Element s)) => Element s -> s -> s -- | widen by a small amount widenEps :: (Space s, Fractional (Element s)) => Element s -> s -> s -- | Scale a Space. (scalar multiplication) scale :: (Num (Element s), Space s) => Element s -> s -> s -- | Move a Space. (scalar addition) move :: (Num (Element s), Space s) => Element s -> s -> s