123456789101112131415161718 |
- module Proverb
-
- let finalLine (input: string list) = "And all for the want of a " + (List.head input) + "."
-
- let getLists (input: string list) = (List.take ((List.length input) - 1) input, List.tail input)
-
- let getItemPairs (input: string list) =
- let lists = getLists input
- let a = lists |> fst
- let b = lists |> snd
- List.zip a b
-
- let getLines (input: string list) = List.map (fun i ->
- let a = i |> fst
- let b = i |> snd
- "For want of a " + a + " the " + b + " was lost.") (getItemPairs input)
-
- let recite (input: string list): string list = if not (List.isEmpty input) then getLines input @ [finalLine input] else []
|