3 comments

[ 3.3 ms ] story [ 11.5 ms ] thread
Very nice, especially the timing: I'm currently working with Data.Map on a side project of mine, but after a first glance at the code it looks like Data.PHashMap covers most of the functions that I currently use from Data.Map. Maybe I'll try to wrap my head around the code and add some of the functions that are missing in the Data.PHashMap source code by myself, as an exercise, as long as Kevin won't finish the first item in his To Do list within the next weeks :)
Why doesn't Data.PVector.map increment the last element from 14 to 15?

    ghci> adjust succ 2 a  -- apply a function to a single element
    fromList [1,42,14]

    ghci> Data.PVector.map succ a  -- apply a function to all elements
    fromList [2,43,14]
I'm not sure what the problem is with the ST-based Data.Vector. The State Thread approach lets you get performance like C, but with type safety like Haskell. This implementation gets you performance like Haskell with type safety like Haskell. Sure, there are "no monads in sight", but at a high cost.