import Data.Time
data DatabaseItem = DbString String
| DbNumber Integer
| DbDate UTCTime
deriving (Eq, Ord, Show)
theDatabase :: [DatabaseItem]
theDatabase =
[ DbDate (UTCTime
(fromGregorian 1911 5 1)
(secondsToDiffTime 34250))
, DbNumber 9001
, DbString "Hello, world!"
, DbDate (UTCTime
(fromGregorian 1921 5 1)
(secondsToDiffTime 34123))
]
My question:
I want to get the UTCTime.
So, thisFunction :: [DatabaseItem] -> [UTCTime]
I don't need the answer but more the intuition (a link to a youtube etc. is also possible) how to handle these types of situations. Because i keep trying to think in terms of key:values (Python,Julia) which doesn't seem the right paradigm to approach this.
thanks in advance!
best,