use newly available must_be(chars, ...) for better and shorter type test

This commit is contained in:
Markus Triska
2022-09-03 19:58:51 +02:00
committed by Mark Thom
parent 9c1de8e00b
commit 706ab2ae5b

View File

@@ -65,8 +65,7 @@
hex_bytes(Hs, Bytes) :-
( ground(Hs) ->
must_be(list, Hs),
maplist(must_be(atom), Hs),
must_be(chars, Hs),
( phrase(hex_bytes(Hs), Bytes) ->
true
; domain_error(hex_encoding, Hs, hex_bytes/2)