At half mast: why Parliament's flag is lowered during dark times

Recently it has become commonplace for the flag above Parliament to be flown at half mast. Some of Parliament's followers on Twitter and Facebook have asked why this is done. So, what does flying a flag at half mast represent?