On Thu, Sep 3, 2009 at 11:05 PM, Magicloud Magiclouds<magicloud.magiclo...@gmail.com> wrote: > data GridWidget = forall widget. (WidgetClass widget) => GridWidget widget > > liftGW :: (GridWidget widget) -> (widget -> t) -> t > liftGW (GridWidget label) f = f label > liftGW (GridWidget textView) f = f textView
The type signature on liftGW is wrong. Also, as mentioned elsewhere, the two matches overlap; the second case never gets called. The correct type signature for "liftGW" is: liftGW :: GridWidget -> (forall widget. WidgetClass widget => widget -> t) -> t Note that the "f" passed in has to accept *any* widget type, so it's possible that existential types aren't what you want. -- ryan _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe