Speed up indegree
authorDavid Feuer <David.Feuer@gmail.com>
Thu, 8 Mar 2018 00:47:45 +0000 (19:47 -0500)
committerDavid Feuer <David.Feuer@gmail.com>
Thu, 8 Mar 2018 05:25:23 +0000 (00:25 -0500)
commita0395c7f080a63e72c79cd0d7bb86cb91264f888
tree14bbc7f8c9fe126b9d24b4b84c86d25337a21953
parent7b66a7810b7086abb169cdbc00405c47a904bb32
Speed up indegree

Instead of taking the transpose of a graph and then calculating
the outdegree, calculate the indegree directly. This probably
won't actually improve performance much (if at all) until
`base-4.12` or so comes out: see
[GHC Trac #14785](https://ghc.haskell.org/trac/ghc/ticket/14785).
If we want, we can reimplement `accumArray` ourselves to work around
this problem.

Fixes #533
Data/Graph.hs