Commit f7708111 authored by simonpj's avatar simonpj
Browse files

[project @ 2003-09-11 14:22:10 by simonpj]

Add a recursive-dictionary test
parent 5b87aaca
# Args to compile_and_run are:
# args to compile_and_run are:
# extra compile flags
# extra run flags
# expected process return value, if not zero
......@@ -34,4 +34,5 @@ test('tcrun027', normal, compile_and_run, [''])
# Doesn't work with External Core due to datatype with no constructors
test('tcrun028', expect_fail_for(['extcore','optextcore']), compile_and_run, [''])
test('tcrun029', normal, compile_and_run, [''])
test('tcrun030', normal, compile_and_run, [''])
test('church', normal, compile_and_run, [''])
{-# OPTIONS -fallow-undecidable-instances #-}
-- Test recursive dictionaries
module Main where
data D r = ZeroD | SuccD (r (D r));
instance (Eq (r (D r))) => Eq (D r) where
ZeroD == ZeroD = True
(SuccD a) == (SuccD b) = a == b
_ == _ = False;
equalDC :: D [] -> D [] -> Bool;
equalDC = (==);
foo :: D []
foo = SuccD [SuccD [ZeroD], ZeroD]
main = print (foo == foo)
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