A tight, practical integration of relations and functions