Skip to content

Instantly share code, notes, and snippets.

@juanplopes
Forked from rodrigovidal/gist:758139
Created December 29, 2010 20:29
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 juanplopes/759026 to your computer and use it in GitHub Desktop.
Save juanplopes/759026 to your computer and use it in GitHub Desktop.
//C#
public T FindInList<T>(IEnumerable<T> source, IEnumerable<T> target)
{
return source.First(target.Contains)
}
//F#
let FindInList (source : seq<_>) (target : seq<_>) = source.First(Func<_,bool>(target.Contains))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment