From 0f5161930584eaf91fd195b891ce7d9130c7b7f1 Mon Sep 17 00:00:00 2001 From: Estevan Castilho Date: Sat, 24 Oct 2026 01:30:08 +0000 Subject: Forsake `fmap` --- lib/evaluators/FOL.ml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/evaluators/FOL.ml') diff --git a/lib/evaluators/FOL.ml b/lib/evaluators/FOL.ml index 90f79ca..f337d61 100644 --- a/lib/evaluators/FOL.ml +++ b/lib/evaluators/FOL.ml @@ -53,13 +53,13 @@ let rec term_of_bencode = | Bencode.Tagged ('b', segments) -> strings segments |> Result.map (fun segments -> Base (Kernel.Path.of_list segments)) | Bencode.Tagged ('p', data) -> - let* term = Bencode.field "term" data |> fmap term_of_bencode in - let* attributes = Bencode.field "attributes" data |> fmap strings in + let* term = Bencode.field "term" data |>> term_of_bencode in + let* attributes = Bencode.field "attributes" data |>> strings in Ok (Project (term, BatFingerTree.of_list attributes)) | _ -> Error (Error.malformed_program ()) let encode term = bencode_of_term term |> Bencode.to_bytes |> Bytes.to_string -let decode source = Bencode.of_bytes (Bytes.of_string source) |> Utilities.Result.fmap term_of_bencode +let decode source = Utilities.Result.(Bencode.of_bytes (Bytes.of_string source) |>> term_of_bencode) (* TODO: To strenghten our checks for self references, we need to construct a graph and see raise a condition if there are self @@ -105,7 +105,7 @@ let rec describe = let open Utilities.Result in function | Base relation -> Protocols.Relation.heading relation - | Project (plan, attributes) -> describe plan |> fmap (restrict attributes) + | Project (plan, attributes) -> describe plan |>> restrict attributes let rec modes = let open Utilities.Result in -- cgit v1.2.3