packages feed

timelens (empty) → 0.2.0.0

raw patch · 4 files changed

+179/−0 lines, 4 filesdep +basedep +lensdep +timesetup-changed

Dependencies added: base, lens, time

Files

+ LICENSE view
@@ -0,0 +1,29 @@+Copyright (c) 2016 Omari Norman+All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are+met:++1. Redistributions of source code must retain the above copyright+notice, this list of conditions and the following disclaimer.++2. Redistributions in binary form must reproduce the above copyright+notice, this list of conditions and the following disclaimer in the+documentation and/or other materials provided with the distribution.++3. Neither the name of the copyright holder nor the names of its+contributors may be used to endorse or promote products derived from+this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ lib/Data/Time/Timelens.hs view
@@ -0,0 +1,106 @@+-- | Lenses for the @time@ package.+--+-- When creating an optic (such as a 'L.Lens', an 'L.Iso', etc.), this+-- module uses the same name that the @lens@ package uses.  This makes+-- it very easy for you to predict what name to use when you are+-- looking for the lens.  However, it also means that you will+-- probably want to @import@ this module @qualified@.+module Data.Time.Timelens where++import qualified Control.Lens as L+import Data.Fixed (Pico)+import qualified Data.Time as T++-- * "Data.Time.Calendar"++-- ** 'T.Day'++toModifiedJulianDay :: L.Iso' T.Day Integer+toModifiedJulianDay = L.iso T.toModifiedJulianDay T.ModifiedJulianDay++-- * "Data.Time.Clock"++-- ** 'T.UniversalTime'++getModJulianDate :: L.Iso' T.UniversalTime Rational+getModJulianDate = L.iso T.getModJulianDate T.ModJulianDate++-- ** 'T.UTCTime'++utctDay :: L.Lens' T.UTCTime T.Day+utctDay = L.lens T.utctDay (\utc dy -> utc { T.utctDay = dy })++utctDayTime :: L.Lens' T.UTCTime T.DiffTime+utctDayTime = L.lens T.utctDayTime (\utc dt -> utc { T.utctDayTime = dt })++-- * "Data.Time.Format"++-- ** 'T.TimeLocale'++wDays :: L.Lens' T.TimeLocale [(String, String)]+wDays = L.lens T.wDays (\tl dys -> tl { T.wDays = dys })++months :: L.Lens' T.TimeLocale [(String, String)]+months = L.lens T.months (\tl mts -> tl { T.months = mts })++amPm :: L.Lens' T.TimeLocale (String, String)+amPm = L.lens T.amPm (\tl ap -> tl { T.amPm = ap })++dateTimeFmt :: L.Lens' T.TimeLocale String+dateTimeFmt = L.lens T.dateTimeFmt (\tl s -> tl { T.dateTimeFmt = s })++dateFmt :: L.Lens' T.TimeLocale String+dateFmt = L.lens T.dateFmt (\tl s -> tl { T.dateFmt = s })++timeFmt :: L.Lens' T.TimeLocale String+timeFmt = L.lens T.timeFmt (\tl s -> tl { T.timeFmt = s })++time12Fmt :: L.Lens' T.TimeLocale String+time12Fmt = L.lens T.time12Fmt (\tl s -> tl { T.time12Fmt = s })++knownTimeZones :: L.Lens' T.TimeLocale [T.TimeZone]+knownTimeZones = L.lens T.knownTimeZones (\tl s -> tl { T.knownTimeZones = s })++-- * "Data.Time.LocalTime"++-- ** 'T.TimeZone'++timeZoneMinutes :: L.Lens' T.TimeZone Int+timeZoneMinutes = L.lens T.timeZoneMinutes (\s b -> s { T.timeZoneMinutes = b })++timeZoneSummerOnly :: L.Lens' T.TimeZone Bool+timeZoneSummerOnly = L.lens T.timeZoneSummerOnly+  (\s b -> s { T.timeZoneSummerOnly = b })++timeZoneName :: L.Lens' T.TimeZone String+timeZoneName = L.lens T.timeZoneName (\s b -> s { T.timeZoneName = b })++-- ** 'T.TimeOfDay'++todHour :: L.Lens' T.TimeOfDay Int+todHour = L.lens T.todHour (\s b -> s { T.todHour = b })++todMin :: L.Lens' T.TimeOfDay Int+todMin = L.lens T.todMin (\s b -> s { T.todMin = b })++todSec :: L.Lens' T.TimeOfDay Pico+todSec = L.lens T.todSec (\s b -> s { T.todSec = b })++-- ** 'T.LocalTime'++localDay :: L.Lens' T.LocalTime T.Day+localDay = L.lens T.localDay (\s b -> s { T.localDay = b })++localTimeOfDay :: L.Lens' T.LocalTime T.TimeOfDay+localTimeOfDay = L.lens T.localTimeOfDay (\s b -> s { T.localTimeOfDay = b })++-- ** 'T.ZonedTime'++zonedTimeToLocalTime :: L.Lens' T.ZonedTime T.LocalTime+zonedTimeToLocalTime = L.lens T.zonedTimeToLocalTime+  (\s b -> s { T.zonedTimeToLocalTime = b })++zonedTimeZone :: L.Lens' T.ZonedTime T.TimeZone+zonedTimeZone = L.lens T.zonedTimeZone+  (\s b -> s { T.zonedTimeZone = b })+
+ timelens.cabal view
@@ -0,0 +1,42 @@+-- This Cabal file generated using the Cartel library.+-- Cartel is available at:+-- http://www.github.com/massysett/cartel+--+-- Script name used to generate: gen-timelens-cabal+-- Generated on: 2016-06-30 08:45:15.579937 EDT+-- Cartel library version: 0.16.0.0++name: timelens+version: 0.2.0.0+cabal-version: >= 1.10+license: BSD3+license-file: LICENSE+build-type: Simple+copyright: Copyright (c) 2016 Omari Norman+author: Omari Norman+maintainer: omari@smileystation.com+stability: Experimental+homepage: http://www.github.com/massysett/timelens+bug-reports: http://www.github.com/massysett/timelens/issues+synopsis: Lenses for the time package+description:+  These are lenses for the time package.  Please see the README.md+  for more information.+category: Development++Library+  build-depends:+      base >= 4.8 && < 5+    , lens >= 4.13+    , time >= 1.5+  exposed-modules:+    Data.Time.Timelens+  ghc-options:+    -W+  default-language: Haskell2010+  hs-source-dirs:+    lib++source-repository head+  type: git+  location: https://github.com/massysett/timelens.git