StasyaGera / todo-cli

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Add timestamp parameter for 'Todo` data type and function to create 'Todo' with time #13

Open chshersh opened 6 years ago

chshersh commented 6 years ago

Use this data type from time package:

Also, I suggest to store Maybe UTCTime to be able to perform pure property-based tests without knowing something about IO.

StasyaGera commented 6 years ago

I have started doing this task and faced with a difficulty. UTCTime is not a hashable instance, so I guess I have to implement it by myself. After some googling I found this. Should I import it or just copy some instances?

StasyaGera commented 6 years ago

I also think I should change Deadline Int to Deadline UTCTime.

chshersh commented 6 years ago

@StasyaGera I don't think you need Hashable instance for UTCTime and you can avoid implementing it. You can just translate UTCTime to some integer (unix timestamp) and hash that integer. Since you're implementing instance Hashable Deadline you have more options about what to do.