{-# 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