“Tam Lin” takes place on Halloween, but it is not a ghost story. It is instead that curious and little-known object: a feminist and pro-choice medieval Scottish ballad.

“Tam Lin” is catnip to women who write Celtic-inflected fantasy of the kind I imprinted on as a teenager — you get to pull from all sorts of old archetypes and fantasies and still have women who do things, and you don’t have to qualify your retelling as “revisionist.” For that reason, “Tam Lin” is the basis of three different YA fantasy novels, each with a different, slightly overlapping cult fandom.

The earliest, and in many ways the most straightforward and the most romantic, is Elizabeth Marie Pope’s The Perilous Gard, which was written in 1974; it’s a period piece filled with spooky Elizabethan castles and underground caves.

Then came the most ambitious and beautifully crafted version, Diana Wynne Jones’s Fire and Hemlock, published in 1984. Of the three, it contains the love story that is most difficult to reconcile with 2016’s sexual mores.

And finally in 1991 came the most divisive version, Pamela Dean’s Tam Lin. It’s set at a liberal arts college in the ’70s, and everyone who reads it either loves it or despises it or both at once. (I myself am in the both camp.)

These three adaptations grapple intensely with their source material, and with the extraordinary agency and independence of its heroine. Reading them, you begin to see a taxonomy of all the ways in which we are culturally okay with a woman having agency and choice, and all the ways in which we aren’t.

“Tam Lin” is about a woman taking charge of her body and her fate

In its most basic form, “Tam Lin” tells the story of a girl named Janet whose lover is a fairy knight named Tam Lin. Janet finds that she is pregnant, so on Halloween she hikes up her skirt and heads out to pick some herbs that will induce an abortion.

At this point, Tam Lin appears and asks her not to pick the herbs. Janet replies, more or less, “Fuck you, I do what I want,” and explains very reasonably that she has no intention of raising a child by herself while the father is off gallivanting around a fairy court.

But Tam Lin is absolutely willing to help her raise the child, he tells her. He used to be a mortal man, but because he was so handsome, the queen of fairies took him for her own, and now, on Halloween, she plans to sacrifice him to hell. But Janet can save him.

So Janet hikes up her skirt and heads off to save her man. She goes to the Fairy Queen’s midnight procession, where she pulls Tam Lin off his horse. The Fairy Queen turns him into all manner of creatures — a lion, a swan, a burning brand — but Janet continues to hold on to him, and in the end this proves that Tam Lin belongs to her. That’s when the Fairy Queen addresses the lovers, telling them that if she had known what was going to happen, she would have turned Tam Lin into a tree or, in some versions of the story, blinded him.

It’s an odd and beautiful tale that insists on the agency of its heroine. Tam Lin’s body betrays him by turning into anything the fairies please, but Janet has the ultimate control and final say over her own body: it’s she who initially seduces Tam Lin and she who ultimately decides on the terms of her pregnancy. She’s willing to have the baby if there’s a father in the picture, but she makes it clear that otherwise, she’ll terminate the pregnancy. And it is Janet’s strength and power that saves Tam Lin — and she saves him from another powerful woman.

But the Fairy Queen gets the last word, and the eeriness of her threat to Tam Lin settles over the hopefulness of Janet’s triumph in a creepy, skin-crawling moment that makes this story perfect for Halloween.

The Perilous Gard imposes Christian morality onto the Tam Lin myth

In The Perilous Gard, Janet is a clumsy and awkward young noblewoman named Kate, and the fairies are the descendants of Bronze Age British pagans who have kept their holy cults alive in hidden caves under the hill. Tam Lin is named Christopher, and he has, in a Christ-like fashion, sacrificed himself to the fairy folk to save a little girl. At Halloween, they plan to burn him alive.

The fairy folk kidnap Kate, too, first to use her as a maid. Later, after she earns their respect by refusing to let them drug her, they give her a makeover so that she is no longer clumsy and awkward. Kate is determined to rescue Christopher from his fate, but he is growing ever more nihilistic in the underworld, so to save him, she keeps him talking. The book’s most memorable set piece is the long, swooningly romantic sequence in which Kate and Christopher sit together in the total darkness of the fairy folks’ caves, talking to each other about a manor Christopher would like to restore and slowly falling in love.

