Last active
October 11, 2016 16:24
-
-
Save hatashiro/10a0d46f3d843fde547636266d8e80e4 to your computer and use it in GitHub Desktop.
Today's Haskell Poet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| timestampPath :: IO FilePath | |
| timestampPath = ??? | |
| -- using do, more readable. | |
| writeTimestamp :: UnixTime -> IO () | |
| writeTimestamp x = do | |
| path <- timestampPath | |
| writeFile path (encodeUnixTime x) | |
| -- using point-free style, feeling good. | |
| writeTimestamp :: UnixTime -> IO () | |
| writeTimestamp = (timestampPath >>=) . flip writeFile . encodeUnixTime |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment