Geodetic 0.2 → 0.3
raw patch · 3 files changed
+31/−1 lines, 3 files
Files
- Data/Geo/Accessor/Value.hs +6/−0
- Data/Geo/Sphere.hs +21/−0
- Geodetic.cabal +4/−1
+ Data/Geo/Accessor/Value.hs view
@@ -0,0 +1,6 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}++module Data.Geo.Accessor.Value where++class Value a b | a -> b where+ value :: a -> b
+ Data/Geo/Sphere.hs view
@@ -0,0 +1,21 @@+{-# LANGUAGE GeneralizedNewtypeDeriving, MultiParamTypeClasses #-}++module Data.Geo.Sphere(+ Sphere,+ sphere,+ earthMean+ ) where++import Data.Geo.Accessor.Value++newtype Sphere = Sphere Double+ deriving (Eq, Ord, Enum, Show, Num, Fractional, Floating)++sphere :: Double -> Sphere+sphere = Sphere . abs++instance Value Sphere Double where+ value (Sphere x) = x++earthMean :: Sphere+earthMean = sphere 6367450
Geodetic.cabal view
@@ -1,5 +1,5 @@ Name: Geodetic-Version: 0.2+Version: 0.3 License: BSD3 License-File: LICENSE Synopsis: Geodetic calculations@@ -37,6 +37,7 @@ Data.Geo.Longitude Data.Geo.Position Data.Geo.Radians+ Data.Geo.Sphere Data.Geo.Vincenty Data.Geo.Accessor.Azi Data.Geo.Accessor.Coordinate@@ -46,3 +47,5 @@ Data.Geo.Accessor.Lat Data.Geo.Accessor.Lon Data.Geo.Accessor.ReverseAzi+ Data.Geo.Accessor.Value+