In a saucepan over medium heat, melt the butter or coconut oil. Add the finely diced onion, apple, and curry powder to the pan. Sauté for about 10 minutes, or until the onion and apple are soft and fragrant.
Sprinkle in the flour and stir to combine. Cook for another minute, ensuring the flour is fully integrated.
Gradually pour in the coconut milk, whisking continuously to prevent any lumps from forming.
Bring to a boil, then reduce heat to low (to medium) and allow the sauce to simmer. Continue cooking until the sauce thickens to your desired consistency, stirring occasionally. Adjust seasoning with salt and pepper to taste.