Haskell软件包hs_gchart的安装失败(“约束中的非类型变量参数”)

时间:2019-01-11 15:33:09

标签: haskell

尝试安装Haskell软件包hs_gchart时,出现错误

"Non type-variable argument in the constraint: MonadState Chart m (Use FlexibleContexts to permit this)"

尽管允许在我的通话中使用XFlexibleContexts

stack install --ghc-options=-XFlexibleContexts hs-gchart

我该如何解决问题?

输出:

[...]
    [ 7 of 10] Compiling Graphics.GChart.ChartItems.Colors ( Graphics\GChart\ChartItems\Colors.hs, .stack-work\dist\7d103d30\build\Graphics\GChart\ChartItems\Colors.o )
    [ 8 of 10] Compiling Graphics.GChart.ChartItems.Basics ( Graphics\GChart\ChartItems\Basics.hs, .stack-work\dist\7d103d30\build\Graphics\GChart\ChartItems\Basics.o )
    [ 9 of 10] Compiling Graphics.GChart.ChartItems ( Graphics\GChart\ChartItems.hs, .stack-work\dist\7d103d30\build\Graphics\GChart\ChartItems.o )

[;1mGraphics\GChart\ChartItems.hs:62:1: [;1m[31merror:[0m[0m[;1m[0m[0m[;1m
    * Non type-variable argument in the constraint: MonadState Chart m
      (Use FlexibleContexts to permit this)
    * When checking the inferred type
        getDataSetIdx :: forall (m :: * -> *). MonadState Chart m => m Int[0m[0m
[;1m[34m   |[0m[0m
[;1m[34m62 |[0m[0m [;1m[31mgetDataSetIdx = do chart <- get[0m[0m
[;1m[34m   |[0m[0m[;1m[31m ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...[0m[0m
[0m[0m[0m

1 个答案:

答案 0 :(得分:-1)

该问题已为我解决,因为我可以使用其他软件包名称安装该软件包:

堆叠安装GoogleChart