[英]GHC 7.10.2 warning when deriving Unbox instance using Data.Vector.Unboxed.Deriving
The following program:以下程序:
{-# LANGUAGE TemplateHaskell, RankNTypes, MultiParamTypeClasses, TypeFamilies #-}
import Data.Vector.Unboxed
import Data.Vector.Unboxed.Deriving
import Data.Word
data Pixel a = Pixel a deriving Show
derivingUnbox "Pixel"
[t| forall a . (Unbox a) => Pixel a -> a |]
[| \ (Pixel a) -> a |]
[| \ a -> (Pixel a) |]
main = print $ Pixel 0
Uses template haskell to derive an Unbox instance for Pixel.使用模板 haskell 为 Pixel 派生一个 Unbox 实例。 It worked on GHC 7.8, but on 7.10.2, I get the following warning:
它适用于 GHC 7.8,但在 7.10.2 上,我收到以下警告:
/Users/v/haskell/Tests/pix.hs:11:1: Warning:
No explicit implementation for
‘Data.Vector.Generic.Mutable.Base.basicInitialize’
In the instance declaration for
‘Data.Vector.Generic.Mutable.Base.MVector MVector (Pixel a_a6Ue)’
What does it mean?这是什么意思?
The vector-th-unboxed
package that provides the template you're using has not been updated since basicInitialize
was added to the Data.Vector.Generic.Mutable.Base.MVector
class.自从
basicInitialize
添加到Data.Vector.Generic.Mutable.Base.MVector
类后,提供您正在使用的模板的vector-th-unboxed
包尚未更新。
You should
file an issue to get the macro fixed, and you may wish to
You should contact a Hackage trustee to see about getting the dependency bounds for vector-th-unbox
adjusted in the mean time.
您应该
提交问题以修复宏,并且您可能希望
您应该联系Hackage 受托人以了解vector-th-unbox
调整vector-th-unbox
的依赖范围。 Code written for recent versions of vector
is likely to use basicInitialize
(directly or indirectly);为最近版本的
vector
编写的代码很可能使用basicInitialize
(直接或间接); when that function is called with a Point
, it will throw a runtime error.当使用
Point
调用该函数时,它将引发运行时错误。
There is a pull request open to fix this issue, but the maintainer has not accepted it.有一个拉取请求可以解决这个问题,但维护者没有接受它。 You may wish to review it yourself and apply it locally.
您可能希望自己查看并在本地应用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.