Skip to content

Commit

Permalink
added explanatory comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyson Williams committed Oct 14, 2020
1 parent 67e84a3 commit d91c479
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Samples/SubModelSeq/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,15 @@ module List =
let mapFirst p f input =
let rec mapFirstRec reverseFront back =
match back with
| [] -> input
| [] ->
(*
* Conceptually, the correct value to return is
* reverseFront |> List.rev
* but this is the same as
* input
* so returning that instead.
*)
input
| a :: ma ->
if p a then
(reverseFront |> List.rev) @ (f a :: ma)
Expand Down

0 comments on commit d91c479

Please sign in to comment.