Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 1. možnosť:
- let foo n =
- [1 .. n]
- |> List.choose
- (fun x ->
- match x * 2 + 3 with i when i > 30 -> Some i | _ -> None)
- // 2. možnosť:
- let bar n =
- let rec my acc = function
- | 0 -> acc
- | i ->
- let x = i * 2 + 3
- my (if x > 30 then x :: acc else acc) <| i - 1
- my [] n
- // 3. možnosť:
- let baz n = seq { for i in 1 .. n do
- let i = i * 2 + 3
- if i > 30 then yield i }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement