diff options
| author | Estevan Castilho <tevo@riajuu.net> | 2026-10-24 02:52:21 +0000 |
|---|---|---|
| committer | Estevan Castilho <tevo@riajuu.net> | 2026-10-24 03:35:41 +0000 |
| commit | 2f9e0c580645fe797e71b6183cb69475915da55b (patch) | |
| tree | 50e4d5de4c3a440b2f35057776975cf6fa4f74a5 /lib/Utilities.ml | |
| parent | 1ab69bfb730ebad450024918a43580e4aeb0d56d (diff) | |
| download | RNT-2f9e0c580645fe797e71b6183cb69475915da55b.tar.gz RNT-2f9e0c580645fe797e71b6183cb69475915da55b.zip | |
Steal a `concat_map` implementation from Karuta
Diffstat (limited to 'lib/Utilities.ml')
| -rw-r--r-- | lib/Utilities.ml | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Utilities.ml b/lib/Utilities.ml index 8b6b08e..dcf4417 100644 --- a/lib/Utilities.ml +++ b/lib/Utilities.ml @@ -92,6 +92,10 @@ module FingerTree = struct (fun acc elem -> match f elem with None -> acc | Some result -> BatFingerTree.snoc acc result) BatFingerTree.empty + + let concat_map f = + BatFingerTree.fold_left (fun acc elem -> BatFingerTree.append acc @@ f elem) BatFingerTree.empty + end module Atomic = struct |
