use a custom sum type for return()