Caroll Hall, who composed and wrote the music for the Broadway musical “The Best Little Whorehouse in Texas,” died Oct. 11 in New York City, her publicist announced. Hall had been living with a rare form of dementia called logopenic primary progressive aphasia for three years. She was 82.

“The Best Little Whorehouse” opened in 1978 and ran for 1584 performances. It was nominated for six Tony Awards, winning two for featured actor and actress. Later, Dolly Parton and Burt Reynolds starred in the 1982 film version, with Parton performing Hall’s “Hard Candy Christmas” in the production.

Hall also contributed music and lyrics to Marlo Thomas’ 1974 “Free to Be …You and Me,” a children’s TV special and album that celebrated gender neutrality and tolerance. Hall also wrote songs for “Sesame Street,” including the Grammy-winning “True Blue Miracle,” “The Plant in The Window,” and “Women Can Be.”

Born on April 3, 1936, in Abilene, Texas, Hall began studying the piano at a young age. Earlier in her career, she wrote advertising jingles and was accepted into the composer Lehman Engel’s BMI Workshop for aspiring musical-theater songwriters. Her song “Jenny Rebecca” was included in Barbra Streisand’s 1965 album “My Name Is Barbra.” Hall also released two solo albums in the early 1970s.

Hall is survived by her husband and two children.