简体   繁体   English

使用 Data.Vector.Unboxed.Deriving 派生 Unbox 实例时的 GHC 7.10.2 警告

[英]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.

相关问题 是否可以通过GHC的通用派生来派生Data.Vector.Unbox? - Would it be possible to derive Data.Vector.Unbox via GHC's generic deriving? GHC 7.10.2 Data.Vector.Unboxed与REPA 3.4.0.1冲突 - GHC 7.10.2 Data.Vector.Unboxed conflict with REPA 3.4.0.1 使用GHC.Generics派生默认实例 - Deriving default instances using GHC.Generics 使用函数派生数据类型的实例 - Deriving instance for data types with functions 通过GeneralizedNewtypeDeriving派生实例时使用自定义实例 - Using custom instance when deriving an instance via GeneralizedNewtypeDeriving Haskell:如何使用“未装箱的向量”为“(Unbox A)添加实例声明”修复错误? - Haskell: How To Fix Error With “add An Instance Declaration For (Unbox A)” When Using Unboxed Vectors? `deriving(Data)`vs`deferred(Generic)` - `deriving (Data)` vs `deriving (Generic)` 在派生包含数据结构时,不键入类实例 - Type class instance not being used when deriving containing data structure 是否有可能重新实现使用GHC泛型得出的“Enum” - Is it possible to re-implement `Enum` deriving using GHC generics 使用Numeric.FFT时没有(Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Vector Double)的实例 - No instance for (Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Vector Double) when using Numeric.FFT
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM