The Haunted Monastery is a gong'an detective novel written by Robert van Gulik and set in Imperial China (roughly speaking the Tang dynasty).
It is a fiction based on the real character of Judge Dee (Di Renjie), a magistrate and statesman of the Tang court, who lived roughly 630–700.
Judge Dee is a Confucian and has a poor opinion of Taoism which, like Buddhism, encourages adherents to enter monastic life.
"Some interesting sidelights on Confucian and Taoist beliefs emerge from this tale of corruption and murder in a monastery, where Judge Dee runs into considerable danger but ends up administering justice in a primitive way.
[3] It was filmed with Khigh Dhiegh as Dee and an all-Asian cast (including Mako, Keye Luke, Soon-Tek Oh, Irene Tsu and James Hong).