Monthly Archives: August 2011

Efficiently calculating Hamming neighbourhoods in Haskell

How can we compute the -neighbourhood of a point ? Mathematically it’s no problem, we can just write The first idea would be to exploit Haskell’s math friendly syntactic feature calld list comprehension which would yield neigh :: Int -> Searchpoint -> [Searchpoint] neigh d x = [y | y Searchpoint -> [Searchpoint] neigh d [...]