The idea of incorporating iconic author Edgar Allan Poe, the inventor of the modern detective story, into a whodunit would seem like a winning one. And so it proved for writer Louis Bayard whose 2003 mystery novel “The Pale Blue Eye” did just that — to widespread praise.

In adapting Bayard’s work for the screen, moreover, writer-director Scott Cooper, whose eponymous film is currently streaming on Netflix, gets things off to a promising start. He successfully evokes a gothic atmosphere and sets a quick pace for the action.

What viewers will make of the plot’s eventual wrap-up, however, is less certain. Whether or not they find the tale’s twisty outcome satisfying, they should know, going in, that moral complexity and seamy subject matter make Cooper’s movie best for grown-ups.=

The focus initially is not on Poe but on Augustus Landor (Christian Bale). A once-renowned New York City detective, by the time of the narrative’s 1830 setting the hard-drinking Landor is living in isolated retirement in the Hudson Valley. He’s primarily troubled by the fate of his vanished daughter Mattie (Hadley Robinson), the circumstances of whose disappearance remain murky.

Following the murder and mutilation of a cadet at the U.S. Military Academy at West Point, the authorities there, led by Superintendent Sylvanus Thayer (Timothy Spall), turn to Landor for help. He collaborates with the academy’s resident doctor, Daniel Marquis (Toby Jones), and with Poe (Harry Melling), presumably one of the more eccentric members of the corps, then or since.

Melling builds up a convincing persona, awkwardly poetic, shyly macabre with a veneer of antebellum Southern gentility. As Poe falls for Marquis’ daughter Lea (Lucy Boynton) and builds a friendship with Landor, the path to identifying the culprit — who has apparently gone on to claim further victims in the meantime — takes more than one unexpected bend.

Along the way, challenging motifs are introduced. They include rape, black magic, Landor’s commitment-free sexual interaction with local tavern waitress Patsy (Charlotte Gainsbourg) and a storyline concerning vengeance — the treatment of which in the script is at least in tension with, if not contradictory of — Scriptural teaching.

All these elements suggest a mature audience. So, too, does the picture’s momentary yet ambiguous depiction of Christian faith.

“The Pale Blue Eye” is assuredly not on par with the works that have gained the real-life counterpart of one of its principal characters literary immortality. Yet, overheated and lurid as it sometimes turns out to be, it does conjure up at least some of the morbid mystique that keeps Poe in print almost 175 years after the former cadet’s untimely death.

The film contains occult and other mature themes, including suicide and revenge, some gory violence and gruesome images, a sexual assault, an implied nonmarital relationship, at least one use of profanity and a couple of instances each of milder oaths and rough language. The OSV News classification is A-III — adults. The Motion Picture Association rating is R — restricted. Under 17 requires accompanying parent or adult guardian.

— John Mulderig