{-# LANGUAGE DefaultSignatures #-}
class C a where
f :: [a]
default f :: (Num a) => [a]
f = [1,2,3,4,5]
The above works, the below doesn't. It seems DefaultSignatures extension only allows specifying constraints, but not substituting a concrete type. Section Default Method Signatures of the GHC Users Guide doesn't explain this. Why doesn't DefaultSignatures allow me to substitute a concrete type? What is the rationale? Where can I read more on how and why DefaultSignatures are implemented?
{-# LANGUAGE DefaultSignatures #-}
class C a where
f :: [a]
default f :: [Int]
f = [1,2,3,4,5]