Skip to content

New GeneralizedNewtypeDeriving check still isn't permissive enough

Roman Cheplyaka writes:

I just tried compiling smallcheck with GHC HEAD, and it didn't work out:

 Test/SmallCheck/SeriesMonad.hs:41:7:
     Can't make a derived instance of ‛MonadLogic (Series m)’
       (even with cunning newtype deriving):
       it is not type-safe to use GeneralizedNewtypeDeriving on this class;
       ‛msplit’, at type ‛forall a.
                          m a -> m (Maybe (a, m a))’, cannot be converted safely
     In the newtype declaration for ‛Series’

So GHC now looks at the methods, but the problem is still there.

I would agree that msplit's type is problematic (due to the nested m's), but Simon and Richard previously said that it should work, so I'm confused.

Trac metadata
Trac field Value
Version 7.7
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information