Assuming that you want to filter out even integers:

Seq.filter (fun n -> (n%2) = 0) [1;2;3;4;5]

By on 4/13/2009 6:59 AM ()

Thanks, batibix and kullbom,

That is what I need.. :)

By on 4/13/2009 9:07 AM ()

You could use a list comprehension,

1
[for n in [1..5] do if n % 2 = 0 then yield n]

...or you could use the filter function,

1
List.filter (fun n -> n % 2 = 0) [1..5]
By on 4/13/2009 6:58 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper