tcrun031.hs 277 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{-# OPTIONS -fglasgow-exts #-}

-- 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')) }