packages feed

acme-year 2014 → 2015

raw patch · 5 files changed

+80/−80 lines, 5 filessetup-changed

Files

Acme/Year.hs view
@@ -1,13 +1,13 @@-module Acme.Year (-    currentYear,-) where--import Data.Version-import Paths_acme_year---- | The current year (e.g. @2014@)-currentYear :: Int-currentYear =-    case versionBranch version of-        []    -> error "This package is timeless"-        (a:_) -> a+module Acme.Year (
+    currentYear,
+) where
+
+import Data.Version
+import Paths_acme_year
+
+-- | The current year (e.g. @2014@)
+currentYear :: Int
+currentYear =
+    case versionBranch version of
+        []    -> error "This package is timeless"
+        (a:_) -> a
Setup.hs view
@@ -1,2 +1,2 @@-import Distribution.Simple-main = defaultMain+import Distribution.Simple
+main = defaultMain
acme-year.cabal view
@@ -1,48 +1,48 @@-name:                acme-year-version:             2014-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-                 , acme-year-                 , time--benchmark bench-    type: exitcode-stdio-1.0--    hs-source-dirs: bench-    main-is:        Main.hs--    ghc-options: -Wall -fwarn-tabs -O2--    build-depends: base-                 , acme-year-                 , criterion+name:                acme-year
+version:             2015
+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
+                 , acme-year
+                 , time
+
+benchmark bench
+    type: exitcode-stdio-1.0
+
+    hs-source-dirs: bench
+    main-is:        Main.hs
+
+    ghc-options: -Wall -fwarn-tabs -O2
+
+    build-depends: base
+                 , acme-year
+                 , criterion
bench/Main.hs view
@@ -1,8 +1,8 @@-import Acme.Year-import Criterion.Main--main :: IO ()-main = defaultMain-         [ bench "control"     (return 1234        :: IO Int)-         , bench "currentYear" (return currentYear :: IO Int)-         ]+import Acme.Year
+import Criterion.Main
+
+main :: IO ()
+main = defaultMain
+         [ bench "control"     $ nfIO (return 1234        :: IO Int)
+         , bench "currentYear" $ nfIO (return currentYear :: IO Int)
+         ]
test/Main.hs view
@@ -1,9 +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 ()+import Acme.Year
+import Data.Time
+
+main :: IO ()
+main = do
+    t <- getZonedTime
+    let (y, _, _) = (toGregorian . localDay . zonedTimeToLocalTime) t
+    True <- return (y == fromIntegral currentYear)
+    return ()