You need to use the Invoke method on a delegate to call it, e.g.

1
if predicate.Invoke(value) then ...

But you probably don't want to be using delegates at all in F#. Instead use function types:

1
2
3
4
member self.getAtomsByPredicate<'a>( ..., predicate : 'a -> bool ) =
  ...
  if predicate value then
    ...
By on 3/23/2008 3:02 AM ()

Thanks a lot!

And you are right, I would normally not use a System.Predicate from F#, only in this case I am trying to implement an existing interface written in C#.

By on 3/24/2008 6:38 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