Place lentils into a bowl and cover with several inches of cool water; let stand 8 hours to overnight. Drain and rinse.
Preheat oven to 350 degrees F (175 degrees C).
Heat 1 tablespoon olive oil in a wok or large skillet over medium heat; cook and stir onion until softened, 5 to 10 minutes. Add curry powder, cardamom, ginger, cumin, and cayenne pepper; stir to coat. Mix lentils, yam, water, and coconut milk into onion mixture; cook and stir over low heat until liquid is mostly reduced and lentils are tender, about 20 minutes. Remove wok from heat and lightly mash mixture.
Spoon about 1 1/2 tablespoons lentil mixture into the center of each pastry; fold pastry over filling creating a triangle. Fold edges into the triangle to seal. Arrange samosas on a baking sheet and brush remaining olive oil over the top.
Bake in the preheated oven until golden brown, 15 to 20 minutes.