toDatum' :: (JSON c, JSON q, JSON a, JSON e, JSON s) => ExerciseDatum -> Maybe (Datum c q a e s)
toDatum' = f . toDatum
  where f (Ok x) = Just x
        f _ = Nothing

-- | Some events of interest are not tied to a particular ear-training exercise.
-- For these, we have the type SessionDatum.
toDatum' :: (JSON c, JSON q, JSON a, JSON e, JSON s) => ExerciseDatum -> Maybe (Datum c q a e s)
toDatum' = f . toDatum
  where f (Ok x) = Just x
        f _ = Nothing

-- | Some events of interest are not tied to a particular ear-training exercise.
-- For these, we have the type SessionDatum.
toDatum' = f . toDatum
  where f (Ok x) = Just x
        f _ = Nothing

-- | Some events of interest are not tied to a particular ear-training exercise.
-- For these, we have the type SessionDatum.