Mix sugar, cornstarch, and water in a separate bowl to make a slurry.
Pour can of coconut milk in a pot and heat on stovetop.
When the coconut milk is just starting to bubble, pour in your cornstarch slurry very slowly while continuously whisking the hot coconut milk in the pot. It's important to keep stirring to avoid lumps.
Cook the haupia, continuously whisking, until the mixture has thickened to a pudding like consistency but is still pourable; this should only take a couple minutes. Do not let the mixture come to a full boil.
Take the haupia off the heat. Then, very gently spread over the purple sweet potato filling.
Place the pie into the fridge to let the haupia layer set. I like to leave it uncovered in the fridge until the top has become dry to the touch, then I cover with plastic wrap.
When the pie has fully cooled and the haupia is set (at least two hours), you can cut it into squares to serve.