summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_run/tcrun031.hs
blob: fc7c46ea192894add7b9d55a248cf6a1e96a8b84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{-# LANGUAGE MultiParamTypeClasses, GeneralizedNewtypeDeriving #-}

-- A newtype-deriving test

module Main where

class C a b where
  op :: a -> b -> b
instance C [a] Char where
  op [] x = x
  op _  x = 'z'

newtype T = T Char deriving( Show, C [a] )

main = do { print (op [] 'x')
          ; print (op [] (T 'y')) }