
15 Sep
2008
15 Sep
'08
5:53 p.m.
On Mon, 15 Sep 2008, Tom Hawkins wrote:
OK. But let's modify Expr so that Const carries values of different types:
data Expr :: * -> * where Const :: a -> Term a Equal :: Term a -> Term a -> Term Bool
How would you then define:
Const a === Const b = ...
Apart from the suggestions about Data.Typeable etc, one possibility is to enumerate the different possible types that will be used as parameters to Const in different constructors, either in Expr or in a new type. So IntConst :: Int -> Expr Int, etc Or Const :: Const a -> Expr a and IntConst :: Int -> Const Int etc Not very pleasant though. Ganesh