MutableHastable:非法类型同义词族应用实例

我正在尝试使用此库中的 Mutable BasicHashTable:https : //github.com/gregorycollins/hashtables

{-# LANGUAGE GeneralizedNewtypeDeriving #-}

import qualified Data.HashTable.IO as H
import Control.Monad.State.Strict
import Control.Monad.IO.Class (MonadIO)

type A  =  H.BasicHashTable Int String

newtype MyWrapper a = MyWrapper { runM :: StateT A IO a  }
  deriving (Functor, Applicative, Monad, MonadIO, MonadState A )

编译器抱怨我尝试A在类型类实例中使用:

 error:
    • Illegal type synonym family application ‘Control.Monad.Primitive.PrimState
                                                 IO’ in instance:
        MonadState A MyWrapper
    • In the newtype declaration for ‘MyWrapper’
   |
10 |   deriving (Functor, Applicative, Monad, MonadIO, MonadState A )
   |                                                   ^^^^^^^^^^^^

以上是MutableHastable:非法类型同义词族应用实例的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>