GADTs in the wild

Christopher Done chrisdone at
Sat Aug 18 21:23:47 CEST 2012

On 18 August 2012 20:57, Bertram Felgenhauer
<bertram.felgenhauer at> wrote:
> The natural encoding as a GADT would be as follows:
>     data Command result where
>         GetFoo :: Double -> Command Foo
>         PutFoo :: String -> Command Double

Right, that's exactly what I wrote at the end of my email. And then
indeed dispatch would be `dispatch :: Command a -> Snap a`. But how do
you derive an instance of Typeable and Read for this data type? The
Foo and the Double conflict and give a type error.

More information about the Glasgow-haskell-users mailing list