Philip K. Dick’s A Scanner Darkly is set in a dystopian California future in which the protagonist lives a double life as a drug user and as an undercover cop.