In a medium saucepan combine half and half, coconut milk, and sugar. Cook over medium heat until sugar is dissolved, whisking constantly.
In a medium bowl, whisk egg yolks until smooth. Gradually whisk in about 1 cup of the hot half-and-half mixture; return all to saucepan. Cook and stir over medium-low heat until mixture coats the back of a spoon (170 degrees F). Remove from heat, add vanilla.
Transfer mixture to a heat-proof bowl and cover and chill 4 to 24 hours. Stir in ube.
Freeze chilled mixture in a 1 1/2-quart ice cream freezer according to manufacturer's directions. Ripen (transfer to a freezer-safe container and freeze) for 6 hours. Sprinkle each serving of ice cream with shredded coconut, if desired.