Peel and slice the potatoes, apples, and onions. Cut the ham or bacon into small pieces. Place a layer of the potatoes in the bottom of the dish, then the bacon and apples (add sugar or Golden Syrup if sour). Repeat until the dish is quite full. Season each layer with a little salt and pepper, and sprinkle with onions. Pour the stock over it all. Cover the dish with the shortcrust and bake for 1 and 1/2 hours in a moderate oven.