packages feed

geodetic-types 0.0.2 → 0.0.3

raw patch · 3 files changed

+39/−3 lines, 3 files

Files

changelog.md view
@@ -1,3 +1,7 @@+0.0.3++* More instances for `LatLon`.+ 0.0.2  * Add `LatLon` data type.
geodetic-types.cabal view
@@ -1,7 +1,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                  geodetic-types-version:               0.0.2+version:               0.0.3 synopsis:              Types for geodetic operations description:          <<http://i.imgur.com/uZnp9ke.png>>
src/Geodetics/Types/LatLon.hs view
@@ -16,8 +16,8 @@ import Data.Eq(Eq) import Data.Functor(fmap) import Data.Ord(Ord)-import Geodetics.Types.Latitude(Latitude, HasLatitude(latitude))-import Geodetics.Types.Longitude(Longitude, HasLongitude(longitude))+import Geodetics.Types.Latitude(Latitude, HasLatitude(latitude), SetLatitude(_SetLatitude), GetLatitude(_GetLatitude), FoldLatitude(_FoldLatitude), ManyLatitude(_ManyLatitude))+import Geodetics.Types.Longitude(Longitude, HasLongitude(longitude), SetLongitude(_SetLongitude), GetLongitude(_GetLongitude), FoldLongitude(_FoldLongitude), ManyLongitude(_ManyLongitude)) import Prelude(Show)  data LatLon =@@ -30,9 +30,41 @@   latitude f (LatLon lt ln) =     fmap (\lt' -> LatLon lt' ln) (f lt) +instance SetLatitude LatLon where+  _SetLatitude =+    latitude++instance GetLatitude LatLon where+  _GetLatitude =+    latitude++instance FoldLatitude LatLon where+  _FoldLatitude =+    latitude++instance ManyLatitude LatLon where+  _ManyLatitude =+    latitude+ instance HasLongitude LatLon where   longitude f (LatLon lt ln) =     fmap (\ln' -> LatLon lt ln') (f ln)++instance SetLongitude LatLon where+  _SetLongitude =+    longitude++instance GetLongitude LatLon where+  _GetLongitude =+    longitude++instance FoldLongitude LatLon where+  _FoldLongitude =+    longitude++instance ManyLongitude LatLon where+  _ManyLongitude =+    longitude  class HasLatLon a where   latlon ::