File input/output: Difference between revisions
Content added Content deleted
No edit summary |
(→{{header|F Sharp|F#}}: comply to task description by using an intermediate variable) |
||
Line 788: | Line 788: | ||
=={{header|F Sharp|F#}}== |
=={{header|F Sharp|F#}}== |
||
Using an intermediate variable for the input file content is not ideomatic in functional programming. Nevertheless... |
|||
<lang fsharp>open System.IO |
<lang fsharp>open System.IO |
||
let copyFile fromTextFileName toTextFileName = |
|||
let |
let inputContent = File.ReadAllText fromTextFileName |
||
inputContent |> fun text -> File.WriteAllText(toTextFileName, text) |
|||
[<EntryPoint>] |
|||
⚫ | |||
let main argv = |
|||
⚫ | |||
0 |
|||
</lang> |
</lang> |
||