Use "sum", rather than "foldr1 (+)", as it is complete.
Cosine isn't a valid metric. See #5.