-- | Converts any (pos/neg) integer to a 16-bit bin-string
toBinaryString :: Int -> Text
toBinaryString n =
  T.pack $
    leftpad 16 '0' $
      showIntAtBase 2 intToDigit (n `mod` 2 ^ 15) ""
toBinaryString :: Int -> Text
toBinaryString n =
  T.pack $
    leftpad 16 '0' $
      showIntAtBase 2 intToDigit (n `mod` 2 ^ 15) ""
toBinaryString n =
  T.pack $
    leftpad 16 '0' $
      showIntAtBase 2 intToDigit (n `mod` 2 ^ 15) ""