It’s a very Christian imagining of Tam Lin, with lots of dark muttering over the “heathen” fairy folk, whose magic always proves to be illusory and whom Kate and Christopher are able to escape because of their good Christian morality. Christopher is a worthy sacrifice not because he is tall and handsome, like Tam Lin in the ballad, but because he is noble and self-sacrificing, like Jesus. And Kate saves him not through any means so sinful and bodily as a pregnancy but by reminding him, tartly, that he is not a pagan god.

But despite Kate and Christopher’s disavowal of the fairy folk and their heathen ways, the fairies remain profoundly attractive. They are all tall and fine-boned, with lilting voices and beautiful, liquid movements. And after they teach Kate how to move the way they do, she becomes beautiful too, to the point that when she leaves the underworld, she has become a match for her lovely and undermining sister.

The moment has all the satisfaction of a makeover movie, and it’s underlined by the book’s equivalent of the makeover montage: Kate’s makeover is interspersed with her conversations with Christopher about the manor, so that the two sequences blend together and become a single thrilling scene. The book jumps from Kate’s fairy tutor instructing her to “suppose that you had to pass an enemy in the dark, and so you want feet made out of velvet” to Christopher discussing the pros and cons of adding a dairy to his manor, and then back again, without so much as a word of transition.

The effect is to balance the purely spiritual and romantic connection between Kate and Christopher with the bodily strength and purity of the fairy folk. The two threads become intertwined, each heightening the other, until the ostensibly ascetic and spiritual Perilous Gard becomes a kind of argument for the power and beauty of the body. Kate would never get pregnant out of wedlock, as Janet does in the ballad, but she still takes enormous pleasure in learning how to use her body to perform beauty.

Fire and Hemlock gives us an adult hero and a child heroine

The power of bodily, sexual beauty forms part of the core of Fire and Hemlock, although it, too, omits the pregnancy of the ballad. I say “part” because Fire and Hemlock is far too complex to be reduced to single themes like that; it’s a wildly intertextual book that plays with everything from old British ballads and fairy tales to classical Greek mythology to modernist poetry, and it has all sorts of ideas about the heroic ideal and the value and force of storytelling and imaginative play. But one of the ideas it returns to again and again is that women’s sexuality is a powerful and even threatening force — even the sexuality of very young women; even, in fact, the sexuality of little girls.

The Janet of Fire and Hemlock is named Polly, and when we first meet her she is 10 years old, living in suburban England circa the 1980s, and making the acquaintance of Tom Lynn, an adult cellist. Tom tells Polly that he’s in the middle of a nasty divorce from a woman named Laurel, but as the book develops it gradually becomes clear that Laurel is the Fairy Queen, that she owns Tom, and that nine years after their ostensible divorce, she plans to sacrifice him and eat his life force.

From the beginning, there’s a kind of subliminal (and, from a 2016 perspective, deeply uncomfortable) sexual tension between the child Polly and the adult Tom. Ten-year-old Polly, who is pretty and knows it, realizes “that she was trying to flirt with Mr. Lynn,” and although she feels briefly guilty about it, she decides that it’s all right because “she did think Mr. Lynn was nice anyway. Polly never flirted with anyone unless she liked them.”

And it’s apparently a mutual attachment. We learn by the end of the book that Tom has known from the beginning that Polly was the only one who could save him from the Fairy Queen, which by the rules of magic means that he must have known, when he first met her, that she would grow up to be his one true love. He doesn’t touch her until she’s 19, but when he kisses her for the first time, he says, “I’ve always loved your hair,” in a moment that seems designed to remind the reader that Tom complimented Polly on her hair when he met her as a child.

Polly’s mother Ivy, meanwhile, constantly accuses Polly of carrying on with Ivy’s boyfriends behind Ivy’s back — prepubescent Polly being, as far as Ivy is concerned, a viable sexual threat. Sexual jealousy is one of the most destructive forces to exist in this book, and when Ivy is carried away by it, she throws Polly out of her house.

Later, 15-year-old Polly is overtaken by the same destructive force, becoming overpoweringly jealous of the beautiful and glamorous Laurel and her hold on Tom. It’s this jealousy that prompts Polly to try to use magic to bring Tom to her, in an echo of Janet clutching Tam Lin in the ballad, to save him from the Fairy Queen. But in Fire and Hemlock, Polly’s possessiveness is destructive rather than redemptive. The spell backfires, ripping her away from Tom for years.

