Skip to content

Instantly share code, notes, and snippets.

@rodrigovidal
Forked from juanplopes/gist:757685
Created December 29, 2010 03:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rodrigovidal/758139 to your computer and use it in GitHub Desktop.
Save rodrigovidal/758139 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))
@juanplopes
Copy link

Em c# ainda está mais elegante :)

@rodrigovidal
Copy link
Author

discordo completamente :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment