During my recent pairing with @robrix, we agreed that the name of
Linker was inaccurate—it doesn't link anything, it just keeps track of
past modules. This renames it and its module.
This introduces a configuration file to ease the use of the
[stylish-haskell](https://github.com/jaspervdj/stylish-haskell)
formatting tool. While the `semantic` codebase is already quite
well-formatted, this tool makes it easy to DTRT when writing new code,
and is a good place to centralize our coding style.
Installing `stylish-haskell` is as easy as `stack install stylish-haskell`.
You can always opt-out! This is all entirely optional.
Editor support:
* emacs — bind `haskell-mode-stylish-buffer` to a keybinding or hook.
* vim — `:set formatprg=stylish-haskell` or install `vim-stylish-haskell`.
* atom — if you have `haskell-ide` installed, the Prettify menu item
should do the right thing.
It's worth reading through the options that stylish-haskell
provides. The options I chose here differ a bit from the default, as I
tried to pick a style that's cromulent with the codebase as it exists
today. If you have any thoughts as to what stylistic changes we could
or should make (example: though I've disabled it, stylish-haskell
makes it easy to keep every `LANGUAGE` pragma on the same line),
please let me know.
I don't think it's necessary to go through and apply `stylish` to our
existing codebase, as it would pollute the history. But I plan to use
it going forward, and maybe you will too!
The caching analysis had been disabled, as it was still written in the
open-interpreter style. This patch restores it, defining a
`CachingAnalysis` newtype that uses nondeterministic but convergent
caching in its `MonadAnalysis` instance. This also defines an
`embedSubterm` helper that is useful in defining new analysis passes.
Thanks to @robrix for 🍐!