For the base, combine the flour, egg yolk and cold butter and quickly work to a dough. Wrap in clingfilm and chill for about 30 minutes.
Wash and trim the fennel, remove the stalk and cut lengthwise into slices approximately 4 mm thick. Blanch in boiling, salted water for 6-8 minutes. Refresh and drain well.
For the filling, heat the butter in a pan until it foams, then stir in the flour. Stir in the milk and cream and simmer until thick and creamy. Then add the crème fraîche, thyme and Parmesan and season to taste with salt, pepper and nutmeg.
To construct the tart, caramelise the butter and sugar in a tart tin. Remove from the heat and lay half of the fennel side by side in the tin. Lay four slices of ham on top and pour half of the sauce over.
Repeat the process with the rest of the fennel, ham and sauce. Finally roll out the pastry on a floured work surface and lay on top of the tart. Prick several times with a fork and bake in a preheated oven (200°C with fan) for 20-30 minutes until golden brown.
Then take out of the oven and leave to cool for 5-10 minutes. Turn out carefully.
Serve garnished with deep-fried fennel and fennel leaves.