Files
WoofWare.PawPrint/WoofWare.PawPrint/List.fs
Smaug123 9bafd0f4b0 WIP
2025-08-02 20:57:53 +01:00

13 lines
312 B
Forth

namespace WoofWare.PawPrint
[<RequireQualifiedAccess>]
module List =
let replaceWhere (f : 'a -> 'a option) (l : 'a list) : 'a list =
([], l)
||> List.fold (fun acc x ->
match f x with
| None -> x :: acc
| Some y -> y :: acc
)
|> List.rev