Purely functional bitset in Haskell