Commit 64c76cd4 authored by simonpj's avatar simonpj
Browse files

[project @ 2004-04-02 16:50:29 by simonpj]

Add a test for newtype deriving
parent 253a91ce
......@@ -35,4 +35,5 @@ test('tcrun027', normal, compile_and_run, [''])
test('tcrun028', expect_fail_for(['extcore','optextcore']), compile_and_run, [''])
test('tcrun029', normal, compile_and_run, [''])
test('tcrun030', normal, compile_and_run, [''])
test('tcrun031', normal, compile_and_run, [''])
test('church', normal, compile_and_run, [''])
{-# 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')) }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment