I recently started playing around with Haskell and can't seem to figure this one out.
I am trying to read from a YAML file that has this format:
id: 1
kind: good
created_at: !ruby/object:ActiveSupport::TimeWithZone
utc: &1 2017-01-01 10:34:12.533704000 Z
zone: &2 !ruby/object:ActiveSupport::TimeZone
time: *2
So far I can read the id and kind perfectly fine by doing this:
data Item= Item{
id :: Integer,
kind::String
}
And
instance FromJSON Item where
parseJSON(Object v) = Item <$>
v .: "id" <*>
v .: "kind"
I am using the package "Data.Yaml" and this function:
let items = Data.Yaml.decode ymlData :: Maybe[Item]
But I can't seem to figure out how to get the timestamp.
What would be the proper way of getting the timestamp, only the "utc" is needed.