mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-16 14:25:56 +00:00
Use a standard library predicate in a spot.
compiler/type_constraints.m:
The local predicate remove_maybe/2 is provided by the
standard library predicate maybe_is_yes/2.
This commit is contained in:
@@ -480,7 +480,7 @@ create_vartypes_map(Context, ProgVarSet, TVarSet, VarMap, DomainMap,
|
||||
bimap.ordinates(VarMap, ProgVars),
|
||||
list.map2(find_variable_type(Context, ProgVarSet, TVarSet, VarMap,
|
||||
DomainMap, ReplacementMap), ProgVars, Types, MaybeErrors),
|
||||
list.filter_map(remove_maybe, MaybeErrors, Errors),
|
||||
list.filter_map(maybe_is_yes, MaybeErrors, Errors),
|
||||
vartypes_from_corresponding_lists(ProgVars, Types, Vartypes).
|
||||
|
||||
% If a variable has a domain consisting of one type, gives it that type.
|
||||
@@ -2477,10 +2477,6 @@ type_to_string(TVarSet, Type, Name) :-
|
||||
% General purpose utilities.
|
||||
%
|
||||
|
||||
:- pred remove_maybe(maybe(T)::in, T::out) is semidet.
|
||||
|
||||
remove_maybe(yes(X), X).
|
||||
|
||||
% zip_single(Elem, List, NewList):
|
||||
%
|
||||
% NewList is the result of adding Elem between each element in List.
|
||||
|
||||
Reference in New Issue
Block a user