| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Data.Geo.Coordinate.Seconds
Documentation
class HasSeconds t where Source
Instances
modSeconds :: Double -> Seconds Source
Construct seconds such that if the given value is out of bounds, a modulus is taken to keep it within 0 inclusive and 60 exclusive.
>>>modSeconds 7Seconds 7.0000
>>>modSeconds 0Seconds 0.0000
>>>modSeconds (-0.0001)Seconds 59.9999
>>>modSeconds 60Seconds 0.0000
>>>modSeconds 59.99999Seconds 60.0000
>>>modSeconds 59.999Seconds 59.9990
nSeconds :: Prism' Double Seconds Source
A prism on seconds to a double between 0 inclusive and 60 exclusive.
>>>7 ^? nSecondsJust (Seconds 7.0000)
>>>0 ^? nSecondsJust (Seconds 0.0000)
>>>59 ^? nSecondsJust (Seconds 59.0000)
>>>59.99 ^? nSecondsJust (Seconds 59.9900)
>>>60 ^? nSecondsNothing
all (\m -> nSeconds # m == n) (n ^? nSeconds)