rankPages :: WG.WebG -> PageRank
rankPages  = foldl (\m u -> M.insertWith (+) u 1 m) M.empty . allLinks
  where
    allLinks webg = concat $ mapMaybe (`WG.links` webg) (WG.getURIs webg)


-- | Makes a search table which maps Words to web pages
rankPages :: WG.WebG -> PageRank
rankPages  = foldl (\m u -> M.insertWith (+) u 1 m) M.empty . allLinks
  where
    allLinks webg = concat $ mapMaybe (`WG.links` webg) (WG.getURIs webg)


-- | Makes a search table which maps Words to web pages
rankPages  = foldl (\m u -> M.insertWith (+) u 1 m) M.empty . allLinks
  where
    allLinks webg = concat $ mapMaybe (`WG.links` webg) (WG.getURIs webg)


-- | Makes a search table which maps Words to web pages