Created
November 15, 2014 22:00
-
-
Save Slesa/b0d51727d056f09766e3 to your computer and use it in GitHub Desktop.
Secret of sequences
This file contains 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
// seq<int64> -> #seq<int64> | |
let req findAllPrimes values = | |
let sequence = seq { | |
for value in values do | |
if isPrime value then | |
yield value | |
else | |
let divisors = findDivisors value | |
yield! findAllPrimes divisors } | |
sequence | |
// 'findAllPrimes' not defined | |
let getPrimes values = | |
let result = findAllPrimes values | |
result | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment