Sorry, missed a line of `class WidgetClass w`.```class WidgetClass w wherewidgetChildren :: w -> [Widget]```On Tue, Jul 29, 2014 at 2:29 PM, Magicloud Magiclouds <magicloud.magiclouds@gmail.com> wrote:
Hi,I have code like follow. And compiling gave me error as the last part. What should I do?```class WidgetClass wdata Widget = forall a. WidgetClass a => Widget a
instance WidgetClass WidgetlookupWin :: (WidgetClass w) => WINDOW -> w -> Maybe wlookupWin xwin widget =if widgetWindowId widget == xwinthen Just widgetelse foldl (\a (Widget b) ->maybe (lookupWin xwin b) Just a) Nothing $ widgetChildren widget```---```Graphics/HUI/Widget.hs:15:23:Could not deduce (w ~ a)from the context (WidgetClass w)bound by the type signature forlookupWin :: WidgetClass w => WINDOW -> w -> Maybe wat Graphics/HUI/Widget.hs:10:14-54or from (WidgetClass a)bound by a pattern with constructorWidget :: forall a. WidgetClass a => a -> Widget,in a lambda abstractionat Graphics/HUI/Widget.hs:14:19-26‘w’ is a rigid type variable bound bythe type signature forlookupWin :: WidgetClass w => WINDOW -> w -> Maybe wat Graphics/HUI/Widget.hs:10:14‘a’ is a rigid type variable bound bya pattern with constructorWidget :: forall a. WidgetClass a => a -> Widget,in a lambda abstractionat Graphics/HUI/Widget.hs:14:19Expected type: Maybe wActual type: Maybe aRelevant bindings includeb :: a (bound at Graphics/HUI/Widget.hs:14:26)a :: Maybe w (bound at Graphics/HUI/Widget.hs:14:16)widget :: w (bound at Graphics/HUI/Widget.hs:11:16)lookupWin :: WINDOW -> w -> Maybe w(bound at Graphics/HUI/Widget.hs:11:1)In the first argument of ‘maybe’, namely ‘(lookupWin xwin b)’In the expression: maybe (lookupWin xwin b) Just a```--
竹密岂妨流水过
山高哪阻野云飞
And for G+, please use magiclouds#gmail.com.--
竹密岂妨流水过
山高哪阻野云飞
And for G+, please use magiclouds#gmail.com.