Is module DFS really needed?
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
調査の方向性
まず DFS と NFA.hs からの外部利用を調査し、その後、必要な動作を依存関係 containers の Data.Graph と比較してください。置き換えが実行可能かどうかを判断する前に、サポートされている GHC のバージョンを確認してください。文書化された判断があり、未使用のコードが削除されるか、必要なグラフ動作を維持したまま置き換えが実装されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
The module DFS implements graph algorithms. From that module, only the functions out and t_close are used externally (in NFA.hs). The functions list_tree, mk_graph, edges, rev_edges, reverse_graph, scc, top_sort and dff, and the type Edge, are not used.
However, there's something else that strikes me from that module, and points to a potential cleaning opportunity:
-
The top comment reads "This module is a portable version of [...] [an] encoding of [...] linear graph algorithms. This module uses balanced binary trees instead of mutable arrays to implement the depth-first search so the complexity of the algorithms is n.log(n) instead of linear." However, isn't linear better than n times log(n)??? Why go for the latter if you can opt for the former?
-
There is an implementation of graphs in
Data.Graphin containers (and containers is already a dependency of alex), although I haven't checked if that was there already in the earliest version of GHC supported by alex, which I think is GHC 7 (?). The two functions used externally,outandt_close, could be defined, if I understand their purpose correctly, as:
out :: Graph -> Int -> [Int]
out = Data.Array.(!)
t_close :: Graph -> Graph
t_close g = buildG (bounds g) [ (v1, v2) | v1 <- vertices g, v2 <- reachable g v1 ]
List comprehensions are generally slower than map so there's probably a faster way of building t_close if performance is an issue here.
My questions are:
- Should this module be replaced by a use of
Data.Graph? - If not, should the unused functions mentioned above be removed?
- 主要言語
- Haskell
- スター
- 323
- フォーク
- 87
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
haskell/alex のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
-
UTF-8 and text 2.0オープンre: unicode
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
Agda-style Lexingオープンdiscussion
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
haskell/bytestring#730 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
seal-harness/seal-harness#399 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
fmidue/codeworld-tasks#124 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
reflex-frp/reflex#563 ·