[Haskell-cafe] user type declarations in Haskell

2006-06-22 Thread Vladimir Portnykh
I am trying to define the following types data MyStringType a = String deriving (Eq, Ord, Show) data QADouble a = Double deriving (Eq, Ord, Show) data HType a = QADouble a| DDTraceType a deriving (Eq, Ord, Show) So HType can represent strings or doubles. later I want to do something like the

Re: [Haskell-cafe] user type declarations in Haskell

2006-06-22 Thread minh thu
2006/6/22, Vladimir Portnykh [EMAIL PROTECTED]: I am trying to define the following types data MyStringType a = String deriving (Eq, Ord, Show) data QADouble a = Double deriving (Eq, Ord, Show) data HType a = QADouble a| DDTraceType a deriving (Eq, Ord, Show) So HType can represent strings or

Re: [Haskell-cafe] user type declarations in Haskell

2006-06-22 Thread Udo Stenzel
Vladimir Portnykh wrote: I am trying to define the following types data MyStringType a = String deriving (Eq, Ord, Show) data QADouble a = Double deriving (Eq, Ord, Show) These are not what you think they are. MyStringType has a phantom type parameter and only one value, which is the