[RankNTypes] Prelude.!!: index too large
The following (simplified) program compiles correctly:
{-# LANGUAGE RankNTypes #-}
newtype ParcurryT m a = ParcurryT {
runP :: forall r . (() -> r) -> m a
}
as soon as we try to use runP
, the frontend fails with Prelude.!! index too large
.
Just add:
test = runP
Note:
- If we desugar the
RecordConstructor
to a "normal" one and add an explicit function for runP, the problem still exists. - Using
data
instead ofnewtype
makes no difference.