The show's screenwriter Nic Pizzolatto admitted that True Detective started life as a book, but not a book that was ever published as such:
When he started writing and developing the, it became clear to him that the themes he was trying to portray would be best communicated through tv instead of writing.
"When I was working on the actual story to contain these two men and the themes I wanted to touch on, I was thinking about breaking into TV. I thought it would work well as a TV show since there are so may signifiers that could identify where you are. To me, it was better suited than a novel."
You might find the following documentary about the making of True Detective quite interesting if you'd like to learn more about the book that became a hit HBO tv show: