constructor class data constructor context

1999-03-02 Thread S.D.Mechveliani
Dear people, i cannot tell, whether the following is a particular implementation bug or it is against Haskell-98: class Rs r where toRs :: r a - a - r a data (Num a) = Rsi a = Rsi a a data (Integral a) = Rse a = Rse a a instance Rs Rsi where toRs (Rsi _ b) a = Rsi (a-b) b

Re: constructor class data constructor context

1999-03-02 Thread Lennart Augustsson
data (Num a) = Rsi a = Rsi a a data (Integral a) = Rse a = Rse a a Contexts on data declarations in Haskell essentially pointless. Just remove them and figure out how to make your code work without them, since they don't do anything. -- Lennart

constructor class data constructor context

1999-03-02 Thread S.D.Mechveliani
Dear people, i cannot tell, whether the following is a particular implementation bug or it is against Haskell-98: class Rs r where toRs :: r a - a - r a data (Num a) = Rsi a = Rsi a a data (Integral a) = Rse a = Rse a a instance Rs Rsi where toRs (Rsi _ b) a = Rsi (a-b) b