Fire and Hemlock considers the romantic bond between Polly and Tom, the one that begins when Polly is a child and Tom an adult, to be achingly beautiful and poetic. It also recognizes that their dynamic is unjust and unhealthy. That’s why in the end, to save Tom, Polly has to push him away by giving voice to the dark underbelly of their pairing. “You took me over as a child to save your own skin,” she tells him, and she’s telling the truth.

Pamela Dean’s Tam Lin grapples with pregnancy and reproductive choice

Pamela Dean’s Tam Lin is the only one of these adaptations to include the pregnancy plot from the ballad. It is also, of all of these adaptations, the one that is least focused on the body, and there’s a sense in which that distance and abstraction is what allows a pregnancy to take place. The characters of Dean’s Tam Lin are so intellectual, to the exclusion of all else, that it’s difficult to imagine that they own bodies or have sex, even when they’re talking about sex.

The Janet here is named Janet, and she’s an English major at a small Midwestern liberal arts college in the 1970s. Most of the book is given over to luxuriating in Janet’s college experience: following her from class to class and book to book, and obsessing over the minutiae of her various dorm rooms, the unjustness of the fates that stuck her with an incompatible roommate, and the beauty of the various Shakespeare-quoting boys with whom Janet and her roommates take up.

The specter of pregnancy is constantly present. All of the female students at the college keep retelling stories of college women who got pregnant and killed themselves. To forestall such an occasion, Janet’s roommates begin taking a terrible early iteration of the Pill that causes them to vomit constantly. Janet herself relies on a weirdly effective herbal remedy supplied her boyfriend.

That boyfriend, as we eventually learn, is a fairy, because the Fairy Queen is the head of the classics department at this college, and the boy is a classics major. College, in the eyes of this book, is a fairy land, an idyll where time stops and visitors glut themselves on fairy intoxicants: Janet more than once compares the effects of great literature to the effects of alcohol or drugs, because Janet is a little bit insufferable that way.

But Janet doesn’t learn about the fairies until she dumps her fairy boyfriend, hooks up with a guy named Thomas Lane, and gets pregnant. That’s when Thomas reveals that he’s owned by the head of the classics department, that she plans to kill him on Halloween, and that the only way he can escape is by having a pregnant woman hold on to him while he turns into all manner of creatures.

Dean’s Janet, like the Janet of the ballad, does not want to be pregnant, and like the Janet of the ballad, she initially plans to use herbs to induce an abortion. But unlike the Janet of the ballad, Dean’s Janet would not be perfectly happy to have a baby if she had a partner to share the burden with. She had her whole life ahead of her, she thinks, and she was just starting to think she might be a good literary critic, too. She tells her roommates to put her on suicide watch so she won’t do anything stupid, and when at last she reluctantly decides to continue the pregnancy, it’s only because she can think of no other way to save Thomas.

But Janet plans to make sure that the pregnancy won’t interfere with her true love, which is the life of the mind. She’ll take a year off to have the baby, then leave it with her mother and finish college. She’ll go on to graduate school. She might get married in between; it doesn’t particularly matter. What matters, at the end of the book, is that Janet is prompted to write a poem.

The poem is her real child, because Dean’s Tam Lin is a book about minds and their products, and bodies don’t particularly matter here. Janet’s unborn child never feels more than theoretical, but the potential of her poem feels incredibly concrete and present.

Do we want Janet to have to cede control to Tam Lin?

If the ballad of “Tam Lin” is defined by its heroine’s agency, and by her control over her own mind and body, its adaptations grapple fiercely with how much control she should be allowed to have, and over what.

Pope’s Kate saves herself ostensibly by harnessing her command of her Christian soul, but her gradually developed control over her body is just as important and just as satisfying, even when she disavows it. Jones’s Polly, trapped in a love story with a wildly uneven power dynamic, loses everything when she clutches at control over the relationship, and she’s only redeemed when, in the end, she rejects it. And Dean’s Janet is ambivalent in her control over her own body, but she doesn’t care overmuch: She controls her mind, and that’s enough for her.

What “Tam Lin” stories give us is a chance to figure out just how comfortable we are with women who are in control — and whether or not we’d prefer to see them lose that control to their male love interests.