we should eventually have a nice docs page detailing how to define a custom data type. at the moment this is missing from #2874.