
I have trouble in returning a list of Figures. I want return a type of m (Maybe [Figure IO]), but the type of dv_findFigure is :: a -> Point -> s (Maybe (Figure s)). How can change the code below to get a s (Maybe [Figure s])? Thank you in advance! dv_findFigure :: a -> Point -> s (Maybe (Figures)) fig_contains :: fig -> Point -> m Bool anc :: Point do fs <- dv_getSelFigs dv fs' <- filterM (`fig_contains` anc) fs f <- case fs' of [] -> dv_findFigure dv anc fig : _ -> return $ Just fig case f of Just f' -> tool_dragtrack self f' Nothing -> dv_clearSel dv >> tool_areatrack self Couldn't match expected type `Figure m' against inferred type `[Figure IO]' Expected type: m (Maybe (Figure m)) Inferred type: m (Maybe [Figure IO]) In the expression: return $ Just fs In a case alternative: fig : _ -> return $ Just fs