commonType :: CS.Sign f e -> [[SORT]] -> Result [SORT]
commonType csig l =
  case map (keepMaximals csig) $ transpose l of
    hl | all (not . null) hl -> return $ map head hl
    _ -> fail $ "no common types for " ++ show l
commonType :: CS.Sign f e -> [[SORT]] -> Result [SORT]
commonType csig l =
  case map (keepMaximals csig) $ transpose l of
    hl | all (not . null) hl -> return $ map head hl
    _ -> fail $ "no common types for " ++ show l
commonType csig l =
  case map (keepMaximals csig) $ transpose l of
    hl | all (not . null) hl -> return $ map head hl
    _ -> fail $ "no common types for " ++ show l