[Haskell-cafe] Re: Mining Twitter data in Haskell and Clojure

Don Stewart dons at galois.com
Mon Jun 14 11:40:10 EDT 2010


deliverable:
> I've supplied a profile report there.  Since I load the graphs in
> memory and then walk them a lot, the time seems expected.  It
> allocates a lot, though.  The main graph type is
> 
> 
> type Graph = M.Map User AdjList
> type AdjList = M.Map Day Reps
> type User = B.ByteString
> type Day = Int
> type Reps = M.Map User Int
> 
> and I walk it with M.foldWithKey.  Folks said it's not strict enough,
> hence I tried to seq the step function, but to no avail so far.

Oh, you'll want insertWith'.

You might also consider bytestring-trie for the Graph, and IntMap for
the AdJList ?

-- Don


More information about the Haskell-Cafe mailing list