Preheat the oven to 350°F. Line a shallow 7 x 11-inch baking pan with waxed paper. Sift the flours together into a bowl. Stir in the coconut and make a well in the center. Combine the butter and sugar in a saucepan and stir over low heat until the butter has melted. Pour into the dry ingredients and stir well to combine. Press the mixture evenly into the pan with the back of a spoon. Bake for 10 minutes, then leave to cool.
To make the filling, combine the butter, corn syrup, and condensed milk in a saucepan. Stir over low heat until smooth. Continue stirring for 10 minutes. Pour over the pastry base and bake for 20 minutes.
To make the topping, place the chocolate and butter in a heatproof bowl over a saucepan of barely simmering water. Stir until smooth. Spread over the caramel and leave to set. Lift from the pan and cut into bars or squares to serve.