How are mutable arrays implemented in Haskell?

后端 未结 3 1022
-上瘾入骨i
-上瘾入骨i 2020-12-05 02:46

I\'ve read many research papers on this topic, and they usually argue that arrays are implemented using Monads. But none of these papers gave a clear definition of how the \

3条回答
  •  星月不相逢
    2020-12-05 03:12

    As something of an aside, please keep in mind that "implemented using monads", as can be done for various control structures, is not really the same thing as "side effects isolated by monadic operations on an opaque type", as with IO or ST, where the properties of the monad merely ensure that pure code remains so.

    The mutable data is provided as a runtime primitive, as Don Stewart explains; the only thing "implemented with monads" here is type safety.

提交回复
热议问题