-- *** a.
typePartition :: ((Id, TypeScheme) -> Maybe Term) -- ^ Definiens extractor
              -> (TypeScheme -> Bool) -- ^ Filter predicate for types
              -> Set.Set Symbol -- ^ MatchOp symbol set
              -> Map.Map TypeScheme [MatchOp]
typePartition df tPred s =
    Map.fromListWith (++) $ mapMaybe g $ Set.toList s
        where f x = let typ = candType x
                    in if tPred typ then Just (typ, [x]) else Nothing
              g x = candFromSymbol df x >>= f
typePartition :: ((Id, TypeScheme) -> Maybe Term) -- ^ Definiens extractor
              -> (TypeScheme -> Bool) -- ^ Filter predicate for types
              -> Set.Set Symbol -- ^ MatchOp symbol set
              -> Map.Map TypeScheme [MatchOp]
typePartition df tPred s =
    Map.fromListWith (++) $ mapMaybe g $ Set.toList s
        where f x = let typ = candType x
                    in if tPred typ then Just (typ, [x]) else Nothing
              g x = candFromSymbol df x >>= f
typePartition df tPred s =
    Map.fromListWith (++) $ mapMaybe g $ Set.toList s
        where f x = let typ = candType x
                    in if tPred typ then Just (typ, [x]) else Nothing
              g x = candFromSymbol df x >>= f