Skip to content

Instantly share code, notes, and snippets.

@plumhead
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plumhead/9ac80e348c2c4533b761 to your computer and use it in GitHub Desktop.
Save plumhead/9ac80e348c2c4533b761 to your computer and use it in GitHub Desktop.
FSharp Fib Pipeline
/// Fibonacci Number formula
let rec fib n =
match n with
| 0 | 1 -> n
| _ -> fib (n - 1) + fib (n - 2)
// Print even fibs
[1 .. 10]
|> List.map fib
|> List.filter (fun n -> (n % 2) = 0)
|> printList
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment