I'm trying to use Parsec's OperatorTable
with the following:
table :: Ex.OperatorTable String () Identity Expr
table = [[]]
cabal build
and cabal run
work, but loading Main
into GHCi gives me this weird error:
Parser.hs:127:33:
Couldn't match type ‘Identity’
with ‘transformers-0.3.0.0:Data.Functor.Identity.Identity’
NB: ‘Identity’
is defined in ‘Data.Functor.Identity’
in package ‘transformers-0.4.3.0’
‘transformers-0.3.0.0:Data.Functor.Identity.Identity’
is defined in ‘Data.Functor.Identity’
in package ‘transformers-0.3.0.0’
Expected type: Ex.OperatorTable
String () transformers-0.3.0.0:Data.Functor.Identity.Identity Expr
Actual type: Ex.OperatorTable String () Identity Expr
In the first argument of ‘Ex.buildExpressionParser’, namely ‘table’
In the expression: Ex.buildExpressionParser table factor
So I deleted ~/.cabal
and .cabal-sandbox
and reinstalled mtl
, both globally and in a new sandbox Same error.
ghc-pkg list | grep trans
gives:
transformers-0.3.0.0
transformers-0.4.3.0
so I tried ghc-pkg unregister transformers-0.3.0.0
but got a scary-looking warning message about how a bunch of other packages would break:
ghc-pkg: unregistering transformers-0.3.0.0 would break the following
packages: regex-posix-0.95.2 regex-compat-0.95.1 regex-base-0.93.2
parsec-3.1.5 network-2.4.2.3 mtl-2.1.3.1 fgl-5.5.0.1 HTTP-4000.2.10
ghc-7.8.3 haskeline-0.7.1.2 (use --force to override)
Didn't proceed.
Also tried ghci -package transformers-0.4.3.0
and got the same error.
What do I do now? :\
My .cabal
file contains transformers <= 0.4.3.0
. I'm on GHC 7.8.3 on OS X 10.10.2.