问题描述
Haskell是否有标准的队列实现?我看到了几种相当成熟的优先级队列实现,但没有简单的队列. Data.Sequence似乎还可以,但是我认为使用更严格的数据类型可以获得更好的性能.此外,限制操作(即不是双端队列)可以防止错误从错误的一端使队列出队列.
澄清一下,我希望有一个成熟的Haskell实现,最好是在Haskell Platform或Hackage中.
Data.Queue在ghc 6.4 [1]中添加到了base
中,并在ghc 6.6 [2]中被Data.Sequence
包含时弃用了. /p>
摘自6.6发行说明:
[1] https://downloads.haskell.org/~ghc/6.4/docs/html/users_guide/release-6-4.html
[2] https://downloads.haskell.org/~ghc/6.6/docs/html/users_guide/release-6-6.html
Is there a standard queue implementation for Haskell? I see several reasonably mature priority queue implementations, but no simple queues. Data.Sequence seems OK, but I assume we could get better performance with a more restricted datatype. Further, restricting the operations (ie, not a deque) can prevent bugs from dequeuing from the wrong end.
Edit:
To clarify, I was hoping for a mature Haskell implementation, preferably in Haskell Platform or Hackage.
Data.Queue was added to base
in ghc 6.4 [1] and deprecated in ghc 6.6 [2] when it was subsumed by Data.Sequence
.
From the 6.6 release notes:
[1] https://downloads.haskell.org/~ghc/6.4/docs/html/users_guide/release-6-4.html
[2] https://downloads.haskell.org/~ghc/6.6/docs/html/users_guide/release-6-6.html
这篇关于Haskell的标准队列包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!