If you search for skips lists implemented in Haskell, you won\'t find many. It is a probabilistic data structure needing a random number generator, meaning that any of these str
Skip lists can be implemented purely -- just encapsulate the current seed in the state of the skip list itself.
data SkipList a = SkipList StdGen (Node a)
data Node a = ...
This may expose you to some complexity attacks that aren't practical against 'real' skip lists, since you could probe for degenerate insertion orders and replay attacks against the same seed, but it lets you derive the benefits of the structure when adversarial usage is not a problem.
You could also fall back on unsafePerformIO
and a carefully crafted side-effect-oblivious seemingly-pure interface. While admittedly it is not pure internally, the interface gives the appearance of purity.
That said, many of the classical performance benefits from skiplists come from when they can be implemented non-persistently, and that precludes a functional interface.