- 论坛徽章:
- 0
|
Main.hs:28:40:
Ambiguous type variable `t' in the constraint:
`W.Widget t'
arising from a use of `W.widgetRun' at Main.hs:28:40-57
Probable fix: add a type signature that fixes these type variable(s)
---
25 main = do
26 prs <- newEmptyMVar
27 prs_ <- foldM (\prs_ (x, y, widget) -> do
28 pid <- forkProcess $ W.widgetRun widget
29 return $ M.insert pid (x, y, fst $ W.widgetNew widget, snd $ W.widgetNew widget) prs_
30 ) M.empty widgetList
...
84 widgetList :: (W.Widget w) => [(Integer, Integer, w)]
85 widgetList = []
...
1 module Widget where
2
3 class Widget w where
4 widgetNew :: w -> (Integer, Integer)
5 widgetRun :: w -> IO () |
|