Skip to content

Instantly share code, notes, and snippets.

@lawliet89
Last active June 17, 2016 18:38
Show Gist options
  • Select an option

  • Save lawliet89/561bef1bd70f4041dcdd8d20a5852008 to your computer and use it in GitHub Desktop.

Select an option

Save lawliet89/561bef1bd70f4041dcdd8d20a5852008 to your computer and use it in GitHub Desktop.
F# Functional Signatures Exercise
// 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