[m-rev.] for review: prepare for llds string trie switches

Peter Wang novalazy at gmail.com
Wed Mar 27 16:32:47 AEDT 2024


On Wed, 27 Mar 2024 11:19:47 +1100 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:

> diff --git a/library/map.m b/library/map.m
> index 3339ef580..b4fd7c8b4 100644
> --- a/library/map.m
> +++ b/library/map.m
> @@ -574,6 +574,18 @@
>  :- mode union_list(in(pred(in, in, out) is semidet), in, in, out) is semidet.
>  :- mode union_list(in(pred(in, in, out) is det), in, in, out) is det.
>  
> +%---------------------------------------------------------------------------%
> +%
> +% Composing two maps.
> +%
> +
> +    % compose_maps(MapAB, MapBC, MapAC):
> +    %
> +    % Given each A - B pair in MapAB, return the map that pairs
> +    % each such A with the C corresponding to its B in MapBC.
> +    %
> +:- pred compose_maps(map(A, B)::in, map(B, C)::in, map(A, C)::out) is det.
> +

Add something like:

    Throw an exception if there is no value associated with B in MapBC.

That seems fine.

Peter


More information about the reviews mailing list