geodetics 0.0.3 → 0.0.4
raw patch · 7 files changed
+37/−33 lines, 7 filesdep ~HUnitdep ~basedep ~dimensionalPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: HUnit, base, dimensional
API changes (from Hackage documentation)
- Geodetics.Ellipsoids: cX :: Helmert -> Length Double
- Geodetics.Ellipsoids: cY :: Helmert -> Length Double
- Geodetics.Ellipsoids: cZ :: Helmert -> Length Double
- Geodetics.Ellipsoids: flatRLocal :: LocalEllipsoid -> Dimensionless Double
- Geodetics.Ellipsoids: helmertLocal :: LocalEllipsoid -> Helmert
- Geodetics.Ellipsoids: helmertScale :: Helmert -> Dimensionless Double
- Geodetics.Ellipsoids: instance Ellipsoid LocalEllipsoid
- Geodetics.Ellipsoids: instance Ellipsoid WGS84
- Geodetics.Ellipsoids: instance Eq Helmert
- Geodetics.Ellipsoids: instance Eq LocalEllipsoid
- Geodetics.Ellipsoids: instance Eq WGS84
- Geodetics.Ellipsoids: instance Monoid Helmert
- Geodetics.Ellipsoids: instance Show Helmert
- Geodetics.Ellipsoids: instance Show LocalEllipsoid
- Geodetics.Ellipsoids: instance Show WGS84
- Geodetics.Ellipsoids: majorRadiusLocal :: LocalEllipsoid -> Length Double
- Geodetics.Ellipsoids: nameLocal :: LocalEllipsoid -> String
- Geodetics.Ellipsoids: rX :: Helmert -> Dimensionless Double
- Geodetics.Ellipsoids: rY :: Helmert -> Dimensionless Double
- Geodetics.Ellipsoids: rZ :: Helmert -> Dimensionless Double
- Geodetics.Geodetic: ellipsoid :: Geodetic e -> e
- Geodetics.Geodetic: geoAlt :: Geodetic e -> Length Double
- Geodetics.Geodetic: instance Ellipsoid e => HasAltitude (Geodetic e)
- Geodetics.Geodetic: instance Ellipsoid e => Show (Geodetic e)
- Geodetics.Geodetic: latitude :: Geodetic e -> Angle Double
- Geodetics.Geodetic: longitude :: Geodetic e -> Angle Double
- Geodetics.Grid: altGP :: GridPoint r -> Length Double
- Geodetics.Grid: deltaAltitude :: GridOffset -> Length Double
- Geodetics.Grid: deltaEast :: GridOffset -> Length Double
- Geodetics.Grid: deltaNorth :: GridOffset -> Length Double
- Geodetics.Grid: eastings :: GridPoint r -> Length Double
- Geodetics.Grid: gridBasis :: GridPoint r -> r
- Geodetics.Grid: instance Eq (GridPoint r)
- Geodetics.Grid: instance Eq GridOffset
- Geodetics.Grid: instance HasAltitude (GridPoint g)
- Geodetics.Grid: instance Monoid GridOffset
- Geodetics.Grid: instance Show GridOffset
- Geodetics.Grid: instance Show r => Show (GridPoint r)
- Geodetics.Grid: northings :: GridPoint r -> Length Double
- Geodetics.Path: pathFunc :: Path e -> Length Double -> (Geodetic e, Angle Double, Angle Double)
- Geodetics.Path: pathValidity :: Path e -> PathValidity
- Geodetics.Stereographic: instance Ellipsoid e => GridClass (GridStereo e) e
- Geodetics.Stereographic: instance Ellipsoid e => Show (GridStereo e)
- Geodetics.TransverseMercator: instance Ellipsoid e => GridClass (GridTM e) e
- Geodetics.TransverseMercator: instance Ellipsoid e => Show (GridTM e)
- Geodetics.UK: instance Ellipsoid OSGB36
- Geodetics.UK: instance Eq OSGB36
- Geodetics.UK: instance Eq UkNationalGrid
- Geodetics.UK: instance GridClass UkNationalGrid OSGB36
- Geodetics.UK: instance Show OSGB36
- Geodetics.UK: instance Show UkNationalGrid
+ Geodetics.Ellipsoids: [cX, cY, cZ] :: Helmert -> Length Double
+ Geodetics.Ellipsoids: [flatRLocal] :: LocalEllipsoid -> Dimensionless Double
+ Geodetics.Ellipsoids: [helmertLocal] :: LocalEllipsoid -> Helmert
+ Geodetics.Ellipsoids: [helmertScale] :: Helmert -> Dimensionless Double
+ Geodetics.Ellipsoids: [majorRadiusLocal] :: LocalEllipsoid -> Length Double
+ Geodetics.Ellipsoids: [nameLocal] :: LocalEllipsoid -> String
+ Geodetics.Ellipsoids: [rX, rY, rZ] :: Helmert -> Dimensionless Double
+ Geodetics.Ellipsoids: instance GHC.Base.Monoid Geodetics.Ellipsoids.Helmert
+ Geodetics.Ellipsoids: instance GHC.Classes.Eq Geodetics.Ellipsoids.Helmert
+ Geodetics.Ellipsoids: instance GHC.Classes.Eq Geodetics.Ellipsoids.LocalEllipsoid
+ Geodetics.Ellipsoids: instance GHC.Classes.Eq Geodetics.Ellipsoids.WGS84
+ Geodetics.Ellipsoids: instance GHC.Show.Show Geodetics.Ellipsoids.Helmert
+ Geodetics.Ellipsoids: instance GHC.Show.Show Geodetics.Ellipsoids.LocalEllipsoid
+ Geodetics.Ellipsoids: instance GHC.Show.Show Geodetics.Ellipsoids.WGS84
+ Geodetics.Ellipsoids: instance Geodetics.Ellipsoids.Ellipsoid Geodetics.Ellipsoids.LocalEllipsoid
+ Geodetics.Ellipsoids: instance Geodetics.Ellipsoids.Ellipsoid Geodetics.Ellipsoids.WGS84
+ Geodetics.Geodetic: [ellipsoid] :: Geodetic e -> e
+ Geodetics.Geodetic: [geoAlt] :: Geodetic e -> Length Double
+ Geodetics.Geodetic: [latitude, longitude] :: Geodetic e -> Angle Double
+ Geodetics.Geodetic: instance Geodetics.Ellipsoids.Ellipsoid e => GHC.Show.Show (Geodetics.Geodetic.Geodetic e)
+ Geodetics.Geodetic: instance Geodetics.Ellipsoids.Ellipsoid e => Geodetics.Altitude.HasAltitude (Geodetics.Geodetic.Geodetic e)
+ Geodetics.Grid: [deltaEast, deltaNorth, deltaAltitude] :: GridOffset -> Length Double
+ Geodetics.Grid: [eastings, northings, altGP] :: GridPoint r -> Length Double
+ Geodetics.Grid: [gridBasis] :: GridPoint r -> r
+ Geodetics.Grid: instance GHC.Base.Monoid Geodetics.Grid.GridOffset
+ Geodetics.Grid: instance GHC.Classes.Eq (Geodetics.Grid.GridPoint r)
+ Geodetics.Grid: instance GHC.Classes.Eq Geodetics.Grid.GridOffset
+ Geodetics.Grid: instance GHC.Show.Show Geodetics.Grid.GridOffset
+ Geodetics.Grid: instance GHC.Show.Show r => GHC.Show.Show (Geodetics.Grid.GridPoint r)
+ Geodetics.Grid: instance Geodetics.Altitude.HasAltitude (Geodetics.Grid.GridPoint g)
+ Geodetics.Path: [pathFunc] :: Path e -> Length Double -> (Geodetic e, Angle Double, Angle Double)
+ Geodetics.Path: [pathValidity] :: Path e -> PathValidity
+ Geodetics.Stereographic: instance Geodetics.Ellipsoids.Ellipsoid e => GHC.Show.Show (Geodetics.Stereographic.GridStereo e)
+ Geodetics.Stereographic: instance Geodetics.Ellipsoids.Ellipsoid e => Geodetics.Grid.GridClass (Geodetics.Stereographic.GridStereo e) e
+ Geodetics.TransverseMercator: instance Geodetics.Ellipsoids.Ellipsoid e => GHC.Show.Show (Geodetics.TransverseMercator.GridTM e)
+ Geodetics.TransverseMercator: instance Geodetics.Ellipsoids.Ellipsoid e => Geodetics.Grid.GridClass (Geodetics.TransverseMercator.GridTM e) e
+ Geodetics.UK: instance GHC.Classes.Eq Geodetics.UK.OSGB36
+ Geodetics.UK: instance GHC.Classes.Eq Geodetics.UK.UkNationalGrid
+ Geodetics.UK: instance GHC.Show.Show Geodetics.UK.OSGB36
+ Geodetics.UK: instance GHC.Show.Show Geodetics.UK.UkNationalGrid
+ Geodetics.UK: instance Geodetics.Ellipsoids.Ellipsoid Geodetics.UK.OSGB36
+ Geodetics.UK: instance Geodetics.Grid.GridClass Geodetics.UK.UkNationalGrid Geodetics.UK.OSGB36
- Geodetics.Ellipsoids: Helmert :: Length Double -> Length Double -> Length Double -> Dimensionless Double -> Dimensionless Double -> Dimensionless Double -> Dimensionless Double -> Helmert
+ Geodetics.Ellipsoids: Helmert :: Length Double -> Dimensionless Double -> Dimensionless Double -> Helmert
- Geodetics.Ellipsoids: add3 :: Num a => Vec3 (Quantity d a) -> Vec3 (Quantity d a) -> Vec3 (Quantity d a)
+ Geodetics.Ellipsoids: add3 :: (Num a) => Vec3 (Quantity d a) -> Vec3 (Quantity d a) -> Vec3 (Quantity d a)
- Geodetics.Ellipsoids: cross3 :: (Num a, Mul d1 d2 d3) => Vec3 (Dimensional DQuantity d1 a) -> Vec3 (Dimensional DQuantity d2 a) -> Vec3 (Dimensional DQuantity d3 a)
+ Geodetics.Ellipsoids: cross3 :: (Num a) => Vec3 (Quantity d1 a) -> Vec3 (Quantity d2 a) -> Vec3 (Quantity (d1 * d2) a)
- Geodetics.Ellipsoids: dot3 :: (Num a, Mul d1 d2 d3) => Vec3 (Dimensional DQuantity d1 a) -> Vec3 (Dimensional DQuantity d2 a) -> Dimensional DQuantity d3 a
+ Geodetics.Ellipsoids: dot3 :: (Num a) => Vec3 (Quantity d1 a) -> Vec3 (Quantity d2 a) -> Quantity (d1 * d2) a
- Geodetics.Ellipsoids: eccentricity'2 :: Ellipsoid e => e -> Dimensionless Double
+ Geodetics.Ellipsoids: eccentricity'2 :: (Ellipsoid e) => e -> Dimensionless Double
- Geodetics.Ellipsoids: eccentricity2 :: Ellipsoid e => e -> Dimensionless Double
+ Geodetics.Ellipsoids: eccentricity2 :: (Ellipsoid e) => e -> Dimensionless Double
- Geodetics.Ellipsoids: flattening :: Ellipsoid e => e -> Dimensionless Double
+ Geodetics.Ellipsoids: flattening :: (Ellipsoid e) => e -> Dimensionless Double
- Geodetics.Ellipsoids: invert3 :: (Fractional a, Mul d d d2, Mul d2 d d3, Div d2 d3 d1') => Matrix3 (Dimensional DQuantity d a) -> Matrix3 (Dimensional DQuantity d1' a)
+ Geodetics.Ellipsoids: invert3 :: (Fractional a) => Matrix3 (Quantity d a) -> Matrix3 (Quantity ((d * d) / ((d * d) * d)) a)
- Geodetics.Ellipsoids: isometricLatitude :: Ellipsoid e => e -> Angle Double -> Angle Double
+ Geodetics.Ellipsoids: isometricLatitude :: (Ellipsoid e) => e -> Angle Double -> Angle Double
- Geodetics.Ellipsoids: latitudeRadius :: Ellipsoid e => e -> Angle Double -> Length Double
+ Geodetics.Ellipsoids: latitudeRadius :: (Ellipsoid e) => e -> Angle Double -> Length Double
- Geodetics.Ellipsoids: meridianRadius :: Ellipsoid e => e -> Angle Double -> Length Double
+ Geodetics.Ellipsoids: meridianRadius :: (Ellipsoid e) => e -> Angle Double -> Length Double
- Geodetics.Ellipsoids: minorRadius :: Ellipsoid e => e -> Length Double
+ Geodetics.Ellipsoids: minorRadius :: (Ellipsoid e) => e -> Length Double
- Geodetics.Ellipsoids: negate3 :: Num a => Vec3 (Quantity d a) -> Vec3 (Quantity d a)
+ Geodetics.Ellipsoids: negate3 :: (Num a) => Vec3 (Quantity d a) -> Vec3 (Quantity d a)
- Geodetics.Ellipsoids: normal :: Ellipsoid e => e -> Angle Double -> Length Double
+ Geodetics.Ellipsoids: normal :: (Ellipsoid e) => e -> Angle Double -> Length Double
- Geodetics.Ellipsoids: primeVerticalRadius :: Ellipsoid e => e -> Angle Double -> Length Double
+ Geodetics.Ellipsoids: primeVerticalRadius :: (Ellipsoid e) => e -> Angle Double -> Length Double
- Geodetics.Ellipsoids: scale3 :: (Num a, Mul d d' d'') => Vec3 (Dimensional DQuantity d a) -> Dimensional DQuantity d' a -> Vec3 (Dimensional DQuantity d'' a)
+ Geodetics.Ellipsoids: scale3 :: (Num a) => Vec3 (Quantity d a) -> Quantity d' a -> Vec3 (Quantity (d * d') a)
- Geodetics.Ellipsoids: transform3 :: (Num a, Mul d d' d'') => Matrix3 (Dimensional DQuantity d a) -> Vec3 (Dimensional DQuantity d' a) -> Vec3 (Dimensional DQuantity d'' a)
+ Geodetics.Ellipsoids: transform3 :: (Num a) => Matrix3 (Quantity d a) -> Vec3 (Quantity d' a) -> Vec3 (Quantity (d * d') a)
- Geodetics.Geodetic: Geodetic :: Angle Double -> Angle Double -> Length Double -> e -> Geodetic e
+ Geodetics.Geodetic: Geodetic :: Angle Double -> Length Double -> e -> Geodetic e
- Geodetics.Geodetic: antipode :: Ellipsoid e => Geodetic e -> Geodetic e
+ Geodetics.Geodetic: antipode :: (Ellipsoid e) => Geodetic e -> Geodetic e
- Geodetics.Geodetic: data Ellipsoid e => Geodetic e
+ Geodetics.Geodetic: data (Ellipsoid e) => Geodetic e
- Geodetics.Geodetic: earthToGeo :: Ellipsoid e => e -> ECEF -> (Angle Double, Angle Double, Length Double)
+ Geodetics.Geodetic: earthToGeo :: (Ellipsoid e) => e -> ECEF -> (Angle Double, Angle Double, Length Double)
- Geodetics.Geodetic: geoToEarth :: Ellipsoid e => Geodetic e -> ECEF
+ Geodetics.Geodetic: geoToEarth :: (Ellipsoid e) => Geodetic e -> ECEF
- Geodetics.Geodetic: geometricalDistance :: Ellipsoid e => Geodetic e -> Geodetic e -> Length Double
+ Geodetics.Geodetic: geometricalDistance :: (Ellipsoid e) => Geodetic e -> Geodetic e -> Length Double
- Geodetics.Geodetic: geometricalDistanceSq :: Ellipsoid e => Geodetic e -> Geodetic e -> Area Double
+ Geodetics.Geodetic: geometricalDistanceSq :: (Ellipsoid e) => Geodetic e -> Geodetic e -> Area Double
- Geodetics.Geodetic: groundDistance :: Ellipsoid e => Geodetic e -> Geodetic e -> Maybe (Length Double, Dimensionless Double, Dimensionless Double)
+ Geodetics.Geodetic: groundDistance :: (Ellipsoid e) => Geodetic e -> Geodetic e -> Maybe (Length Double, Dimensionless Double, Dimensionless Double)
- Geodetics.Geodetic: readGroundPosition :: Ellipsoid e => e -> String -> Maybe (Geodetic e)
+ Geodetics.Geodetic: readGroundPosition :: (Ellipsoid e) => e -> String -> Maybe (Geodetic e)
- Geodetics.Geodetic: toWGS84 :: Ellipsoid e => Geodetic e -> Geodetic WGS84
+ Geodetics.Geodetic: toWGS84 :: (Ellipsoid e) => Geodetic e -> Geodetic WGS84
- Geodetics.Grid: GridOffset :: Length Double -> Length Double -> Length Double -> GridOffset
+ Geodetics.Grid: GridOffset :: Length Double -> GridOffset
- Geodetics.Grid: GridPoint :: Length Double -> Length Double -> Length Double -> r -> GridPoint r
+ Geodetics.Grid: GridPoint :: Length Double -> r -> GridPoint r
- Geodetics.Path: intersect :: Ellipsoid e => Length Double -> Length Double -> Length Double -> Int -> Path e -> Path e -> Maybe (Length Double, Length Double)
+ Geodetics.Path: intersect :: (Ellipsoid e) => Length Double -> Length Double -> Length Double -> Int -> Path e -> Path e -> Maybe (Length Double, Length Double)
- Geodetics.Path: latitudePath :: Ellipsoid e => Geodetic e -> Path e
+ Geodetics.Path: latitudePath :: (Ellipsoid e) => Geodetic e -> Path e
- Geodetics.Path: longitudePath :: Ellipsoid e => Geodetic e -> Path e
+ Geodetics.Path: longitudePath :: (Ellipsoid e) => Geodetic e -> Path e
- Geodetics.Path: rayPath :: Ellipsoid e => Geodetic e -> Angle Double -> Angle Double -> Path e
+ Geodetics.Path: rayPath :: (Ellipsoid e) => Geodetic e -> Angle Double -> Angle Double -> Path e
- Geodetics.Path: rhumbPath :: Ellipsoid e => Geodetic e -> Angle Double -> Path e
+ Geodetics.Path: rhumbPath :: (Ellipsoid e) => Geodetic e -> Angle Double -> Path e
- Geodetics.Stereographic: mkGridStereo :: Ellipsoid e => Geodetic e -> GridOffset -> Dimensionless Double -> GridStereo e
+ Geodetics.Stereographic: mkGridStereo :: (Ellipsoid e) => Geodetic e -> GridOffset -> Dimensionless Double -> GridStereo e
- Geodetics.TransverseMercator: mkGridTM :: Ellipsoid e => Geodetic e -> GridOffset -> Dimensionless Double -> GridTM e
+ Geodetics.TransverseMercator: mkGridTM :: (Ellipsoid e) => Geodetic e -> GridOffset -> Dimensionless Double -> GridTM e
Files
- README.md +2/−0
- geodetics.cabal +8/−8
- src/Geodetics/Ellipsoids.hs +11/−11
- src/Geodetics/LatLongParser.hs +0/−1
- src/Geodetics/Path.hs +1/−0
- test/ArbitraryInstances.hs +6/−4
- test/Main.hs +9/−9
README.md view
@@ -26,3 +26,5 @@ Version 0.0.3: Updated for Haskell Platform 2014.2.0.0 and GHC 7.8.3. Fixed some minor documentation issues.++Version 0.0.4: Updated for Dimensional 1.0.
geodetics.cabal view
@@ -1,5 +1,5 @@ name: geodetics-version: 0.0.3+version: 0.0.4 cabal-version: >= 1.10 build-type: Simple author: Paul Johnson <paul@cogito.org.uk>@@ -21,7 +21,7 @@ maintainer: Paul Johnson <paul@cogito.org.uk> homepage: https://github.com/PaulJohnson/geodetics category: Geography-tested-with: GHC==7.8.3+tested-with: GHC==7.10.2 source-repository head type: git@@ -30,8 +30,8 @@ library hs-source-dirs: src build-depends: - base >= 4.6 && < 4.8,- dimensional == 0.13.*,+ base >= 4.6 && < 5,+ dimensional >= 1.0, array >= 0.4 ghc-options: -Wall exposed-modules: @@ -50,10 +50,10 @@ type: exitcode-stdio-1.0 main-is: Main.hs x-uses-tf: true- build-depends: - base >= 4,- HUnit >= 1.2 && < 2,- dimensional == 0.13.*,+ build-depends:+ base >= 4.6 && < 5,+ HUnit >= 1.2,+ dimensional >= 0.13, QuickCheck >= 2.4, test-framework >= 0.4.1, test-framework-quickcheck2,
src/Geodetics/Ellipsoids.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE FlexibleContexts, TypeOperators, TypeFamilies #-} {- | An Ellipsoid is a reasonable best fit for the surface of the Earth over some defined area. WGS84 is the standard used for the whole@@ -53,8 +53,8 @@ -- | Multiply a vector by a scalar.-scale3 :: (Num a, Mul d d' d'') =>- Vec3 (Dimensional DQuantity d a) -> Dimensional DQuantity d' a -> Vec3 (Dimensional DQuantity d'' a)+scale3 :: (Num a) =>+ Vec3 (Quantity d a) -> Quantity d' a -> Vec3 (Quantity (d * d') a) scale3 (x,y,z) s = (x*s, y*s, z*s) @@ -68,16 +68,16 @@ -- | Multiply a matrix by a vector in the Dimensional type system.-transform3 :: (Num a, Mul d d' d'') => - Matrix3 (Dimensional DQuantity d a) -> Vec3 (Dimensional DQuantity d' a) -> Vec3 (Dimensional DQuantity d'' a) +transform3 :: (Num a) =>+ Matrix3 (Quantity d a) -> Vec3 (Quantity d' a) -> Vec3 (Quantity (d*d') a) transform3 (tx,ty,tz) v = (t tx v, t ty v, t tz v) where t (x1,y1,z1) (x2,y2,z2) = x1*x2 + y1*y2 + z1*z2 -- | Inverse of a 3x3 matrix.-invert3 :: (Fractional a, Mul d d d2, Mul d2 d d3, Div d2 d3 d1') => - Matrix3 (Dimensional DQuantity d a) -> Matrix3 (Dimensional DQuantity d1' a)+invert3 :: (Fractional a) =>+ Matrix3 (Quantity d a) -> Matrix3 (Quantity ((d*d)/(d*d*d)) a) invert3 ((x1,y1,z1), (x2,y2,z2), (x3,y3,z3)) =@@ -94,13 +94,13 @@ -- | Dot product of two vectors-dot3 :: (Num a, Mul d1 d2 d3) => - Vec3 (Dimensional DQuantity d1 a) -> Vec3 (Dimensional DQuantity d2 a) -> Dimensional DQuantity d3 a+dot3 :: (Num a) =>+ Vec3 (Quantity d1 a) -> Vec3 (Quantity d2 a) -> Quantity (d1 * d2) a dot3 (x1,y1,z1) (x2,y2,z2) = x1*x2 + y1*y2 + z1*z2 -- | Cross product of two vectors-cross3 :: (Num a, Mul d1 d2 d3) => - Vec3 (Dimensional DQuantity d1 a) -> Vec3 (Dimensional DQuantity d2 a) -> Vec3 (Dimensional DQuantity d3 a)+cross3 :: (Num a) =>+ Vec3 (Quantity d1 a) -> Vec3 (Quantity d2 a) -> Vec3 (Quantity (d1 * d2) a) cross3 (x1,y1,z1) (x2,y2,z2) = (y1*z2 - z1*y2, z1*x2 - x1*z2, x1*y2 - y1*x2)
src/Geodetics/LatLongParser.hs view
@@ -16,7 +16,6 @@ latLong ) where -import Control.Applicative import Control.Monad import Data.Char import Text.ParserCombinators.ReadP as P
src/Geodetics/Path.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE TypeOperators, TypeFamilies, FlexibleContexts #-} -- | The implementation assumes IEEE 754 arithmetic. module Geodetics.Path where
test/ArbitraryInstances.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE FlexibleInstances, RankNTypes, KindSignatures, DataKinds #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- | Orphan "Arbitrary" and related instances for testing purposes. @@ -15,13 +15,14 @@ import Geodetics.Stereographic as SG import Geodetics.TransverseMercator as TM import Numeric.Units.Dimensional.Prelude-import qualified Prelude as P+import qualified Prelude () import Test.QuickCheck -- | Shrink using a dimension, so that shrunk values are round numbers in that dimension.-shrinkDimension :: (Fractional a, Arbitrary a) => Unit d a -> Quantity d a -> [Quantity d a]+shrinkDimension :: forall a (d :: Dimension) (m :: Metricality) .+ (Fractional a, Arbitrary a) => Unit m d a -> Quantity d a -> [Quantity d a] shrinkDimension u v = (*~ u) <$> shrink (v /~ u) -- | Wrapper for arbitrary angles.@@ -114,7 +115,8 @@ shrink' x = x : shrink x -- | Shrink a quantity in the given units.-shrinkQuantity :: (Arbitrary a, Fractional a) => Unit d a -> Quantity d a -> [Quantity d a]+shrinkQuantity :: forall a (d :: Dimension) (m :: Metricality).+ (Arbitrary a, Fractional a) => Unit m d a -> Quantity d a -> [Quantity d a] shrinkQuantity u q = map (*~ u) $ shrink' $ q /~ u shrinkLength :: (Arbitrary a, Fractional a) => Length a -> [Length a]
test/Main.hs view
@@ -155,7 +155,7 @@ -- Convert a named point into a test pointTest :: (Ellipsoid e2) => (String, Geodetic WGS84, Geodetic e2) -> Test-pointTest (name, wgs84, local) = testCase name $ HU.assertBool "" $ samePlace wgs84 (toWGS84 local)+pointTest (testName, wgs84, local) = testCase testName $ HU.assertBool "" $ samePlace wgs84 (toWGS84 local) -- The negation of the sum of a list of offsets is equal to the sum of the negated items.@@ -210,22 +210,22 @@ -- | Check that grid reference to grid point works for sample points. ukGridTest2 :: GridPointTest-ukGridTest2 (gridRef, gp, _, name) = testCase name $ HU.assertBool "" +ukGridTest2 (gridRef, gp, _, testName) = testCase testName $ HU.assertBool "" $ (fst $ fromJust $ fromUkGridReference gridRef) == gp -- | Check that grid point to grid reference works for sample points. ukGridTest3 :: GridPointTest-ukGridTest3 (gridRef, gp, _, name) = testCase name $ HU.assertBool "" +ukGridTest3 (gridRef, gp, _, testName) = testCase testName $ HU.assertBool "" $ toUkGridReference 5 gp == Just gridRef -- | Check that grid point to WGS84 works close enough for sample points. ukGridTest4 :: GridPointTest-ukGridTest4 (_, gp, geo, name) = testCase name $ HU.assertBool ""+ukGridTest4 (_, gp, geo, testName) = testCase testName $ HU.assertBool "" $ closeEnough geo $ toWGS84 $ fromGrid gp -- | Check that WGS84 to grid point works close enough for sample points. ukGridTest5 :: GridPointTest-ukGridTest5 (_, gp, geo, name) = testCase name $ HU.assertBool ""+ukGridTest5 (_, gp, geo, testName) = testCase testName $ HU.assertBool "" $ offsetDistance (gridOffset gp $ toGrid UkNationalGrid $ toLocal OSGB36 geo) < 1 *~ meter @@ -308,7 +308,7 @@ prop_stereographic p = let g = fromGrid p r = toGrid (gridBasis p) g- in printTestCase ("p = " ++ show p ++ "\ng = " ++ show g ++ "\nr = " ++ show r) $+ in counterexample ("p = " ++ show p ++ "\ng = " ++ show g ++ "\nr = " ++ show r) $ closeGrid p r @@ -330,7 +330,7 @@ prop_pathContinuity :: (Ellipsoid e) => (Geodetic e -> Angle Double -> Angle Double -> Path e) -> ContinuityTest e prop_pathContinuity pf pt0 (Bearing b0) (Azimuth a0) (Distance d1) (Distance d2) =- printTestCase (show ((pt2, Bearing b2, Azimuth a2), (pt3, Bearing b3, Azimuth a3))) $+ counterexample (show ((pt2, Bearing b2, Azimuth a2), (pt3, Bearing b3, Azimuth a3))) $ pathValidAt path0 d1 && pathValidAt path0 d2 && pathValidAt path0 (d1+d2) ==> closeEnough pt2 pt3 && sameAngle b2 b3 && sameAngle a2 a3 where@@ -345,7 +345,7 @@ -- where lower accuracy is required. prop_pathContinuity1 :: (Ellipsoid e) => (Geodetic e -> Angle Double -> Path e) -> ContinuityTest1 e prop_pathContinuity1 pf pt0 (Bearing b0) (Distance2 d1) (Distance2 d2) =- printTestCase (show ((pt2, Bearing b2), (pt3, Bearing b3))) $+ counterexample (show ((pt2, Bearing b2), (pt3, Bearing b3))) $ pathValidAt path0 d1 && pathValidAt path0 d2 && pathValidAt path0 (d1+d2) ==> closeEnough pt2 pt3 && sameAngle b2 b3 where@@ -385,7 +385,7 @@ Just (d1, d2) -> let (pt1, _, _) = pathFunc path1 d1 (pt2, _, _) = pathFunc path2 d2- in printTestCase (show (pt1, pt2)) $ label "Intersection" $ samePlace pt1 pt2+ in counterexample (show (pt1, pt2)) $ label "Intersection" $ samePlace pt1 pt2 Nothing -> label "No intersection" True where (path1, path2) = mk2RhumbPaths rp