packages feed

coordinate 0.0.13 → 0.0.14

raw patch · 5 files changed

+55/−3 lines, 5 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Data.Geo.Coordinate.DegreesLatitude: modDegreesLatitude :: Int -> DegreesLatitude
+ Data.Geo.Coordinate.DegreesLongitude: modDegreesLongitude :: Int -> DegreesLongitude

Files

changelog view
@@ -1,3 +1,7 @@+0.0.14++* Add mod functions for `DegreesLatitude` and `DegreesLongitude`.+ 0.0.13  * Tidy up imports
coordinate.cabal view
@@ -1,5 +1,5 @@ name:               coordinate-version:            0.0.13+version:            0.0.14 license:            BSD3 license-file:       LICENCE author:             Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ>
src/Data/Geo/Coordinate/DegreesLatitude.hs view
@@ -5,6 +5,7 @@ module Data.Geo.Coordinate.DegreesLatitude(   DegreesLatitude , AsDegreesLatitude(..)+, modDegreesLatitude ) where  import Control.Applicative(Applicative)@@ -12,6 +13,7 @@ import Control.Lens(Optic', Choice, prism') import Data.Bool((&&)) import Data.Eq(Eq)+import Data.Fixed(mod') import Data.Int(Int) import Data.Maybe(Maybe(Just, Nothing)) import Data.Ord(Ord((<), (>)))@@ -62,3 +64,25 @@       (\i -> if i > -90 && i < 90                then Just (DegreesLatitude i)                else Nothing)++-- | Setting a value `>= 90` will get that value `(`mod` 90)`.+--+-- >>> modDegreesLatitude 7+-- DegreesLatitude 7+--+-- >>> modDegreesLatitude 0+-- DegreesLatitude 0+--+-- >>> modDegreesLatitude 90+-- DegreesLatitude 0+--+-- >>> modDegreesLatitude 1+-- DegreesLatitude 1+--+-- >>> modDegreesLatitude 89+-- DegreesLatitude 89 +modDegreesLatitude ::+  Int+  -> DegreesLatitude+modDegreesLatitude x =+  DegreesLatitude (x `mod'` 90)
src/Data/Geo/Coordinate/DegreesLongitude.hs view
@@ -5,6 +5,7 @@ module Data.Geo.Coordinate.DegreesLongitude(   DegreesLongitude , AsDegreesLongitude(..)+, modDegreesLongitude ) where  import Control.Applicative(Applicative)@@ -12,6 +13,7 @@ import Control.Lens(Optic', Choice, prism') import Data.Bool((&&)) import Data.Eq(Eq)+import Data.Fixed(mod') import Data.Int(Int) import Data.Maybe(Maybe(Just, Nothing)) import Data.Ord(Ord((<), (>)))@@ -62,3 +64,25 @@       (\i -> if i > -180 && i < 180                then Just (DegreesLongitude i)                else Nothing)++-- | Setting a value `>= 90` will get that value `(`mod` 180)`.+--+-- >>> modDegreesLongitude 7+-- DegreesLongitude 7+--+-- >>> modDegreesLongitude 0+-- DegreesLongitude 0+--+-- >>> modDegreesLongitude 180+-- DegreesLongitude 0+--+-- >>> modDegreesLongitude 1+-- DegreesLongitude 1+--+-- >>> modDegreesLongitude 179+-- DegreesLongitude 179 +modDegreesLongitude ::+  Int+  -> DegreesLongitude+modDegreesLongitude x =+  DegreesLongitude (x `mod'` 180)
src/Data/Geo/Coordinate/Longitude.hs view
@@ -62,10 +62,10 @@ -- >>> do deg <- (179 :: Int) ^? _DegreesLongitude; min <- (59 :: Int) ^? _Minutes; sec <- (60 :: Double) ^? _Seconds; (deg, min, sec) ^? _Longitude :: Maybe Longitude -- Nothing ----- >>> fmap (\x -> _Longitude # x :: (DegreesLongitude, Minutes, Seconds))  (7 ^? fracLongitude :: Maybe Longitude)+-- >>> fmap (\x -> _Longitude # x :: (DegreesLongitude, Minutes, Seconds))  ((7 :: Double) ^? _Longitude :: Maybe Longitude) -- Just (DegreesLongitude 7,Minutes 0,Seconds 0.0000) ----- >>> fmap (\x -> _Longitude # x :: (DegreesLongitude, Minutes, Seconds))  (7.12 ^? fracLongitude :: Maybe Longitude)+-- >>> fmap (\x -> _Longitude # x :: (DegreesLongitude, Minutes, Seconds))  ((7.12 :: Double) ^? _Longitude :: Maybe Longitude) -- Just (DegreesLongitude 7,Minutes 7,Seconds 12.0000) instance (Profunctor p, Functor f) => AsLongitude p f (DegreesLongitude, Minutes, Seconds) where   _Longitude =