Created
October 4, 2016 11:15
-
-
Save mankyKitty/77c13811ea5b25425516e810aa48c1ac to your computer and use it in GitHub Desktop.
Need coffee....
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
module Sand | |
( Base (..) | |
, Time | |
) | |
where | |
data Base | |
= Sec | |
| Nano | |
| Pico | |
deriving (Show, Eq, Ord) | |
data Time | |
= Time Base Int | |
deriving Eq | |
getCurrentTime | |
:: MonadIO m | |
=> m Time | |
fromYeOldeTime | |
:: UTCTime | |
-> Time | |
fromStringly | |
:: IsString s | |
=> s | |
-> Maybe Time | |
>>> t <- getCurrentTime | |
>>> t ^. _Year | |
-- (2016, Time Sec 823742837423784) -- Don't know how this would work yet | |
>>> t ^. _Year . _Day | |
-- (278, Time Sec 823742837423784) | |
_Year | |
:: Prism' (Int, Time) Time | |
_Day | |
:: Prism' (Int, Time) Time | |
_Weekday | |
:: Prism' (String, Time) Time |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment