1
从Data.Binary:如何使用参数化实例删除(Data.Binary)?
instance (Binary e) => Binary (IntMap.IntMap e) where
put = put . IntMap.toAscList
get = liftM IntMap.fromDistinctAscList get
我认为这意味着任何IntMap (Binary e)
类型是serialisable,但它并不:
Data.Binary Data.IntMap> encode $ ((fromList [])::IntMap Int)
<interactive>:12:1:
No instance for (Binary (IntMap Int))
arising from a use of `encode'
如何使用所提供的实例?
啊!恰当地,我之前被警告说升级容器会导致问题!谢谢 – Scott 2013-03-24 22:14:25