Soo… F# no longer has IEnumerable.map_with_type… which is the way people were mapping over collections. How do I do that now?
let urlPat = 'href\\s*=\\s*(?:(?:\\\'(?<url>[^\\\']*)\\\')|(?<url>[^\\s]* ))';; let urlRegex = new Regex(urlPat) let matches = urlRegex.Matches(http('http://www.google.com')) let matchToUrl (urlMatch : Match) = urlMatch.Value let urls = List.map matchToUrl matches
Thanks!
you would write the last line like this:
And this can be written in a nicer way using pipelining operator:
F# automatically figures out what is the right target type (because it knows what
matchToUrllooks like). This is available only for Seq, so you can useList.of_seqto get the data into a list again.