Consider this snippet of code
{-# LANGUAGE QuantifiedConstraints #-}
module Foo where
import Control.Monad.Writer
data Foo = Foo
foo :: (forall e. Monoid e => MonadWriter e (m e)) => m [Foo] Int
foo = pure 1
It produces an error
Reduction stack overflow; size = 201
When simplifying the following type: Monoid [Foo]
See here if you want to play with it.
Am I wrong or the compiler is telling me that it is not able to find an instance Monoid [Foo]
?