-- Ex. 5
whatWentWrong :: [LogMessage] -> [String]
whatWentWrong = map getMsg . inOrder . build . filter (isSevereError)
  where
    getMsg (LogMessage _ _ msg) = msg
    getMsg _ = "" -- for the Unknown case again
    isSevereError (LogMessage (Error sev) _ _) = sev >= 50
    isSevereError _ = False
whatWentWrong :: [LogMessage] -> [String]
whatWentWrong = map getMsg . inOrder . build . filter (isSevereError)
  where
    getMsg (LogMessage _ _ msg) = msg
    getMsg _ = "" -- for the Unknown case again
    isSevereError (LogMessage (Error sev) _ _) = sev >= 50
    isSevereError _ = False
whatWentWrong = map getMsg . inOrder . build . filter (isSevereError)
  where
    getMsg (LogMessage _ _ msg) = msg
    getMsg _ = "" -- for the Unknown case again
    isSevereError (LogMessage (Error sev) _ _) = sev >= 50
    isSevereError _ = False