[Haskell-cafe] Help with complicated type inference

Paul Johnson paul at cogito.org.uk
Sun Apr 27 14:11:23 EDT 2008

Iavor Diatchki wrote:
> Hello,
> How about defining the types like this:
> data PVal a = Unit a | Array [a]
> data Val = IntVal (PVal Int) | BoolVal (PVal Bool) -- | etc
> instance Serialize Int where ...
> instance Serialize a => Serialize (PVal a) where ...
> instance Serialize Val where ...
Thanks, but its not quite what I'm looking for.  It gives an AMQP 
"array" of Int8 the same type as an AMQP "variant" containing an Int8.  
I'd prefer them to have distinct types.


More information about the Haskell-Cafe mailing list