Most popular packages removed in LTS-22

I wrote some ungodly hack to find out which are the packages with the most reverse dependency that got removed in LTS-22.0.

wget "https://www.stackage.org/diff/lts-21.25/lts-22.0"
# find packages that got removed (might have been added too though, see later step)
ack '><span class="version-removed' lts-22.0 | sed -re 's%^.*package/([^0-9]*)-[0-9.-]*#changes.*$%\1%' > removed.txt
# pattern above didn't handle package names with hyphens or numbers. so handle them separately
sed -re '/^<td/d' < removed.txt > no-tds.txt                  
ack "^<td" removed.txt | cut -c 57- | rev | cut -d- -f3- | rev >> no-tds.txt
# filter out the packages that got added (which means version was just changed)
for i in $(cat no-tds.txt ); do grep -q "$i.*version-added" lts-22.0; if [ $? != 0 ]; then echo $i; fi; done > not-added.txt

wget "https://hackage.haskell.org/packages/reverse"
xmllint --format reverse > formatted
for i in $(cat not-added.txt); do RES=$(grep -A2 "/package/$i\"" formatted | tail -n1 | sed -re 's/.*<td>([0-9]*) .*$/\1/'); echo "$RES $i"; done | sort -n

tail of output:

10 cron
10 dunai
10 pattern-arrows
10 unexceptionalio-trans
10 writer-cps-mtl
11 Spock-core
12 geniplate-mirror
12 unliftio-pool
12 xmonad-contrib
13 tcp-streams
14 hw-simd
15 unbound-generics
16 hsx-jmacro
16 instance-control
17 reform-blaze
17 web-routes-boomerang
17 web-routes-hsp
18 reform-happstack
18 web-routes-happstack
19 happstack-hsp
21 ConfigFile
21 hsx2hs
21 hw-rankselect
22 hw-balancedparens
23 hw-excess
23 reform
24 hw-rankselect-base
24 monad-products
26 comonad-extras
27 web-routes-th
32 monad-primitive
38 tagshare
42 harp
45 dual
174 highlighting-kate
213 stm-lifted
231 bytestring-mmap
1105 monadloc
3529 cprng-aes
3531 crypto-random
3607 web-routes
3881 d10
4879 bits-extra
7664 semigroupoid-extras
5 Likes

The first column, which is the amount of total transitive reverse dependencies should be taken with a grain of salt, since it includes all versions of the package. So even though a package has a large number, it might not be a big deal since there could be a replacement package.

For example, ‘monadloc’, which was removed, is depended on by ‘attempt’, which is depended on by old version of ‘yesod’. ‘attempt’ was deprecated in favour of ‘exceptions’.

It might make sense to use sort -nr rather than sort -n because otherwise 10 is at the top, and at a glance the list doesn’t appear very interesting!

3 Likes

Thanks for this experiment!

I found hackage reverse dependencies too far off reality, for the reasons you mentioned. One should restrict reverse dependencies to package that have some evidence that they recently built, e.g. that they have been in a stackage snapshot recently.