4 ms·
That's definitely pathological, but not from a "small function" point of view. xor_it is simple unnecessary to write and xor_them is just a fold on xor_it. This
by tel 15y ago
That's definitely pathological, but not from a "small function" point of view. xor_it is simple unnecessary to write and xor_them is just a fold on xor_it. This is undue multiplication of names.
_ = require 'underscore'
xor_them = (them) -> _.reduce(them, (a,b) -> a^b)
Or better
import Data.Bits (xor)
xor_them :: Bits a => [a] -> a
xor_them = foldl1 xor