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