I got this to work just by adding in the splitAtSpaces function and changing of_List to ofList:

let splitAtSpaces (text : string) =

text.Split ' '

|> Array.toList

let wordCount text =

let words = splitAtSpaces text

let wordSet = Set.ofList words

let nWords = words.Length

let nDups = words.Length - wordSet.Count

(nWords,nDups)

By on 12/16/2010 8:57 AM ()

I'm having better luck referencing FSharp.PowerPack.Compatibility.dll. The following works:

#r "FSharp.PowerPack.Compatibility.dll"

let wordCount text =
let words = String.split [' '] text
let wordSet = Set.ofList words
let nWords = words.Length
let nDups = words.Length - wordSet.Count
(nWords,nDups)

Still, some things seem to have changed, like Set.of_list.

--Chris

By on 12/16/2010 8:50 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