- search stop expand [] = return ()
- search stop expand (x:xx) = do new <- expand x
- unlessM stop $ search stop expand (xx ++ new)
+ search stop expand [] depth = return ()
+ search stop expand x 0 = fail$ "Failed to reconstruct a type after " ++
+ show max_depth ++ " steps"
+ search stop expand (x:xx) d = do
+ new <- expand x
+ unlessM stop $ search stop expand (xx ++ new) $! (pred d)