packages feed

numhask-space 0.12.0.0 → 0.13.0.0

raw patch · 3 files changed

+1/−40 lines, 3 filesdep −random

Dependencies removed: random

Files

numhask-space.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: numhask-space-version: 0.12.0.0+version: 0.13.0.0 license: BSD-3-Clause license-file: LICENSE copyright: Tony Day (c) 2016@@ -54,7 +54,6 @@         , containers    >=0.6 && <0.8         , distributive  >=0.4 && <0.7         , numhask       >=0.10 && <0.13-        , random        >=1.2 && <1.3         , semigroupoids >=5.3 && <6.1         , tdigest       >=0.2.1 && <0.4         , text          >=1.2 && <2.2
src/NumHask/Space/Point.hs view
@@ -27,8 +27,6 @@ import NumHask.Prelude hiding (Distributive) import NumHask.Space.Range import NumHask.Space.Types-import System.Random-import System.Random.Stateful  -- $setup -- >>> :m -Prelude@@ -167,10 +165,6 @@   type Dir (Point a) = a   angle (Point x y) = atan2 y x   ray x = Point (cos x) (sin x)--instance (UniformRange a) => UniformRange (Point a) where-  uniformRM (Point x y, Point x' y') g =-    Point <$> uniformRM (x, x') g <*> uniformRM (y, y') g  instance (Multiplicative a, Additive a) => Affinity (Point a) a where   transform (Transform a b c d e f) (Point x y) =
src/NumHask/Space/Types.hs view
@@ -16,9 +16,6 @@     Pos (..),     space1,     unsafeSpace1,-    randomS,-    randomSM,-    randomSs,     memberOf,     contains,     disjoint,@@ -40,7 +37,6 @@  import Control.Monad import NumHask.Prelude-import System.Random.Stateful import Prelude qualified as P  -- $setup@@ -48,8 +44,6 @@ -- >>> :set -XRebindableSyntax -- >>> import NumHask.Prelude -- >>> import NumHask.Space--- >>> import System.Random.Stateful--- >>> let g = mkStdGen 42  -- | A 'Space' is a continuous set of numbers. Continuous here means that the set has an upper and lower bound, and an element that is between these two bounds is a member of the 'Space'. --@@ -170,32 +164,6 @@  instance (Space a) => Semigroup (Intersection a) where   (<>) (Intersection a) (Intersection b) = Intersection (a `union` b)---- | supply a random element within a 'Space'------ >>> randomS (one :: Range Double) g--- (0.43085240252163404,StdGen {unStdGen = SMGen 4530528345362647137 13679457532755275413})-randomS :: (Space s, RandomGen g, UniformRange (Element s)) => s -> g -> (Element s, g)-randomS s = uniformR (lower s, upper s)---- | StatefulGen version of randomS------ >>> import Control.Monad--- >>> runStateGen_ g (randomSM (one :: Range Double))--- 0.43085240252163404-randomSM :: (UniformRange (Element s), StatefulGen g m, Space s) => s -> g -> m (Element s)-randomSM s = uniformRM (lower s, upper s)---- | list of n random elements within a 'Space'------ >>> let g = mkStdGen 42--- >>> fst (randomSs 3 (one :: Range Double) g)--- [0.43085240252163404,-6.472345419562497e-2,0.3854692674681801]------ >>> fst (randomSs 3 (Rect 0 10 0 10 :: Rect Int) g)--- [Point 0 7,Point 0 2,Point 1 7]-randomSs :: (Space s, RandomGen g, UniformRange (Element s)) => Int -> s -> g -> ([Element s], g)-randomSs n s g = runStateGen g (replicateM n . randomSM s)  -- | a space that can be divided neatly --