How can I disable Haskell warning in small block?

纵饮孤独 提交于 2019-12-10 01:04:45

问题


I want to disable warning only some block of code.

I searched Google but only find file scope or global scope disable method. Using cabal file or pragma

{-# OPTIONS_GHC #-}

Can I disable warning for specific function?


回答1:


No, you can't currently in GHC 8.8.1

The {-# OPTIONS_GHC #-} pragma is file-header only and applies to the whole module. And there are no such pragmas (or other ways) to suppress warnings in specific locations. You can check the full list of pragmas in the Haskell user guide:

https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#pragmas

The list of warnings might also be interesting:

https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/using-warnings.html



来源:https://stackoverflow.com/questions/41768887/how-can-i-disable-haskell-warning-in-small-block

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!