Created
January 10, 2017 01:10
-
-
Save asayers/8414c6a3904b0db99fde446f701eddf6 to your computer and use it in GitHub Desktop.
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
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
| -- timeOfDay (1:20) => TimeOfDay 1 20 0 | |
| -- timeOfDay (1:20:36) => TimeOfDay 1 20 36000000 | |
| -- timeOfDay (1:20:36.1) => TimeOfDay 1 20 36100000 | |
| timeOfDay :: [TimePart] -> TimeOfDay | |
| timeOfDay xs = undefined | |
| newtype TimePart = TimePart Int deriving (Num) | |
| instance Num [TimePart] where fromInteger x = [TimePart (fromIntegral x)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment