Tzy-Jye Daniel Lin (dt...@andrew.cmu.edu) wrote:
: > primitivesList :: (MonadIO m) => [(MethodName, (Arity, [Value] -> m Value))]
: This is not permissible as a top-level declaration without
: -XNoMonomorphismRestriction / -fno-monomorphism-restriction.
: When a CAF has polymorphic type, it may be evaluated multiple times,
: once per type.
: > primitivesNames :: [MethodName]
: > primitivesNames = map fst primitivesList
: The evaluation of primitivesList depends on the choice of (MonadIO m).
: primitiveNames does not. See the problem?
Thank you. That makes lots of sense. I was looking for the problem in
the newly added code, but the code that had been functioning for
weeks was the real culprit.
It does indeed work if I change the type to:
primitivesList :: M.Map MethodName
(Arity, [Value] -> ErrorT String (StateT MyState IO) Value)
Dirk van Deun
--
Ceterum censeo Redmond delendum