Haskell shying away from probabilistic data structures?

前端 未结 7 888
时光说笑
时光说笑 2021-02-05 07:57

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

7条回答
  •  广开言路
    2021-02-05 08:47

    Well, first, the random number generator in the IO monad is there for convenience. You can use random number generators outside the IO monad; see System.Random. But, yes, you do need to maintain state; the ST monad is useful here. And, yes, i'd say Haskell programmer's prefer the pure data structures.

提交回复
热议问题