Print current time
This commit is contained in:
parent
1afc109d0c
commit
381ffaf8c6
@ -3,4 +3,9 @@ module Main (main) where
|
|||||||
import Lib
|
import Lib
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = putStrLn someFunc
|
main = do
|
||||||
|
putStrLn "haskell-clock"
|
||||||
|
t <- curTimeString
|
||||||
|
putStrLn t
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@ library
|
|||||||
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints
|
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints
|
||||||
build-depends:
|
build-depends:
|
||||||
base >=4.7 && <5
|
base >=4.7 && <5
|
||||||
|
, time
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
|
||||||
executable haskell-clock-exe
|
executable haskell-clock-exe
|
||||||
@ -45,6 +46,7 @@ executable haskell-clock-exe
|
|||||||
build-depends:
|
build-depends:
|
||||||
base >=4.7 && <5
|
base >=4.7 && <5
|
||||||
, haskell-clock
|
, haskell-clock
|
||||||
|
, time
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
|
||||||
test-suite haskell-clock-test
|
test-suite haskell-clock-test
|
||||||
@ -58,4 +60,5 @@ test-suite haskell-clock-test
|
|||||||
build-depends:
|
build-depends:
|
||||||
base >=4.7 && <5
|
base >=4.7 && <5
|
||||||
, haskell-clock
|
, haskell-clock
|
||||||
|
, time
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
@ -21,6 +21,7 @@ description: Please see the README on GitHub at <https://github.com/gith
|
|||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- base >= 4.7 && < 5
|
- base >= 4.7 && < 5
|
||||||
|
- time
|
||||||
|
|
||||||
ghc-options:
|
ghc-options:
|
||||||
- -Wall
|
- -Wall
|
||||||
|
12
src/Lib.hs
12
src/Lib.hs
@ -1,6 +1,12 @@
|
|||||||
module Lib
|
module Lib
|
||||||
( someFunc
|
(
|
||||||
|
curTimeString
|
||||||
) where
|
) where
|
||||||
|
|
||||||
someFunc :: String
|
import Data.Time.Clock
|
||||||
someFunc = "someFunc"
|
|
||||||
|
curTimeString :: IO String
|
||||||
|
curTimeString = do
|
||||||
|
t <- getCurrentTime
|
||||||
|
return $ show $ t
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user