Preheat the oven to 200°C.
Sieve the flour, salt, and polenta into a large bowl and rub in the butter until it looks like breadcrumbs.
Add the egg and cold water, mixing until a smooth pastry forms.
Wrap the pastry in cling film and refrigerate for 30 minutes.
Place the apple slices in a 23cm round ovenproof dish.
Combine the melted butter with the cider and pour over the apples.
Sprinkle brown sugar over the apples and add the rosemary sprig.
Roll out the pastry on a floured surface to fit the dish.
Lay the pastry over the apples and tuck in the edges.
Sprinkle the top with caster sugar.
Bake for 10 minutes, then reduce the oven to 170°C and bake for 30-35 minutes more.
Serve the dish hot with cheese, cream, or ice cream.