withDef :: (Monad m, Default a) => m (Maybe a) -> m a
withDef f = do
  may <- f
  case may of
    Nothing  -> return def
    Just res -> return res
withDef :: (Monad m, Default a) => m (Maybe a) -> m a
withDef f = do
  may <- f
  case may of
    Nothing  -> return def
    Just res -> return res
withDef f = do
  may <- f
  case may of
    Nothing  -> return def
    Just res -> return res