Based on the techniques described in Matt Parker's video explaining optimized versions: https://www.youtube.com/watch?v=c33AZBnRHks
See also his earlier video introducing the problem: https://www.youtube.com/watch?v=_-AfhLQfb6w
It can be run with
cabal run
or with
cabal build
followed by the path it spits out as
Linking /.../.../five-five-letters
to avoid including the build time.
To install cabal and ghc, follow instructions here: https://www.haskell.org/ghcup/