Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
12
Task/First-class-functions/F-Sharp/first-class-functions.fs
Normal file
12
Task/First-class-functions/F-Sharp/first-class-functions.fs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
open System
|
||||
|
||||
let cube x = x ** 3.0
|
||||
let croot x = x ** (1.0/3.0)
|
||||
|
||||
let funclist = [Math.Sin; Math.Cos; cube]
|
||||
let funclisti = [Math.Asin; Math.Acos; croot]
|
||||
let composed = List.map2 (<<) funclist funclisti
|
||||
|
||||
let main() = for f in composed do printfn "%f" (f 0.5)
|
||||
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue