SilentParametersOverlapping.hs 428 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
{-# LANGUAGE FlexibleInstances, FlexibleContexts, UndecidableInstances #-}

module SilentParametersOverlapping where 

class C a where 
  c :: a -> () 

class C a => B a where 
  b :: a -> () 

instance C [a] where 
  c x = () 

instance B [(a,b)] where 
  -- Silent: C [(a,b)] 
  b x = c [(undefined,undefined)]

-- DV: The silent parameter should not give us a failure to apply the instance!