In many recent domestic thrillers, the credibility of the female witness is at stake. Illustration by Jeffrey Smith

An archetype, as Mark Twain might have observed, is nothing but a stereotype with a college education. Where modernists and postmodernists boldly plunder the collective treasuries of myth, legend, fairy tales, and art for their own idiosyncratic purposes, commercially minded writers replicate formulaic situations, characters, and plots in order to appeal to a wide audience. The challenge is to invest the generic formula with just enough distinction—what dust-jacket blurbs might praise as “originality”—without leaving formula behind; to fuse the familiar and the unfamiliar while assuring the reader that the ending will be clear, decisive, and consoling in a way that “literary fiction” usually is not.

“The Woman in the Window” (Morrow), a highly successful début novel by the pseudonymous A. J. Finn (thirty-eight-year-old Daniel Mallory, a former editor at Morrow), is a superior example of a subset of recent thrillers featuring “unreliable” female protagonists who, despite their considerable handicaps—which may involve alcoholism, drug addiction, paranoia, and even psychosis—manage to persevere and solve mysteries where others have failed. Its title evokes such best-sellers as “The Girl on the Train” and “The Woman in Cabin 10,” not to mention “Gone Girl” (in which the titular girl is the contriver of the mystery), while its frame of reference involves classic American noir films: “Gaslight,” “Vertigo,” “Strangers on a Train,” “Wait Until Dark,” “Sudden Fear,” “Rope,” and, most explicitly, “Rear Window.” Indeed, although the protagonist of “The Woman in the Window,” a thirty-nine-year-old child psychologist named Anna Fox, is wryly self-aware, her mode of narration resembles a film script. We get very short chapters and a preponderance of single-sentence paragraphs, in cinematic present-tense prose that seems to teeter breathlessly on stiletto heels:

The phone rings. My head swivels, almost back to front, like an owl, and the camera drops to my lap. The sound is behind me, but my phone is by my hand. It’s the landline . . . It rings again, distant, insistent. I don’t move. I don’t breathe. Who’s calling me? No one’s called the house phone in . . . I can’t remember. Who would even have this number? I can barely remember it myself. Another ring. And another. I shrivel against the glass, wilt there in the cold. I imagine the rooms of my house, one by one, throbbing with that noise. Another ring. I look across the park.

Such staccato paragraphs expand “The Woman in the Window” to more than four hundred pages even as they allow those pages to be read and turned in a near-continuous forward motion.

Anna Fox, seemingly estranged from her husband and young daughter, and living alone in a five-story brownstone in a gentrified Manhattan neighborhood, is a sophisticated addition to the sisterhood of impaired and befuddled female protagonists confounded by mysteries erupting in their lives. Since a personally devastating experience some months before, Anna has become cripplingly agoraphobic:

Many of us—the most severely afflicted, the ones grappling with post-traumatic stress disorder—are housebound, hidden from the messy, massy world outside. Some dread the heaving crowds; others, the storm of traffic. For me, it’s the vast skies, the endless horizon, the sheer exposure, the crushing pressure of the outdoors. “Open spaces” the DSM-5 calls it vaguely. . . . As a doctor, I say that the sufferer seeks an environment she can control. Such is the clinical take. As a sufferer (and that is the word), I say that agoraphobia hasn’t ravaged my life so much as become it.

It is said that most agoraphobics are female and that there are far more of them than statistics suggest. For some, the disorder seems to begin in childhood; for others, like Anna, agoraphobia is a consequence of a traumatic episode or episodes, perhaps exacerbated by guilt and a wish to self-punish.

As in “Rear Window,” the mystery begins when a housebound but sharp-eyed and inquisitive person happens to see, or imagines that she has seen, a murder committed through a neighboring window. Anna, in her quasi-paralysis, has become a shameless voyeur; she has acquired a camera with a powerful zoom lens that apparently allows her not only to spy on lovers next door but to note the very “archipelago of tiny moles trailing across the back” of a beautiful red-haired adulteress. (Her neighbors resent being spied on, but not enough to pull down the blinds.) Anna can even peer some distance into rooms, as in an Edward Hopper painting of preternatural exposure and clarity.

Indeed, “The Woman in the Window” seems set in mid-century small-town America, not in twenty-first-century Manhattan. When Anna summons the police, she is visited by Conrad Little, an affable and loquacious detective, and engages him in TV-style repartee. Following the dictates of the genre, Detective Little does not believe Anna; his cursory investigation doesn’t indicate that any crime has been committed. But, in the manner of a kindly small-town sheriff, he remains indulgent of her and her suspicions.