From 482bc9ecb6ccba4ad760a81c755d9971b0f3079a Mon Sep 17 00:00:00 2001 From: Jeltz Date: Tue, 6 Sep 2022 17:19:22 +0200 Subject: [PATCH] Add infix operators --- utils.ml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils.ml b/utils.ml index 304b823..670ceff 100644 --- a/utils.ml +++ b/utils.ml @@ -2,3 +2,6 @@ let rec deoptionalise = function | Some x :: xs -> x :: deoptionalise xs | None :: xs -> deoptionalise xs | [] -> [] + +let ( &?> ) left right = match left with Error _ -> right | ok -> ok +let ( &> ) left right = match left with Error _ -> right | Ok ok -> ok