Skip to content

Instantly share code, notes, and snippets.

@dabd
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save dabd/c5308b42b4366acca69d to your computer and use it in GitHub Desktop.

Select an option

Save dabd/c5308b42b4366acca69d to your computer and use it in GitHub Desktop.
whatWentWrong :: [LogMessage] -> [String]
whatWentWrong msgs = map (\m -> case m of
(LogMessage _ _ s) -> s
_ -> "")
$ dropWhile (\m -> case m of
(LogMessage (Error severity) _ _) -> severity >= 50
_ -> False) .
filter (\m -> case m of
(LogMessage (Error _) _ _) -> True
_ -> False)
$ inOrder $ build msgs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment