Not a blocker but did you consider an inline function? I think that gives type safety and tells the "user" of that function which types are expected as input parameters.