Haskell mathsy stuff. Mostly experiments.