Files
WoofWare.PawPrint/WoofWare.PawPrint/List.fs
2025-08-24 09:05:31 +00: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