[Haskell-cafe] Ambiguous type with PolymorphicComponents

Maurí­cio briqueabraque at yahoo.com
Sat Mar 7 14:28:21 EST 2009


Hi,

When reading this code in ghci, I get an
ambiguous type at last line:


{-# LANGUAGE PolymorphicComponents #-}
{-# LANGUAGE RankNTypes #-}
import Graphics.UI.Gtk
data Test = Test (forall w. WidgetClass w => w)
toAction (Test w) = toWidget w


It's interesting that if I replace 'Integral' for
'WidgetClass' and 'toInteger' for 'toWidget', I
get no error messages, and I see no essencial
diference between both classes and both functions.

Do you know what am I missing?

Thanks,
Maurício



More information about the Haskell-Cafe mailing list