-- | Calculate the offset of a Word16 into its class.
--
-- You can use @popCount@ to calculate the class, given @w <= 0x7fff@
--
-- @
-- 'bitmap' ('popCount' w) ('offset' w) = w
-- @
offset :: Word16 -> Word16
offset w = fromIntegral (offsets P.! fromIntegral w)
offset :: Word16 -> Word16
offset w = fromIntegral (offsets P.! fromIntegral w)
offset w = fromIntegral (offsets P.! fromIntegral w)