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/Multigroup.ml | |
| parent | 0b1c7ca41a6d8ce41b9783153b567c16250913ff (diff) | |
| download | RNT-0f5161930584eaf91fd195b891ce7d9130c7b7f1.tar.gz RNT-0f5161930584eaf91fd195b891ce7d9130c7b7f1.zip | |
Forsake `fmap`
Diffstat (limited to 'lib/kernel/Multigroup.ml')
| -rw-r--r-- | lib/kernel/Multigroup.ml | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/kernel/Multigroup.ml b/lib/kernel/Multigroup.ml index 669babb..399ab30 100644 --- a/lib/kernel/Multigroup.ml +++ b/lib/kernel/Multigroup.ml @@ -90,8 +90,8 @@ module Make (S : Abstract.Storage.STORAGE) = struct let of_fields fields = let open Utilities.Result in let open Concepts.Encoding in - let* schemas = Bencode.field "schemas" fields |> fmap Value.hash_of_bencode in - let* denials = Bencode.field "denials" fields |> fmap Value.hash_of_bencode in + let* schemas = Bencode.field "schemas" fields |>> Value.hash_of_bencode in + let* denials = Bencode.field "denials" fields |>> Value.hash_of_bencode in Ok {schemas; denials} end) @@ -100,7 +100,7 @@ module Make (S : Abstract.Storage.STORAGE) = struct let node_of tx addr = let open Utilities.Result in - T.find tx addr |> fmap (Option.to_result ~none:(Error.incomplete addr)) + T.find tx addr |>> Option.to_result ~none:(Error.incomplete addr) (* What [h] holds under [property], each to store once the write has begun, and the tree they make when it has. *) @@ -116,9 +116,10 @@ module Make (S : Abstract.Storage.STORAGE) = struct |> Utilities.List.sequence let tree_of tx admissions = + let open Utilities.Result in List.map (fun (name, store) -> store tx |> Result.map (fun addr -> name, addr)) admissions |> Utilities.List.sequence - |> Utilities.Result.fmap (T.of_list tx) + |>> T.of_list tx let admit_schema _ h = let open Utilities.Result in @@ -229,7 +230,7 @@ module Make (S : Abstract.Storage.STORAGE) = struct let derive f node' = Protocols.Handle.require Protocols.Addressable.from node' |> Result.map Protocols.Addressable.address - |> fmap (fun addr -> self#deriving (f addr)) + |>> (fun addr -> self#deriving (f addr)) in Protocols. [ Addressable.make self; |
