Last active
June 17, 2016 18:38
-
-
Save lawliet89/561bef1bd70f4041dcdd8d20a5852008 to your computer and use it in GitHub Desktop.
F# Functional Signatures Exercise
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // See https://fsharpforfunandprofit.com/posts/function-signatures/ | |
| // val testA = int -> int | |
| // val testB = int -> int -> int | |
| // val testC = int -> (int -> int) | |
| // val testD = (int -> int) -> int | |
| // val testE = int -> int -> int -> int | |
| // val testF = (int -> int) -> (int -> int) | |
| // val testG = int -> (int -> int) -> int | |
| // val testH = (int -> int -> int) -> int | |
| let testA x = x + x | |
| let testB x y = x + y | |
| let testC x = testB x | |
| let testD f = f 1 + 1 | |
| let testE x y z = x + y + z | |
| let testF f = testB (f 1) | |
| let testG x f = x + (f x) | |
| let testH f = (f 1 2 ) |> testA |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment