Recently, I've read a few novels that blend the speculative and mystery genres with mixed success. So I wondered what made a good mystery that also scratches the speculative itch.
When it comes SF, Isaac Asimov's The Naked Sun and "The Billiard Ball" both do well--not to omit Larry Niven's Flatlander. Asimov and Niven work the more difficult territories of "whodunnits": displaying a cast of criminals, shifting blame until we land on the criminal at the end. They do not shirk the responsibility of creating speculative societies in the meantime. Niven, if I recall correctly, said he wouldn't write another SF mystery as obeying the two genres was too difficult.
"Howdunnits" explore the criminal's methodology. While you may know who the criminal is, you can't convict him without evidence.
There is also the "whydunnit" which is usually the exploration of a criminal mind--sometimes within the mind of the criminal. A famous example would be Edgar Allan Poe's "The Tell-Tale Heart."
When it comes to recent fantasy mysteries, I Am Not A Serial Killer by Dan Wells actually melds a few of these. The narrator, John Wayne Cleaver, is a high school student whose mother is a mortician. He helps embalm the bodies. The first part of the narrative, oddly enough, is a description of how this is done. This is a pretty risky step to take, but Wells successfully surmounts the limitations by creating a narrator buoyant with dark humor--a kid so fascinated by serial killers that he fears he might become one himself. His very name mirrors not only John Wayne (All-American hero) but also John Wayne Gacy (notorious serial killer) and, of course, an infamous murder weapon.
He does his best to look "normal" and fit in with most teenagers, but his mother notices a small part of his fascination and sends him to get psychological help. Later, when he thinks he spies the work of a serial killer in their small town, she excludes him from the joys of embalming since he likes it too much. This exacerbates the problem.
There is an element of whodunnit here since the identity of the killer is not immediately known, but we are not privy to an analysis of suspects. Instead, it is more of a howdunnit and whydunnit. First, Cleaver is a serial killer in the bud, trying to nip it, which makes fascinating reading. Next, he shifts to typical serial killer MO's. Once he finds his suspect, he hones in on the how and why of his suspect and how he might stop the killer from killing again.
The ending itself is potent as Wells manages to make us feel two ways about the killer. The main reason the novel as a mystery succeeds is that it redirects our attention from whodunnit to why/howdunnit. The If you like mysteries and horror, this is a must-read.
Wells deserved more attention for this novel that he got initially. Perhaps that was a function of the risky opening. Still readers can still remedy that. This one should be one of Wells's longer lived works.