acme-year (empty) → 2013
raw patch · 4 files changed
+60/−0 lines, 4 filesdep +acme-yeardep +basedep +timesetup-changed
Dependencies added: acme-year, base, time
Files
- Acme/Year.hs +13/−0
- Setup.hs +2/−0
- acme-year.cabal +36/−0
- test/Main.hs +9/−0
+ Acme/Year.hs view
@@ -0,0 +1,13 @@+module Acme.Year (+ currentYear,+) where++import Data.Version+import Paths_acme_year++-- | The current year (e.g. @2013@)+currentYear :: Int+currentYear =+ case versionBranch version of+ [] -> error "This package is timeless"+ (a:_) -> a
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ acme-year.cabal view
@@ -0,0 +1,36 @@+name: acme-year+version: 2013+synopsis: Get the current year+-- description:+license: PublicDomain+-- license-file: LICENSE+author: Joey Adams+maintainer: joeyadams3.14159@gmail.com+-- copyright:+category: Acme+build-type: Simple+cabal-version: >=1.8+homepage: http://github.com/joeyadams/hs-acme-year+bug-reports: http://github.com/joeyadams/hs-acme-year/issues++source-repository head+ type: git+ location: git://github.com/joeyadams/hs-acme-year.git++library+ exposed-modules: Acme.Year+ other-modules: Paths_acme_year+ build-depends: base < 6+ ghc-options: -Wall -fwarn-tabs++test-suite test+ type: exitcode-stdio-1.0++ hs-source-dirs: test+ main-is: Main.hs++ ghc-options: -Wall -fwarn-tabs++ build-depends: base < 6+ , acme-year+ , time
+ test/Main.hs view
@@ -0,0 +1,9 @@+import Acme.Year+import Data.Time++main :: IO ()+main = do+ t <- getZonedTime+ let (y, _, _) = (toGregorian . localDay . zonedTimeToLocalTime) t+ True <- return (y == fromIntegral currentYear)+ return ()