Created
April 8, 2020 02:58
-
-
Save StevenXL/c9b6671287437a9eca40b29f70089b46 to your computer and use it in GitHub Desktop.
Elm - Simulating Maybe.map6
This file contains 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
Maybe.map5 | |
(\year month day hour minute -> | |
{ year = year | |
, month = month | |
, day = day | |
, hour = hour | |
, minute = minute | |
, second = 0 | |
} | |
) | |
(parseIsoYear str) | |
(parseIsoMonth str) | |
(parseIsoDay str) | |
(parseIsoHour str) | |
(parseIsoMinute str) | |
|> Maybe.andThen | |
(\val -> | |
case parseIsoSecond str of | |
Just seconds -> | |
Just { val | second = seconds } | |
Nothing -> | |
Nothing | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment