lookupSubstitution :: String -> Substitution -> Maybe (Set.Set String, Maybe Term)
lookupSubstitution s = listToMaybe . Map.toList . Map.filterWithKey (\k _ -> Set.member s k)
lookupSubstitution :: String -> Substitution -> Maybe (Set.Set String, Maybe Term)
lookupSubstitution s = listToMaybe . Map.toList . Map.filterWithKey (\k _ -> Set.member s k)
lookupSubstitution s = listToMaybe . Map.toList . Map.filterWithKey (\k _ -> Set.member s k)