Duncan Coutts wrote:
What's the semantics of insert? Does it replace an element, or does it
shirt all the elements after it one step?

It shifts all the elements after it one step. So that's why all the
finite map types are no help.

import Data.Map as Map

seqInsert i v = Map.insert i v
  . Map.mapKeysMonotonic (\ j -> if j < i then j else j + 1)

_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to