In a Dutch oven, bring all the ingredients to a boil and, when the pumpkin starts releasing water and the sugar starts melting, lower the heat to low and let it cook until it falls apart. That should take anywhere from 30 to 45 minutes.
When the pumpkin is cooked and falling apart, mash it with a potato masher until roughly puréed, add the coconut and cook for 10 more minutes.
Let it cool before serving. The compote can be served cool or at room temperature.