GHC accepts "instance forall b. Blah []"
{-# LANGUAGE KindSignatures, ScopedTypeVariables #-}
{-# OPTIONS_GHC -Wall #-}
module Main where
import Data.Proxy
class Blah (a :: * -> *) where
f :: a b -> b
instance forall b . Blah [] where
f a = let (_ :: Proxy b) = undefined in head a
main :: IO ()
main = return ()
When I run this using GHC 7.10.1 and GHC HEAD, I'm getting this warnings:
[1 of 1] Compiling Main ( Main.hs, Main.o )
Main.hs:12:17: warning:
Unused quantified type variable ‘b’
In the type ‘forall b. Blah []’
In an instance declaration
Main.hs:13:13: warning:
This pattern-binding binds no variables: (_ :: Proxy b) = undefined
Linking Main ...
but the program compiles successfully.