Hi,

given this:
import Data.Time

data DatabaseItem = DbString String
                  | DbNumber Integer
                  | DbDate   UTCTime
                  deriving  (EqOrdShow)

theDatabase :: [DatabaseItem]
theDatabase =
    [ DbDate (UTCTime
             (fromGregorian 1911 5 1)
      (secondsToDiffTime 34250))
    , DbNumber 9001
    , DbString "Hello, world!"
    , DbDate (UTCTime
             (fromGregorian 1921 5 1)
             (secondsToDiffTime 34123))
    ]


question from textbook is : write a function that filters for DbDate values and returns a list of the UTCTime values inside them.


my question could you give me an example of a working function, I don't get how i use the filter function on a data type in a list. Hence i am kinda stuck.

thanks in advance.

best,