Re: redundant constraint

2000-08-03 Thread Olaf Chitil
A constraint in a data type definition does not do much. It only restricts the type of the data constructor(s), e.g. here FooType :: Foo a => a -> FooType a. Functions that use the data type FooType a cannot take any advantage of the constraint. There has been a long discussion on this issue on

redundant constraint

2000-08-02 Thread Zhanyong Wan
Hello, The following piece of code was rejected by Hugs: > class Foo a where > write :: a -> String > write _ = "I'm a foo!" > > data Foo a => FooType a = FooType a > > writeFoo :: FooType a -> String > writeFoo (FooType a) = write a ERROR "Test.hs" (line xx): Cannot justify constraints in