Preheat the oven to 190°C (fan). Grease and flour a 23cm loose-bottomed flan tin.
To make the pastry, rub the flour and butter together (or whiz in a food processor), then stir in the sugar. Add the egg yolks and mix until you have a dough. (If the dough is dry, add a little water.) Knead briefly until smooth, then wrap in cling film and chill in the refrigerator for at least 15 minutes.
Meanwhile, for the filling, melt the cacao and butter by placing them in a large heatproof bowl over a pan of simmering water.
Put the sugar and maple syrup in a small pan and heat gently until the sugar has dissolved. Leave to cool.
Whisk the eggs in a bowl then whisk in the chocolate and syrup mixtures. Stir in the pecans.
Roll the pastry out on a lightly floured surface. Line the prepared tin with it. Place a sheet of greaseproof paper over the pastry then cover with baking beans.
Bake blind for 10–15 minutes. Remove the paper and beans and return the pastry to the oven for a couple of minutes if it’s still slightly tacky.
Pour the filling into the pastry case and bake for 10–15 minutes or until the nuts have browned and the filling is firm. Leave to cool slightly before serving.