简体   繁体   English

使用 haskell / cabal / stack 进行运行时类型检查

[英]runtime type checking with haskell / cabal / stack

In a Haskell project, I am using a dependency which I know contains type error.在 Haskell 项目中,我使用了一个我知道包含类型错误的依赖项。 But that's actually fine as I never call this code.但这实际上很好,因为我从不调用此代码。

So I want to enable defer-type-errors but only for that dependent package .所以我想启用defer-type-errors只针对那个依赖包

Is there a way to scope that compiler instruction somewhere (stack ? cabal?)有没有办法将编译器指令的范围限定在某个地方(堆栈?cabal?)

If you really have to you can set ghc options per package in stack.yaml , namely:如果你真的需要,你可以在 stack.yaml 中为每个包设置 ghc 选项,即:

ghc-options:
    your_package_name: -fdefer-type-errors

I'm not sure whether it's compatible with ghcjs.我不确定它是否与 ghcjs 兼容。

But please be sure to make the users of your package aware, maybe include a disclaimer in the document in big bold fonts .但是请务必让您的包的用户知道,也许在文档中包含一个大粗体的免责声明。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM