λ. :set -XFlexibleContexts -XFlexibleInstances -XMultiParamTypeClasses -XUndecidableInstances
λ. import RIOλ. import Data.Has
λ. class HasBool a where boolL :: Lens' a Bool
λ. instance {-#OVERLAPPABLE#-} HasBool a => Has Bool a where hasLens = boolL
λ. instance {-#OVERLAPPABLE#-} Has Bool a => HasBool a where boolL = hasLens
λ. runRIO () $ view boolL
^CInterrupted.
The RIO environment () doesn't contain a Bool. I can see how the typechecker might get lost in this, but I can compile an equivalent program; it loops on execution.
_______________________________________________