when-let in permute