Closed asib closed 1 year ago
Hey!
Thanks for checking it out. I managed to resolve the issue but following the errors. Besides UndecidableInstances
pragma it also required RankNTypes
with a forall
scope in the definition of STTerm
. I managed to get there by following the errors, but it's not quite clear to me why the forall
is necessary now and not before.
The fix is merged to master so feel free to check it out again.
Ah it seems to be due to these changes:
https://downloads.haskell.org/ghc/8.10.1/docs/html/users_guide/8.10.1-notes.html
GHC now performs more validity checks on inferred type signatures. One consequence of this change is that some programs that used to be accepted will no longer compile without enabling the required language extensions. For example, in these two modules:
{-# LANGUAGE RankNTypes #-}
module A where
foo :: (forall a. a -> a) -> b -> b
foo f x = f x
module B where
import A
bar = foo
Notice that A enables -XRankNTypes, but B does not. Previous versions of GHC would allow bar to typecheck, even though its inferred type is higher-rank. GHC 8.10 will now reject this, as one must now enable -XRankNTypes in B to accept the inferred type signature.
Type family dependencies (also known as injective type families) sometimes now need -XUndecidableInstances in order to be accepted. Here is an example:
type family F1 a = r | r -> a
type family F2 a = r | r -> a
type instance F2 [a] = Maybe (F1 a)
Because GHC needs to look under a type family to see that a is determined by the right-hand side of F2‘s equation, this now needs -XUndecidableInstances. The problem is very much akin to its need to detect some functional dependencies.
Awesome, thanks so much for pushing the fix and explaining it!
Hello, very cool project! Appreciate that it's been untouched for a while so please ignore this if you're not interested in diving back into it.
I'm trying to build with LTS 20.11 (GHC 9.2.5) and facing a compilation error:
If I add
UndecidableInstances
as GHC suggests and rebuild I get the following compilation error:I'll confess I'm not a Haskell expert but I can't understand why GHC thinks the kind of
a
isa
and not*
.I should add I'm using 9.2.5 because I'm on an M1 mac and trying to avoid rebuilding the version of GHC used by this library.