
4 Sep
2009
4 Sep
'09
7:14 a.m.
Miguel Mitrofanov wrote:
Your data type GridWidget doesn't have a parameter, yet you use it like it has one.
data GridWidget = forall widget. (WidgetClass widget) => GridWidget widget ^ | NB:-------------+
This is allowed as long as you have enabled the ExistentialTypes extension. This declares a so-called existential type, see the wiki for details, http://www.haskell.org/haskellwiki/Existential_types . Note that the second occurrence of "GridWidget" defines a data constructor, not a type constructor. Cheers, Jochem -- Jochem Berndsen | jochem@functor.nl GPG: 0xE6FABFAB