Mix together cocoa, flour, and sugar in a double boiler. Add egg yolks and milk and cook until thick. Add butter and vanilla, stirring well. Cool. Pour into an 8-inch baked pie shell. Top with whipped cream, and chill, or top with meringue and bake at 325 degrees F for 10 minutes, or until brown.