Commit 57a8676c authored by simonpj's avatar simonpj
Browse files

[project @ 2005-02-23 09:21:08 by simonpj]

Add a functional-dep test
parent 2c269109
......@@ -196,6 +196,7 @@ test('tc183', normal, compile, [''])
test('tc184', normal, compile, [''])
test('tc185', only_compiler_types(['ghc']), compile, [''])
test('tc186', normal, compile, [''])
test('tc187', normal, compile, [''])
test('LoopOfTheDay1', normal, compile, [''])
test('LoopOfTheDay2', normal, compile, [''])
......
{-# OPTIONS_GHC -fglasgow-exts #-}
-- Hugs failed this functional-dependency test
-- Reported by Iavor Diatchki Feb 05
module ShouldCompile where
data N0
newtype Succ n = Succ n
class Plus a b c | a b -> c
instance Plus N0 n n
instance Plus a b c => Plus (Succ a) b (Succ c)
( # ) :: Plus x y z => x -> y -> z
( # ) = undefined
class BitRep t n | t -> n where
toBits :: t -> n
instance BitRep Bool (Succ N0) where
toBits = error "urk"
instance BitRep (Bool,Bool,Bool) (Succ (Succ (Succ N0))) where
toBits (x,y,z) = toBits x # toBits y # toBits z
-- Hugs complains that it cannot solve the constraint:
-- Plus (Succ N0) (Succ N0) (Succ (Succ N0))
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