commonOpType :: CS.Sign f e -> Set.Set OpType -> Result OpType
commonOpType csig os = do
  l <- commonType csig $ map (\ o -> opRes o : opArgs o) $ Set.toList os
  case l of
    r : args -> return $ mkTotOpType args r
    _ -> fail $ "no common types for " ++ showDoc os ""
commonOpType :: CS.Sign f e -> Set.Set OpType -> Result OpType
commonOpType csig os = do
  l <- commonType csig $ map (\ o -> opRes o : opArgs o) $ Set.toList os
  case l of
    r : args -> return $ mkTotOpType args r
    _ -> fail $ "no common types for " ++ showDoc os ""
commonOpType csig os = do
  l <- commonType csig $ map (\ o -> opRes o : opArgs o) $ Set.toList os
  case l of
    r : args -> return $ mkTotOpType args r
    _ -> fail $ "no common types for " ++ showDoc os ""