How does darkness in "Araby" change from initially bringing the narrator happiness to bringing him unhappiness at the end?
At the beginning of the story, the narrator seems to associate night with his feelings for Mangan's sister. If the night brings him happiness, it's because that's the time of day when he gets to see her. When it is "dusk" and the street lamps are lit, the children play in the dark, pretending, hiding, and running around. Sometimes, Mangan's sister comes out to look for her brother, "her figure defined by the light" of the doorway. When Mangan's sister finally does speak to the narrator, the light from a lamp "caught the white curve of her neck, lit up her hair that rested there and, falling, lit up the hand upon the railing."
She appears to the narrator like a dream, in part, because of the way the light sets her apart from the darkness, and, as a result, the darkness that makes their interaction possible makes him happy.
By the end of the story, however, the darkness at the bazaar shows the narrator just how little the world cares about him and his feelings. When the narrator arrives, "the greater part of the hall was in darkness" and seems deserted and empty. There is one stall open, however, and its "dark entrance" foreshadows the lack of luck he'll have finding a gift for Mangan's sister there. When another light goes out, the hall "was now completely dark," and the narrator realizes how vain he was to believe that the world would make way for his feelings. He just wanted to purchase a small gift for her, but his uncle was late, he needed money, the trains were delayed, the entrance fee to the bazaar was expensive, and then everything that might have been interesting to the narrator was closed anyway. All the setbacks, topped off by the terrible, belittling darkness, show the narrator how little his hopes matter in the world.