diff options
| author | Estevan Castilho <tevo@riajuu.net> | 2026-10-24 01:30:08 +0000 |
|---|---|---|
| committer | Estevan Castilho <tevo@riajuu.net> | 2026-10-24 01:30:08 +0000 |
| commit | 0f5161930584eaf91fd195b891ce7d9130c7b7f1 (patch) | |
| tree | a505f4b7bfe8dc0b0efa06c42b75502aeb2f247a /lib/kernel/Branch.ml | |
| parent | 0b1c7ca41a6d8ce41b9783153b567c16250913ff (diff) | |
| download | RNT-0f5161930584eaf91fd195b891ce7d9130c7b7f1.tar.gz RNT-0f5161930584eaf91fd195b891ce7d9130c7b7f1.zip | |
Forsake `fmap`
Diffstat (limited to 'lib/kernel/Branch.ml')
| -rw-r--r-- | lib/kernel/Branch.ml | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/kernel/Branch.ml b/lib/kernel/Branch.ml index 561bff3..439339e 100644 --- a/lib/kernel/Branch.ml +++ b/lib/kernel/Branch.ml @@ -50,14 +50,13 @@ module Make (S : Abstract.Storage.STORAGE) = struct let of_fields fields = let open Utilities.Result in let open Concepts.Encoding in - let* multigroups = Bencode.field "multigroups" fields |> fmap Value.hash_of_bencode in + let* multigroups = Bencode.field "multigroups" fields |>> Value.hash_of_bencode in let* previous = Bencode.field "previous" fields - |> fmap - (Value.option_of_bencode (fun v -> - Value.hash_of_bencode v - |> Result.map (fun hash -> S.Hash hash) - |> Result.map (SI.Pointer.make Loader.load) ) ) + |>> Value.option_of_bencode (fun v -> + Value.hash_of_bencode v + |> Result.map (fun hash -> S.Hash hash) + |> Result.map (SI.Pointer.make Loader.load) ) in Ok {multigroups; previous} end @@ -65,7 +64,7 @@ module Make (S : Abstract.Storage.STORAGE) = struct and Loader : sig val load : S.transaction -> S.address -> (t, Concepts.Condition.condition) result end = struct - let load tx addr = SI.get_req tx addr |> Utilities.Result.fmap Representation.of_blob + let load tx addr = Utilities.Result.(SI.get_req tx addr |>> Representation.of_blob) end let pointer_of hash = SI.Pointer.make Loader.load (S.Hash hash) @@ -73,7 +72,7 @@ module Make (S : Abstract.Storage.STORAGE) = struct let node_of tx branch = let open Utilities.Result in MultigroupM.find tx branch.multigroups - |> fmap (Option.to_result ~none:(Error.incomplete_branch branch.multigroups)) + |>> Option.to_result ~none:(Error.incomplete_branch branch.multigroups) (* Given [root], the stored programs of this state run through the evaluators registered under it, against this very state, so an @@ -144,7 +143,7 @@ module Make (S : Abstract.Storage.STORAGE) = struct update_only (fun node' -> Handle.require Addressable.from node' |> Result.map Addressable.address - |> fmap (fun addr -> self#deriving {branch with multigroups= addr}) ) ) ] ); + |>> (fun addr -> self#deriving {branch with multigroups= addr}) ) ) ] ); Directory.make object method list = |
