1. In a bowl, beat egg yolks with a fork to blend.
2. In a 3- to 4-quart pan, mix flour, cornstarch, and sugar. Gradually whisk in soy milk until smooth.
3. Add chopped chocolate. Stir over high heat until mixture comes to a full boil, 6 to 10 minutes. Boil, stirring, for 1 minute.
4. Stir about 1/2 cup hot pudding into egg yolks, then pour yolk mixture into pan. Cook, stirring, for 1 minute more. Remove from heat. Add margarine and vanilla and stir until margarine is melted.
5. Pour pudding into a serving dish or individual dishes. Serve warm, or cover pudding surface with plastic wrap and chill up to 24 hours