drawSettlement :: MapGenM m => m [(Settlement, HexCoord)]
drawSettlement = do

  -- First collect the terrains.
  mgStep "Preparing settlement generation"
  b <- mgMapBounds
  let total = fromIntegral $ rangeSize b
  ths <- substep 0.00 0.10 $ forM (zip [0..] $ range b) $ \ (i, h) -> do
    mgProgress $ i % total
    t <- mgGetTerrain h
    return (t,Set.singleton h)
  let tm = foldl' (flip $ uncurry $ Map.insertWith Set.union) Map.empty ths

  mgStep "Placing settlements"
  ng <- mgNameGenerator
  ists <- mgSettlementGenerator
  let sts = concatMap (uncurry replicate) ists
      total = length sts
  substep 0.10 0.90 $ loop ng total Map.empty tm 0 sts
drawSettlement :: MapGenM m => m [(Settlement, HexCoord)]
drawSettlement = do

  -- First collect the terrains.
  mgStep "Preparing settlement generation"
  b <- mgMapBounds
  let total = fromIntegral $ rangeSize b
  ths <- substep 0.00 0.10 $ forM (zip [0..] $ range b) $ \ (i, h) -> do
    mgProgress $ i % total
    t <- mgGetTerrain h
    return (t,Set.singleton h)
  let tm = foldl' (flip $ uncurry $ Map.insertWith Set.union) Map.empty ths

  mgStep "Placing settlements"
  ng <- mgNameGenerator
  ists <- mgSettlementGenerator
  let sts = concatMap (uncurry replicate) ists
      total = length sts
  substep 0.10 0.90 $ loop ng total Map.empty tm 0 sts
drawSettlement = do

  -- First collect the terrains.
  mgStep "Preparing settlement generation"
  b <- mgMapBounds
  let total = fromIntegral $ rangeSize b
  ths <- substep 0.00 0.10 $ forM (zip [0..] $ range b) $ \ (i, h) -> do
    mgProgress $ i % total
    t <- mgGetTerrain h
    return (t,Set.singleton h)
  let tm = foldl' (flip $ uncurry $ Map.insertWith Set.union) Map.empty ths

  mgStep "Placing settlements"
  ng <- mgNameGenerator
  ists <- mgSettlementGenerator
  let sts = concatMap (uncurry replicate) ists
      total = length sts
  substep 0.10 0.90 $ loop ng total Map.empty tm 0 sts