upstream: https://github.com/mirage/mirage-crypto
at main 7 lines 279 B view raw
1(** Internal utilities for crypto-pk. *) 2 3val until : ('a -> bool) -> (unit -> 'a) -> 'a 4(** [until p f] repeatedly calls [f ()] until [p] holds on the result. *) 5 6val guard : bool -> 'a -> (unit, 'a) result 7(** [guard p err] is [Ok ()] if [p] is true, [Error err] otherwise. *)